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/>.
23 #include "utils/StdString.h"
31 typedef std::vector<CMediaSource> VECSOURCES;
35 LOCK_MODE_UNKNOWN = -1,
36 LOCK_MODE_EVERYONE = 0,
37 LOCK_MODE_NUMERIC = 1,
38 LOCK_MODE_GAMEPAD = 2,
41 LOCK_MODE_EEPROM_PARENTAL = 5
48 virtual ~CGUIPassword(void);
49 bool IsItemUnlocked(CFileItem* pItem, const CStdString &strType);
50 bool IsItemUnlocked(CMediaSource* pItem, const CStdString &strType);
51 bool CheckLock(LockType btnType, const CStdString& strPassword, int iHeading);
52 bool CheckLock(LockType btnType, const CStdString& strPassword, int iHeading, bool& bCanceled);
53 bool IsProfileLockUnlocked(int iProfile=-1);
54 bool IsProfileLockUnlocked(int iProfile, bool& bCanceled, bool prompt = true);
55 bool IsMasterLockUnlocked(bool bPromptUser);
56 bool IsMasterLockUnlocked(bool bPromptUser, bool& bCanceled);
58 void UpdateMasterLockRetryCount(bool bResetCount);
59 bool CheckStartUpLock();
60 bool CheckMenuLock(int iWindowID);
61 bool SetMasterLockMode(bool bDetails=true);
62 bool LockSource(const CStdString& strType, const CStdString& strName, bool bState);
63 void LockSources(bool lock);
64 void RemoveSourceLocks();
65 bool IsDatabasePathUnlocked(const CStdString& strPath, VECSOURCES& vecSources);
68 int iMasterLockRetriesLeft;
71 int VerifyPassword(LockType btnType, const CStdString& strPassword, const CStdString& strHeading);
74 extern CGUIPassword g_passwordManager;