CuteHMI - Graphical User Interface (CuteHMI.GUI.1)
ColorSet.hpp
1 #ifndef H_EXTENSIONS_CUTEHMI_GUI_1_INCLUDE_CUTEHMI_GUI_COLORSET_HPP
2 #define H_EXTENSIONS_CUTEHMI_GUI_1_INCLUDE_CUTEHMI_GUI_COLORSET_HPP
3 
4 #include "internal/common.hpp"
5 
6 #include <QObject>
7 #include <QColor>
8 
9 namespace cutehmi {
10 namespace gui {
11 
15 class CUTEHMI_GUI_API ColorSet:
16  public QObject
17 {
18  Q_OBJECT
19 
20  public:
25  Q_PROPERTY(QColor base READ base WRITE setBase NOTIFY baseChanged)
26 
27 
32  Q_PROPERTY(QColor fill READ fill WRITE setFill NOTIFY fillChanged)
33 
37  Q_PROPERTY(QColor tint READ tint WRITE setTint NOTIFY tintChanged)
38 
42  Q_PROPERTY(QColor shade READ shade WRITE setShade NOTIFY shadeChanged)
43 
51  Q_PROPERTY(QColor background READ background WRITE setBackground NOTIFY backgroundChanged)
52 
60  Q_PROPERTY(QColor foreground READ foreground WRITE setForeground NOTIFY foregroundChanged)
61 
67  Q_PROPERTY(QColor stroke READ stroke WRITE setStroke NOTIFY strokeChanged)
68 
73  ColorSet(QObject * parent = nullptr);
74 
79  QColor base() const;
80 
85  void setBase(QColor base);
86 
91  QColor fill() const;
92 
97  void setFill(QColor fill);
98 
103  QColor tint() const;
104 
109  void setTint(QColor tint);
110 
115  QColor shade() const;
116 
121  void setShade(QColor shade);
122 
127  QColor background() const;
128 
133  void setBackground(QColor background);
134 
139  QColor foreground() const;
140 
145  void setForeground(QColor foreground);
146 
151  QColor stroke() const;
152 
157  void setStroke(QColor stroke);
158 
159  signals:
163  void baseChanged();
164 
168  void fillChanged();
169 
173  void tintChanged();
174 
178  void shadeChanged();
179 
183  void backgroundChanged();
184 
188  void foregroundChanged();
189 
193  void strokeChanged();
194 
195  private:
196  struct Members
197  {
198  QColor base;
199  QColor fill;
200  QColor tint;
201  QColor shade;
202  QColor background;
203  QColor foreground;
204  QColor stroke;
205  };
206 
207  MPtr<Members> m;
208 };
209 
210 }
211 }
212 
213 #endif
214 
215 //(c)C: Copyright © 2020, Michał Policht <michal@policht.pl>. All rights reserved.
216 //(c)C: SPDX-License-Identifier: LGPL-3.0-or-later OR MIT
217 //(c)C: This file is a part of CuteHMI.
218 //(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.
219 //(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.
220 //(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/>.
221 //(c)C: Additionally, this file is licensed under terms of MIT license as expressed below.
222 //(c)C: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
223 //(c)C: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
224 //(c)C: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
QColor
cutehmi::MPtr< Members >
QObject
cutehmi
cutehmi::gui::ColorSet
Color set.
Definition: ColorSet.hpp:15