summaryrefslogtreecommitdiffstats
path: root/xbmc/settings/SettingConditions.h
blob: f51d9e0eaf1ae486fdf31cf8b4e8c194b97c58c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 *  Copyright (C) 2014-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 "settings/lib/SettingConditions.h"

#include <set>
#include <string>

class CProfile;
class CProfileManager;

class CSettingConditions
{
public:
  static void Initialize();
  static void Deinitialize();

  static const CProfile& GetCurrentProfile();

  static const std::set<std::string>& GetSimpleConditions() { return m_simpleConditions; }
  static const std::map<std::string, SettingConditionCheck>& GetComplexConditions() { return m_complexConditions; }

  static bool Check(const std::string& condition,
                    const std::string& value = "",
                    const std::shared_ptr<const CSetting>& setting = NULL);

private:
  // Initialization parameters
  static const CProfileManager *m_profileManager;

  static std::set<std::string> m_simpleConditions;
  static std::map<std::string, SettingConditionCheck> m_complexConditions;
};