diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /xbmc/view/ViewStateSettings.h | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xbmc/view/ViewStateSettings.h')
-rw-r--r-- | xbmc/view/ViewStateSettings.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/xbmc/view/ViewStateSettings.h b/xbmc/view/ViewStateSettings.h new file mode 100644 index 0000000..2a18fc9 --- /dev/null +++ b/xbmc/view/ViewStateSettings.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2013-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "ViewState.h" +#include "events/IEvent.h" +#include "settings/ISubSettings.h" +#include "settings/lib/Setting.h" +#include "threads/CriticalSection.h" +#include "windowing/GraphicContext.h" + +#include <map> +#include <string> + +class TiXmlNode; + +class CViewStateSettings : public ISubSettings +{ +public: + static CViewStateSettings& GetInstance(); + + bool Load(const TiXmlNode *settings) override; + bool Save(TiXmlNode *settings) const override; + void Clear() override; + + const CViewState* Get(const std::string &viewState) const; + CViewState* Get(const std::string &viewState); + + SettingLevel GetSettingLevel() const { return m_settingLevel; } + void SetSettingLevel(SettingLevel settingLevel); + void CycleSettingLevel(); + SettingLevel GetNextSettingLevel() const; + + EventLevel GetEventLevel() const { return m_eventLevel; } + void SetEventLevel(EventLevel eventLevel); + void CycleEventLevel(); + EventLevel GetNextEventLevel() const; + bool ShowHigherEventLevels() const { return m_eventShowHigherLevels; } + void SetShowHigherEventLevels(bool showHigherEventLevels) { m_eventShowHigherLevels = showHigherEventLevels; } + void ToggleShowHigherEventLevels() { m_eventShowHigherLevels = !m_eventShowHigherLevels; } + +protected: + CViewStateSettings(); + CViewStateSettings(const CViewStateSettings&) = delete; + CViewStateSettings& operator=(CViewStateSettings const&) = delete; + ~CViewStateSettings() override; + +private: + std::map<std::string, CViewState*> m_viewStates; + SettingLevel m_settingLevel = SettingLevel::Standard; + EventLevel m_eventLevel = EventLevel::Basic; + bool m_eventShowHigherLevels = true; + mutable CCriticalSection m_critical; + + void AddViewState(const std::string& strTagName, int defaultView = DEFAULT_VIEW_LIST, SortBy defaultSort = SortByLabel); +}; |