Debian Codegraph @

xbmc/profiles/dialogs/GUIDialogLockSettings.h

raw
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9 #pragma once
10
11 #include "profiles/Profile.h"
12 #include "settings/dialogs/GUIDialogSettingsManualBase.h"
13
14 class CGUIDialogLockSettings : public CGUIDialogSettingsManualBase
15 {
16 public:
17 CGUIDialogLockSettings();
18 ~CGUIDialogLockSettings() override;
19
20 static bool ShowAndGetLock(LockType &lockMode, std::string &password, int header = 20091);
21 static bool ShowAndGetLock(CProfile::CLock &locks, int buttonLabel = 20091, bool conditional = false, bool details = true);
22 static bool ShowAndGetUserAndPassword(std::string &user, std::string &password, const std::string &url, bool *saveUserDetails);
23
24 protected:
25 // implementations of ISettingCallback
26 void OnSettingChanged(const std::shared_ptr<const CSetting>& setting) override;
27 void OnSettingAction(const std::shared_ptr<const CSetting>& setting) override;
28
29 // specialization of CGUIDialogSettingsBase
30 bool AllowResettingSettings() const override { return false; }
31 bool Save() override { return true; }
32 void OnCancel() override;
33 void SetupView() override;
34
35 // specialization of CGUIDialogSettingsManualBase
36 void InitializeSettings() override;
37
38 private:
39 std::string GetLockModeLabel();
40 void SetDetailSettingsEnabled(bool enabled);
41 void SetSettingLockCodeLabel();
42
43 bool m_changed = false;
44
45 CProfile::CLock m_locks;
46 std::string m_user;
47 std::string m_url;
48 bool m_details = true;
49 bool m_conditionalDetails = false;
50 bool m_getUser = false;
51 bool* m_saveUserDetails;
52 int m_buttonLabel = 20091;
53 };