4 * Copyright (C) 2005-2013 Team XBMC
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
26 #include "settings/ISettingCallback.h"
27 #include "utils/StdString.h"
32 typedef std::vector<CMediaSource> VECSOURCES;
36 LOCK_MODE_UNKNOWN = -1,
37 LOCK_MODE_EVERYONE = 0,
38 LOCK_MODE_NUMERIC = 1,
39 LOCK_MODE_GAMEPAD = 2,
42 LOCK_MODE_EEPROM_PARENTAL = 5
45 class CGUIPassword : public ISettingCallback
49 virtual ~CGUIPassword(void);
50 bool IsItemUnlocked(CFileItem* pItem, const CStdString &strType);
51 bool IsItemUnlocked(CMediaSource* pItem, const CStdString &strType);
52 bool CheckLock(LockType btnType, const CStdString& strPassword, int iHeading);
53 bool CheckLock(LockType btnType, const CStdString& strPassword, int iHeading, bool& bCanceled);
54 bool IsProfileLockUnlocked(int iProfile=-1);
55 bool IsProfileLockUnlocked(int iProfile, bool& bCanceled, bool prompt = true);
56 bool IsMasterLockUnlocked(bool bPromptUser);
57 bool IsMasterLockUnlocked(bool bPromptUser, bool& bCanceled);
59 void UpdateMasterLockRetryCount(bool bResetCount);
60 bool CheckStartUpLock();
61 bool CheckMenuLock(int iWindowID);
62 bool SetMasterLockMode(bool bDetails=true);
63 bool LockSource(const CStdString& strType, const CStdString& strName, bool bState);
64 void LockSources(bool lock);
65 void RemoveSourceLocks();
66 bool IsDatabasePathUnlocked(const CStdString& strPath, VECSOURCES& vecSources);
68 virtual void OnSettingAction(const CSetting *setting);
71 int iMasterLockRetriesLeft;
74 int VerifyPassword(LockType btnType, const CStdString& strPassword, const CStdString& strHeading);
77 extern CGUIPassword g_passwordManager;