forked from opdenkamp/xbmc
/
GUIPassword.h
76 lines (63 loc) · 2.37 KB
/
GUIPassword.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#pragma once
/*
* Copyright (C) 2005-2012 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include "utils/StdString.h"
class CFileItem;
class CMediaSource;
#include <vector>
#include <map>
typedef std::vector<CMediaSource> VECSOURCES;
typedef enum
{
LOCK_MODE_UNKNOWN = -1,
LOCK_MODE_EVERYONE = 0,
LOCK_MODE_NUMERIC = 1,
LOCK_MODE_GAMEPAD = 2,
LOCK_MODE_QWERTY = 3,
LOCK_MODE_SAMBA = 4,
LOCK_MODE_EEPROM_PARENTAL = 5
} LockType;
class CGUIPassword
{
public:
CGUIPassword(void);
virtual ~CGUIPassword(void);
bool IsItemUnlocked(CFileItem* pItem, const CStdString &strType);
bool IsItemUnlocked(CMediaSource* pItem, const CStdString &strType);
bool CheckLock(LockType btnType, const CStdString& strPassword, int iHeading);
bool CheckLock(LockType btnType, const CStdString& strPassword, int iHeading, bool& bCanceled);
bool IsProfileLockUnlocked(int iProfile=-1);
bool IsProfileLockUnlocked(int iProfile, bool& bCanceled, bool prompt = true);
bool IsMasterLockUnlocked(bool bPromptUser);
bool IsMasterLockUnlocked(bool bPromptUser, bool& bCanceled);
void UpdateMasterLockRetryCount(bool bResetCount);
bool CheckStartUpLock();
bool CheckMenuLock(int iWindowID);
bool SetMasterLockMode(bool bDetails=true);
bool LockSource(const CStdString& strType, const CStdString& strName, bool bState);
void LockSources(bool lock);
void RemoveSourceLocks();
bool IsDatabasePathUnlocked(const CStdString& strPath, VECSOURCES& vecSources);
bool bMasterUser;
int iMasterLockRetriesLeft;
private:
int VerifyPassword(LockType btnType, const CStdString& strPassword, const CStdString& strHeading);
};
extern CGUIPassword g_passwordManager;