StyleOptions.h
1 /* Copyright (C) 2016 Laurentiu-Gheorghe Crisan
2  Copyright (C) 2016 Marc Boris Duerner
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  As a special exception, you may use this file as part of a free
10  software library without restriction. Specifically, if other files
11  instantiate templates or use macros or inline functions from this
12  file, or you compile this file and link it with other files to
13  produce an executable, this file does not by itself cause the
14  resulting executable to be covered by the GNU General Public
15  License. This exception does not however invalidate any other
16  reasons why the executable file might be covered by the GNU Library
17  General Public License.
18 
19  This library is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  Lesser General Public License for more details.
23 
24  You should have received a copy of the GNU Lesser General Public
25  License along with this library; if not, write to the Free Software
26  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
27  MA 02110-1301 USA
28 */
29 
30 #ifndef Pt_Forms_StyleOptions_h
31 #define Pt_Forms_StyleOptions_h
32 
33 #include <Pt/Forms/Api.h>
34 #include <Pt/Gfx/Pen.h>
35 #include <Pt/Gfx/Brush.h>
36 #include <Pt/Gfx/Font.h>
37 #include <Pt/Gfx/Color.h>
38 #include <Pt/NonCopyable.h>
39 
40 #include <cstddef>
41 
42 namespace Pt {
43 
44 namespace Forms {
45 
46 class PT_FORMS_API StyleOptions
47 {
48  public:
49  explicit StyleOptions();
50 
51  StyleOptions(const StyleOptions& o);
52 
53  virtual ~StyleOptions();
54 
55  StyleOptions& operator=(const StyleOptions& o);
56 
57  // background
58  // foreground
59  // textColor
60 
61  // highlightColor
62  // highlightedTextBackground
63  // highlightedTextColor
64 
65  // accentColor
66  // selectedColor
67  // activeColor
68 
69  // textBackground
70  // alternateTextBackground
71 
72  // tooltipBackground / popupBackground
73  // tooltipForeground / popupForeground
74  // tooltipTextColor / popupTextColor
75 
76  const Gfx::Brush& background() const
77  {
78  return _background;
79  }
80 
81  void setBackground(const Gfx::Brush& b)
82  {
83  _background = b;
84  ++_generation;
85  }
86 
87  const Gfx::Brush& foreground() const
88  {
89  return _foreground;
90  }
91 
92  void setForeground(const Gfx::Brush& c)
93  {
94  _foreground = c;
95  ++_generation;
96  }
97 
98  const Gfx::Pen& contour() const
99  {
100  return _contour;
101  }
102 
103  void setContour(const Gfx::Pen& p)
104  {
105  _contour = p;
106  ++_generation;
107  }
108 
109  const Gfx::Color& accentColor() const
110  {
111  return _accentColor;
112  }
113 
114  void setAccentColor(const Gfx::Color& color)
115  {
116  _accentColor = color;
117  ++_generation;
118  }
119 
120  const Gfx::Brush& viewBackground() const
121  {
122  return _viewBackground;
123  }
124 
125  void setViewBackground(const Gfx::Brush& b)
126  {
127  _viewBackground = b;
128  ++_generation;
129  }
130 
131  const Gfx::Color& highlightColor() const
132  {
133  return _highlightColor;
134  }
135 
136  void setHighlightColor(const Gfx::Color& c)
137  {
138  _highlightColor = c;
139  ++_generation;
140  }
141 
142  const Gfx::Brush& textBackground() const
143  {
144  return _textBackground;
145  }
146 
147  void setTextBackground(const Gfx::Brush& b)
148  {
149  _textBackground = b;
150  ++_generation;
151  }
152 
153  const Gfx::Color& textColor() const
154  {
155  return _textColor;
156  }
157 
158  void setTextColor(const Gfx::Color& c)
159  {
160  _textColor = c;
161  ++_generation;
162  }
163 
164  const Gfx::Color& highlightedTextColor() const
165  {
166  return _highlightedTextColor;
167  }
168 
169  void setHighlightedTextColor(const Gfx::Color& c)
170  {
171  _highlightedTextColor = c;
172  ++_generation;
173  }
174 
175  const Gfx::Font& font() const
176  {
177  return _font;
178  }
179 
180  void setFont(const Gfx::Font& c)
181  {
182  _font = c;
183  ++_generation;
184  }
185 
186  std::size_t generation() const
187  {
188  return _generation;
189  }
190 
191  private:
192  Gfx::Brush _background;
193  Gfx::Brush _foreground;
194  Gfx::Pen _contour;
195  Gfx::Color _accentColor;
196  Gfx::Brush _viewBackground;
197  Gfx::Color _highlightColor;
198  Gfx::Brush _textBackground;
199  Gfx::Color _textColor;
200  Gfx::Color _highlightedTextColor;
201  Gfx::Font _font;
202  std::size_t _generation;
203 };
204 
205 } // namespace
206 
207 } // namespace
208 
209 #endif