3 * Copyright (C) 2013 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
25 #include "ViewState.h"
26 #include "guilib/GraphicContext.h"
27 #include "settings/ISubSettings.h"
28 #include "settings/Setting.h"
29 #include "threads/CriticalSection.h"
33 class CViewStateSettings : public ISubSettings
36 static CViewStateSettings& Get();
38 virtual bool Load(const TiXmlNode *settings);
39 virtual bool Save(TiXmlNode *settings) const;
42 const CViewState* Get(const std::string &viewState) const;
43 CViewState* Get(const std::string &viewState);
45 SettingLevel GetSettingLevel() const { return m_settingLevel; }
46 void SetSettingLevel(SettingLevel settingLevel);
47 void CycleSettingLevel();
51 CViewStateSettings(const CViewStateSettings&);
52 CViewStateSettings const& operator=(CViewStateSettings const&);
53 virtual ~CViewStateSettings();
56 std::map<std::string, CViewState*> m_viewStates;
57 SettingLevel m_settingLevel;
58 CCriticalSection m_critical;
60 void AddViewState(const std::string& strTagName, int defaultView = DEFAULT_VIEW_LIST, SORT_METHOD defaultSort = SORT_METHOD_LABEL);