1 #ifndef oxygen_h
2 #define oxygen_h
3 /*
4     SPDX-FileCopyrightText: 2014 Hugo Pereira Da Costa <hugo.pereira@free.fr>
5     SPDX-License-Identifier: GPL-2.0-or-later
6  */
7 
8 #include <QFlags>
9 #include <QPointer>
10 #include <QScopedPointer>
11 #include <QWeakPointer>
12 
13 namespace Oxygen
14 {
15 
16     //*@name convenience typedef
17     //@{
18 
19     //* scoped pointer convenience typedef
20     template <typename T> using WeakPointer = QPointer<T>;
21 
22     //* scoped pointer convenience typedef
23     template <typename T> using ScopedPointer = QScopedPointer<T, QScopedPointerPodDeleter>;
24 
25     //@}
26 
27     //* metrics
28     /*! these are copied from the old KStyle WidgetProperties */
29     enum Metrics
30     {
31         // frames
32         Frame_FrameWidth = 2,
33         Frame_FrameRadius = 3,
34 
35         // layout
36         Layout_TopLevelMarginWidth = 10,
37         Layout_ChildMarginWidth = 6,
38         Layout_DefaultSpacing = 6,
39 
40         // line editors
41         LineEdit_FrameWidth = 6,
42 
43         // menu items
44         MenuItem_MarginWidth = 3,
45         MenuItem_ItemSpacing = 4,
46         MenuItem_AcceleratorSpace = 16,
47         MenuButton_IndicatorWidth = 20,
48 
49         // combobox
50         ComboBox_FrameWidth = 6,
51 
52         // spinbox
53         SpinBox_FrameWidth = LineEdit_FrameWidth,
54         SpinBox_ArrowButtonWidth = 20,
55 
56         // groupbox title margin
57         GroupBox_TitleMarginWidth = 4,
58 
59         // buttons
60         Button_MinWidth = 80,
61         Button_MarginWidth = 6,
62         Button_ItemSpacing = 4,
63 
64         // tool buttons
65         ToolButton_MarginWidth = 6,
66         ToolButton_ItemSpacing = 4,
67         ToolButton_InlineIndicatorWidth = 12,
68 
69         // checkboxes and radio buttons
70         CheckBox_Size = 23,
71         CheckBox_FocusMarginWidth = 2,
72         CheckBox_ItemSpacing = 6,
73 
74         // menubar items
75         MenuBarItem_MarginWidth = 10,
76         MenuBarItem_MarginHeight = 6,
77 
78         // scrollbars
79         ScrollBar_MinSliderHeight = 21,
80 
81         // toolbars
82         ToolBar_FrameWidth = 2,
83         ToolBar_HandleExtent = 10,
84         ToolBar_HandleWidth = 6,
85         ToolBar_SeparatorWidth = 8,
86         ToolBar_ExtensionWidth = 20,
87         ToolBar_ItemSpacing = 0,
88 
89         // progressbars
90         ProgressBar_BusyIndicatorSize = 14,
91         ProgressBar_Thickness = 6,
92         ProgressBar_ItemSpacing = 4,
93 
94         // mdi title bar
95         TitleBar_MarginWidth = 4,
96 
97         // sliders
98         Slider_TickLength = 8,
99         Slider_TickMarginWidth = 2,
100         Slider_GrooveThickness = 7,
101         Slider_ControlThickness = 21,
102 
103         // tabbar
104         TabBar_TabMarginHeight = 6,
105         TabBar_TabMarginWidth = 12,
106         TabBar_TabMinWidth = 80,
107         TabBar_TabMinHeight = 28,
108         TabBar_TabItemSpacing = 8,
109         TabBar_TabOverlap = 1,
110         TabBar_TabOffset = 4,
111         TabBar_BaseOverlap = 7,
112 
113         // tab widget
114         TabWidget_MarginWidth = 4,
115 
116         // toolbox
117         ToolBox_TabMinWidth = 80,
118         ToolBox_TabItemSpacing = 4,
119 
120         // tooltips
121         ToolTip_FrameWidth = 3,
122 
123         // list headers
124         Header_MarginWidth = 6,
125         Header_ItemSpacing = 4,
126         Header_ArrowSize = 10,
127 
128         // tree view
129         ItemView_ArrowSize = 10,
130         ItemView_ItemMarginWidth = 3,
131 
132         // splitter
133         Splitter_SplitterWidth = 3,
134 
135     };
136 
137     //* animation mode
138     enum AnimationMode
139     {
140         AnimationNone = 0,
141         AnimationHover = 0x1,
142         AnimationFocus = 0x2,
143         AnimationEnable = 0x4,
144         AnimationPressed = 0x8
145     };
146 
147     Q_DECLARE_FLAGS(AnimationModes, AnimationMode)
148 
149     //* arrow orientation
150     enum ArrowOrientation
151     {
152         ArrowNone,
153         ArrowUp,
154         ArrowDown,
155         ArrowLeft,
156         ArrowRight
157     };
158 
159 
160     //* get polygon corresponding to generic arrow
161     enum ArrowSize
162     {
163         ArrowNormal,
164         ArrowSmall,
165         ArrowTiny
166     };
167 
168     //* internal option flags to pass arguments around
169     enum StyleOption
170     {
171         Sunken = 0x1,
172         Focus = 0x2,
173         Hover = 0x4,
174         Disabled = 0x8,
175         NoFill = 0x10,
176         HoleOutline = 0x20,
177         HoleContrast = 0x80
178     };
179 
180     Q_DECLARE_FLAGS(StyleOptions, StyleOption)
181 
182     //* shadow area
183     enum ShadowArea
184     {
185         ShadowAreaTop,
186         ShadowAreaBottom,
187         ShadowAreaLeft,
188         ShadowAreaRight
189     };
190 
191 }
192 
193 Q_DECLARE_OPERATORS_FOR_FLAGS( Oxygen::AnimationModes );
194 Q_DECLARE_OPERATORS_FOR_FLAGS( Oxygen::StyleOptions );
195 
196 #endif
197