Debian Codegraph @

xbmc/guilib/GUIColorManager.h

raw symbols SCIP
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 /*!
12 \file GUIColorManager.h
13 \brief
14 */
15
16 /*!
17 \ingroup textures
18 \brief
19 */
20
21 #include "utils/ColorUtils.h"
22
23 #include <map>
24 #include <string>
25 #include <utility>
26 #include <vector>
27
28 class CXBMCTinyXML;
29
30 class CGUIColorManager
31 {
32 public:
33 CGUIColorManager(void);
34 virtual ~CGUIColorManager(void);
35
36 void Load(const std::string &colorFile);
37
38 UTILS::COLOR::Color GetColor(const std::string& color) const;
39
40 void Clear();
41
42 /*! \brief Load a colors list from a XML file
43 \param filePath The path to the XML file
44 \param colors The vector to populate
45 \param sortColors if true the colors will be sorted in a hue scale
46 \return true if success, otherwise false
47 */
48 bool LoadColorsListFromXML(const std::string& filePath,
49 std::vector<std::pair<std::string, UTILS::COLOR::ColorInfo>>& colors,
50 bool sortColors);
51
52 protected:
53 bool LoadXML(CXBMCTinyXML& xmlDoc);
54
55 std::map<std::string, UTILS::COLOR::Color> m_colors;
56 };