LibreOffice Module vcl (master)  1
WidgetThemeLibraryTypes.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  */
10 
11 #ifndef INCLUDED_VCL_INC_WIDGETTHEMETYPES_HXX
12 #define INCLUDED_VCL_INC_WIDGETTHEMETYPES_HXX
13 
14 #include <o3tl/typed_flags_set.hxx>
15 
21 /* Control Types:
22  *
23  * Specify the overall, whole control
24  * type (as opposed to parts of the
25  * control if it were composite).
26  */
27 
28 enum class ControlType {
29 // for use in general purpose ImplControlValue
30  Generic = 0,
31 // Normal PushButton/Command Button
32  Pushbutton = 1,
33 // Normal single radio button
34  Radiobutton = 2,
35 // Normal single checkbox
36  Checkbox = 10,
37 // Combobox, i.e. a ListBox
38 // that allows data entry by user
39  Combobox = 20,
40 // Control that allows text entry
41  Editbox = 30,
42 // Control that allows text entry, but without the usual border
43 // Has to be handled separately, because this one cannot handle
44 // ControlPart::HasBackgroundTexture, which is drawn in the edit box'es
45 // border window.
46  EditboxNoBorder = 31,
47 // Control that allows text entry
48 // ( some systems distinguish between single and multi line edit boxes )
49  MultilineEditbox = 32,
50 // Control that pops up a menu,
51 // but does NOT allow data entry
52  Listbox = 35,
53 // An edit field together with two little
54 // buttons on the side (aka spin field)
55  Spinbox = 40,
56 // Two standalone spin buttons
57 // without an edit field
58  SpinButtons = 45,
59 // A single tab
60  TabItem = 50,
61 // The border around a tab area,
62 // but without the tabs themselves.
63 // May have a gap at the top for
64 // the active tab
65  TabPane = 55,
66 // The background to the tab area
67  TabHeader = 56,
68 // Background of a Tab Pane
69  TabBody = 57,
70 // Normal scrollbar, including
71 // all parts like slider, buttons
72  Scrollbar = 60,
73  Slider = 65,
74 // A separator line
75  Fixedline = 80,
76 // A toolbar control with buttons and a grip
77  Toolbar = 100,
78 // The menubar
79  Menubar = 120,
80 // popup menu
81  MenuPopup = 121,
82  Progress = 131,
83 // Progress bar for the intro window
84 // (aka splash screen), in case some
85 // wants native progress bar in the
86 // application but not for the splash
87 // screen (used in desktop/)
88  IntroProgress = 132,
89 // tool tips
90  Tooltip = 140,
91 // to draw the implemented theme
92  WindowBackground = 150,
93 //to draw border of frames natively
94  Frame = 160,
95 // for nodes in listviews
96 // used in svtools/source/contnr/svtreebx.cxx
97  ListNode = 170,
98 // nets between elements of listviews
99 // with nodes
100  ListNet = 171,
101 // for list headers
102  ListHeader = 172,
103 };
104 
105 
106 /* Control Parts:
107  *
108  * Uniquely identify a part of a control,
109  * for example the slider of a scroll bar.
110  */
111 
112 enum class ControlPart
113 {
114  NONE = 0,
115  Entire = 1,
116  ListboxWindow = 5, // the static listbox window containing the list
117  Button = 100,
118  ButtonUp = 101,
119  ButtonDown = 102, // Also for ComboBoxes/ListBoxes
120  ButtonLeft = 103,
121  ButtonRight = 104,
122  AllButtons = 105,
123  SeparatorHorz = 106,
124  SeparatorVert = 107,
125  TrackHorzLeft = 200,
126  TrackVertUpper = 201,
127  TrackHorzRight = 202,
128  TrackVertLower = 203,
129  TrackHorzArea = 204,
130  TrackVertArea = 205,
131  Arrow = 220,
132  ThumbHorz = 210, // Also used as toolbar grip
133  ThumbVert = 211, // Also used as toolbar grip
134  MenuItem = 250,
135  MenuItemCheckMark = 251,
136  MenuItemRadioMark = 252,
137  Separator = 253,
138  SubmenuArrow = 254,
139 
140 /* #i77549#
141  HACK: for scrollbars in case of thumb rect, page up and page down rect we
142  abuse the HitTestNativeScrollbar interface. All theming engines but aqua
143  are actually able to draw the thumb according to our internal representation.
144  However aqua draws a little outside. The canonical way would be to enhance the
145  HitTestNativeScrollbar passing a ScrollbarValue additionally so all necessary
146  information is available in the call.
147  .
148  However since there is only this one small exception we will deviate a little and
149  instead pass the respective rect as control region to allow for a small correction.
150 
151  So all places using HitTestNativeScrollbar on ControlPart::ThumbHorz, ControlPart::ThumbVert,
152  ControlPart::TrackHorzLeft, ControlPart::TrackHorzRight, ControlPart::TrackVertUpper, ControlPart::TrackVertLower
153  do not use the control rectangle as region but the actual part rectangle, making
154  only small deviations feasible.
155 */
156 
163  SubEdit = 300,
164 
165 // For controls that require the entire background
166 // to be drawn first, and then other pieces over top.
167 // (GTK+ scrollbars for example). Control region passed
168 // in to draw this part is expected to be the entire
169 // area of the control.
170 // A control may respond to one or both.
171  DrawBackgroundHorz = 1000,
172  DrawBackgroundVert = 1001,
173 
174 // GTK+ also draws tabs right->left since there is a
175 // hardcoded 2 pixel overlap between adjacent tabs
176  TabsDrawRtl = 3000,
177 
178 // For themes that do not want to have the focus
179 // rectangle part drawn by VCL but take care of the
180 // whole inner control part by themselves
181 // eg, listboxes or comboboxes or spinbuttons
182  HasBackgroundTexture = 4000,
183 
184 // For scrollbars that have 3 buttons (most KDE themes)
185  HasThreeButtons = 5000,
186 
187  BackgroundWindow = 6000,
188  BackgroundDialog = 6001,
189 
190 //to draw natively the border of frames
191  Border = 7000,
192 
193 //to draw natively the focus rects
194  Focus = 8000
195 };
196 
197 /* Control State:
198  *
199  * Specify how a particular part of the control
200  * is to be drawn. Constants are bitwise OR-ed
201  * together to compose a final drawing state.
202  * A _disabled_ state is assumed by the drawing
203  * functions until an ENABLED or HIDDEN is passed
204  * in the ControlState.
205  */
206 enum class ControlState {
207  NONE = 0,
208  ENABLED = 0x0001,
209  FOCUSED = 0x0002,
210  PRESSED = 0x0004,
211  ROLLOVER = 0x0008,
212  DEFAULT = 0x0020,
213  SELECTED = 0x0040,
214  DOUBLEBUFFERING = 0x4000,
215  CACHING_ALLOWED = 0x8000,
216 };
217 
218 template<> struct o3tl::typed_flags<ControlState>: o3tl::is_typed_flags<ControlState, 0xC06F> {};
219 
220 /* ButtonValue:
221  *
222  * Identifies the tri-state value options
223  * that buttons allow
224  */
225 
226 enum class ButtonValue {
227  DontKnow,
228  On,
229  Off,
230  Mixed
231 };
232 
233 #endif
234 
235 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Set when the control is painted using double-buffering via VirtualDevice.
Set when the control is completely visible (i.e. not clipped).
The edit field part of a control, e.g.
ControlType
These types are all based on the supported variants vcl/salnativewidgets.hxx and must be kept in-sync...