1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
11 #ifndef INCLUDED_VCL_INC_WIDGETTHEMETYPES_HXX
12 #define INCLUDED_VCL_INC_WIDGETTHEMETYPES_HXX
15 #include <type_traits> // Used for enum operator
18 * These types are all based on the supported variants
19 * vcl/salnativewidgets.hxx and must be kept in-sync.
24 * Specify the overall, whole control
25 * type (as opposed to parts of the
26 * control if it were composite).
29 enum class ControlType
{
30 // for use in general purpose ImplControlValue
32 // Normal PushButton/Command Button
34 // Normal single radio button
36 // Normal single checkbox
38 // Combobox, i.e. a ListBox
39 // that allows data entry by user
41 // Control that allows text entry
43 // Control that allows text entry, but without the usual border
44 // Has to be handled separately, because this one cannot handle
45 // ControlPart::HasBackgroundTexture, which is drawn in the edit box'es
48 // Control that allows text entry
49 // ( some systems distinguish between single and multi line edit boxes )
50 MultilineEditbox
= 32,
51 // Control that pops up a menu,
52 // but does NOT allow data entry
54 // An edit field together with two little
55 // buttons on the side (aka spin field)
57 // Two standalone spin buttons
58 // without an edit field
62 // The border around a tab area,
63 // but without the tabs themselves.
64 // May have a gap at the top for
67 // The background to the tab area
69 // Background of a Tab Pane
71 // Normal scrollbar, including
72 // all parts like slider, buttons
77 // A toolbar control with buttons and a grip
84 // Progress bar for the intro window
85 // (aka splash screen), in case some
86 // wants native progress bar in the
87 // application but not for the splash
88 // screen (used in desktop/)
92 // to draw the implemented theme
93 WindowBackground
= 150,
94 //to draw border of frames natively
96 // for nodes in listviews
97 // used in svtools/source/contnr/svtreebx.cxx
99 // nets between elements of listviews
109 * Uniquely identify a part of a control,
110 * for example the slider of a scroll bar.
113 enum class ControlPart
117 ListboxWindow
= 5, // the static listbox window containing the list
120 ButtonDown
= 102, // Also for ComboBoxes/ListBoxes
127 TrackVertUpper
= 201,
128 TrackHorzRight
= 202,
129 TrackVertLower
= 203,
133 ThumbHorz
= 210, // Also used as toolbar grip
134 ThumbVert
= 211, // Also used as toolbar grip
136 MenuItemCheckMark
= 251,
137 MenuItemRadioMark
= 252,
142 HACK: for scrollbars in case of thumb rect, page up and page down rect we
143 abuse the HitTestNativeScrollbar interface. All theming engines but aqua
144 are actually able to draw the thumb according to our internal representation.
145 However aqua draws a little outside. The canonical way would be to enhance the
146 HitTestNativeScrollbar passing a ScrollbarValue additionally so all necessary
147 information is available in the call.
149 However since there is only this one small exception we will deviate a little and
150 instead pass the respective rect as control region to allow for a small correction.
152 So all places using HitTestNativeScrollbar on ControlPart::ThumbHorz, ControlPart::ThumbVert,
153 ControlPart::TrackHorzLeft, ControlPart::TrackHorzRight, ControlPart::TrackVertUpper, ControlPart::TrackVertLower
154 do not use the control rectangle as region but the actuall part rectangle, making
155 only small deviations feasible.
158 /** The edit field part of a control, e.g. of the combo box.
160 Currently used just for combo boxes and just for GetNativeControlRegion().
161 It is valid only if GetNativeControlRegion() supports ControlPart::ButtonDown as
166 // For controls that require the entire background
167 // to be drawn first, and then other pieces over top.
168 // (GTK+ scrollbars for example). Control region passed
169 // in to draw this part is expected to be the entire
170 // area of the control.
171 // A control may respond to one or both.
172 DrawBackgroundHorz
= 1000,
173 DrawBackgroundVert
= 1001,
175 // GTK+ also draws tabs right->left since there is a
176 // hardcoded 2 pixel overlap between adjacent tabs
179 // For themes that do not want to have the focus
180 // rectangle part drawn by VCL but take care of the
181 // whole inner control part by themselves
182 // eg, listboxes or comboboxes or spinbuttons
183 HasBackgroundTexture
= 4000,
185 // For scrollbars that have 3 buttons (most KDE themes)
186 HasThreeButtons
= 5000,
188 BackgroundWindow
= 6000,
189 BackgroundDialog
= 6001,
191 //to draw natively the border of frames
194 //to draw natively the focus rects
200 * Specify how a particular part of the control
201 * is to be drawn. Constants are bitwise OR-ed
202 * together to compose a final drawing state.
203 * A _disabled_ state is assumed by the drawing
204 * functions until an ENABLED or HIDDEN is passed
205 * in the ControlState.
207 enum class ControlState
{
215 DOUBLEBUFFERING
= 0x4000, ///< Set when the control is painted using double-buffering via VirtualDevice.
216 CACHING_ALLOWED
= 0x8000, ///< Set when the control is completely visible (i.e. not clipped).
219 inline bool operator& (const ControlState
& lhs
, const ControlState
& rhs
)
221 return static_cast<std::underlying_type
<ControlState
>::type
>(lhs
)
222 & static_cast<std::underlying_type
<ControlState
>::type
>(rhs
);
227 * Identifies the tri-state value options
231 enum class ButtonValue
{
240 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */