CuteHMI - Graphical User Interface (CuteHMI.GUI.0)
Palette.hpp
1 #ifndef H_EXTENSIONS_CUTEHMI_GUI_0_INCLUDE_CUTEHMI_GUI_PALETTE_HPP
2 #define H_EXTENSIONS_CUTEHMI_GUI_0_INCLUDE_CUTEHMI_GUI_PALETTE_HPP
3 
4 #include "internal/common.hpp"
5 #include "ColorSet.hpp"
6 
7 #include <QObject>
8 
9 namespace cutehmi {
10 namespace gui {
11 
19 class CUTEHMI_GUI_API Palette:
20  public QObject
21 {
22  Q_OBJECT
23 
24  public:
28  Q_PROPERTY(QColor background READ background WRITE setBackground NOTIFY backgroundChanged)
29 
30 
33  Q_PROPERTY(ColorSet * alarm READ alarm WRITE setAlarm NOTIFY alarmChanged)
34 
38  Q_PROPERTY(ColorSet * warning READ warning WRITE setWarning NOTIFY warningChanged)
39 
43  Q_PROPERTY(ColorSet * active READ active WRITE setActive NOTIFY activeChanged)
44 
48  Q_PROPERTY(ColorSet * inactive READ inactive WRITE setInactive NOTIFY inactiveChanged)
49 
53  Q_PROPERTY(ColorSet * neutral READ neutral WRITE setNeutral NOTIFY neutralChanged)
54 
55  Palette(QObject * parent = nullptr);
56 
57  QColor background() const;
58 
59  void setBackground(QColor background);
60 
61  ColorSet * alarm() const;
62 
63  void setAlarm(ColorSet * alarm);
64 
65  ColorSet * warning() const;
66 
67  void setWarning(ColorSet * warning);
68 
69  ColorSet * active() const;
70 
71  void setActive(ColorSet * active);
72 
73  ColorSet * inactive() const;
74 
75  void setInactive(ColorSet * inactive);
76 
77  ColorSet * neutral() const;
78 
79  void setNeutral(ColorSet * neutral);
80 
81  signals:
82  void backgroundChanged();
83 
84  void alarmChanged();
85 
86  void warningChanged();
87 
88  void activeChanged();
89 
90  void inactiveChanged();
91 
92  void neutralChanged();
93 
94  private:
95  struct Members
96  {
97  QColor background;
98  ColorSet * alarm;
99  ColorSet * warning;
100  ColorSet * active;
101  ColorSet * inactive;
102  ColorSet * neutral;
103 
104  Members():
105  alarm(nullptr),
106  warning(nullptr),
107  active(nullptr),
108  inactive(nullptr),
109  neutral(nullptr)
110  {
111  }
112  };
113 
114  MPtr<Members> m;
115 };
116 
117 }
118 }
119 
120 #endif
121 
122 //(c)C: Copyright © 2020, Michał Policht <michal@policht.pl>. All rights reserved.
123 //(c)C: This file is a part of CuteHMI.
124 //(c)C: CuteHMI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
125 //(c)C: CuteHMI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
126 //(c)C: You should have received a copy of the GNU Lesser General Public License along with CuteHMI. If not, see <https://www.gnu.org/licenses/>.
QColor
cutehmi::MPtr< Members >
QObject
cutehmi
cutehmi::gui::ColorSet
Color set.
Definition: ColorSet.hpp:15
cutehmi::gui::Palette
Palette.
Definition: Palette.hpp:19