31 #ifndef Pt_Forms_StyleOptions_h
32 #define Pt_Forms_StyleOptions_h
34 #include <Pt/Forms/Api.h>
35 #include <Pt/Gfx/Pen.h>
36 #include <Pt/Gfx/Brush.h>
37 #include <Pt/Gfx/Font.h>
38 #include <Pt/Gfx/Color.h>
39 #include <Pt/SmartPtr.h>
65 virtual const std::type_info& typeId()
const = 0;
67 virtual const char* name()
const = 0;
92 virtual const std::type_info& typeId()
const
95 virtual const char* name()
const override
96 {
return "background"; }
121 virtual const std::type_info& typeId()
const
124 virtual const char* name()
const override
125 {
return "foreground"; }
150 virtual const std::type_info& typeId()
const
153 virtual const char* name()
const override
154 {
return "contour"; }
175 virtual const std::type_info& typeId()
const
178 virtual const char* name()
const override
179 {
return "accentColor"; }
204 virtual const std::type_info& typeId()
const
207 virtual const char* name()
const override
208 {
return "viewBackground"; }
229 virtual const std::type_info& typeId()
const
232 virtual const char* name()
const override
233 {
return "highlightColor"; }
258 virtual const std::type_info& typeId()
const
261 virtual const char* name()
const override
262 {
return "hoverBackground"; }
287 virtual const std::type_info& typeId()
const
290 virtual const char* name()
const override
291 {
return "textBackground"; }
312 virtual const std::type_info& typeId()
const
315 virtual const char* name()
const override
316 {
return "textColor"; }
337 virtual const std::type_info& typeId()
const
340 virtual const char* name()
const override
341 {
return "placeholderTextColor"; }
362 virtual const std::type_info& typeId()
const
365 virtual const char* name()
const override
366 {
return "highlightedTextColor"; }
391 virtual const std::type_info& typeId()
const
394 virtual const char* name()
const override
395 {
return "alternateViewBackground"; }
420 virtual const std::type_info& typeId()
const
423 virtual const char* name()
const override
424 {
return "popupBackground"; }
445 virtual const std::type_info& typeId()
const
448 virtual const char* name()
const override
449 {
return "popupTextColor"; }
470 virtual const std::type_info& typeId()
const;
472 virtual const char* name()
const override
537 static const std::size_t InvalidGeneration = 0;
587 template <
typename T>
588 const T* findLocal()
const;
592 template <
typename T>
593 const T* find()
const;
597 template <
typename T>
598 const T& get()
const;
602 template <
typename T>
603 void set(
const T& option);
607 template <
typename T>
611 bool hasLocalOptions()
const;
613 StyleOption* findOption(
const std::type_info& ti)
const;
617 void removeOption(
const std::type_info& ti);
622 std::size_t _generation;
623 std::size_t _boundGeneration;
625 std::vector<StyleOption*> _options;
629 template <
typename T>
632 return static_cast<const T*
>( findOption(
typeid(T)) );
636 template <
typename T>
639 const T* option = findLocal<T>();
644 return _parent->
find<T>();
650 template <
typename T>
653 const T* option = find<T>();
657 throw std::logic_error(
"invalid style option");
661 template <
typename T>
665 localOption->bind(_parent);
666 replaceOption(localOption);
670 template <
typename T>
673 removeOption(
typeid(T));
Core module.
Definition: Allocator.h:33
Placeholder text color option.
Definition: StyleOptions.h:325
Attributes for the drawing of outlines.
Definition: Pen.h:54
Slant
Describes the requested font slant.
Definition: Font.h:76
Highlighted text color option.
Definition: StyleOptions.h:350
Policy based Auto pointer.
Definition: SmartPtr.h:291
Weight
Describes the requested font weight.
Definition: Font.h:61
Text color option.
Definition: StyleOptions.h:300
Font request used for text drawing and measurement.
Definition: Font.h:56
Standard color type.
Definition: Color.h:47
Fill description for shapes and text.
Definition: Brush.h:145
Text background brush option.
Definition: StyleOptions.h:271