Debian Codegraph @

xbmc/guilib/guiinfo/GUIInfoColor.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 GUIInfoColor.h
13 \brief
14 */
15
16 #include "guilib/GUIListItem.h"
17 #include "utils/ColorUtils.h"
18
19 #include <string>
20
21 class CGUIListItem;
22
23 namespace KODI
24 {
25 namespace GUILIB
26 {
27 namespace GUIINFO
28 {
29
30 class CGUIInfoColor
31 {
32 public:
33 constexpr CGUIInfoColor(UTILS::COLOR::Color color = 0) : m_color(color) {}
34
35 constexpr operator UTILS::COLOR::Color() const { return m_color; }
36
37 bool Update(const CGUIListItem* item = nullptr);
38 void Parse(const std::string &label, int context);
39
40 /*!
41 * @brief Check if the infocolor has an info condition bound to its color definition (or otherwise, if it's constant color)
42 * @return true if the color depends on an info condition, false otherwise
43 */
44 bool HasInfo() const { return m_info != 0; }
45
46 private:
47 int m_info = 0;
48 UTILS::COLOR::Color m_color;
49 };
50
51 } // namespace GUIINFO
52 } // namespace GUILIB
53 } // namespace KODI