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
14 #include <o3tl/typed_flags_set.hxx>
17 * These types are all based on the supported variants
18 * vcl/salnativewidgets.hxx and must be kept in-sync.
23 * Specify the overall, whole control
24 * type (as opposed to parts of the
25 * control if it were composite).
28 enum class ControlType
{
29 // for use in general purpose ImplControlValue
31 // Normal PushButton/Command Button
33 // Normal single radio button
35 // Normal single checkbox
37 // Combobox, i.e. a ListBox
38 // that allows data entry by user
40 // Control that allows text entry
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
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
53 // An edit field together with two little
54 // buttons on the side (aka spin field)
56 // Two standalone spin buttons
57 // without an edit field
61 // The border around a tab area,
62 // but without the tabs themselves.
63 // May have a gap at the top for
66 // The background to the tab area
68 // Background of a Tab Pane
70 // Normal scrollbar, including
71 // all parts like slider, buttons
76 // A toolbar control with buttons and a grip
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/)
91 // to draw the implemented theme
92 WindowBackground
= 150,
93 //to draw border of frames natively
95 // for nodes in listviews
96 // used in svtools/source/contnr/svtreebx.cxx
98 // nets between elements of listviews
108 * Uniquely identify a part of a control,
109 * for example the slider of a scroll bar.
112 enum class ControlPart
116 ListboxWindow
= 5, // the static listbox window containing the list
119 ButtonDown
= 102, // Also for ComboBoxes/ListBoxes
126 TrackVertUpper
= 201,
127 TrackHorzRight
= 202,
128 TrackVertLower
= 203,
132 ThumbHorz
= 210, // Also used as toolbar grip
133 ThumbVert
= 211, // Also used as toolbar grip
135 MenuItemCheckMark
= 251,
136 MenuItemRadioMark
= 252,
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.
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.
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.
157 /** The edit field part of a control, e.g. of the combo box.
159 Currently used just for combo boxes and just for GetNativeControlRegion().
160 It is valid only if GetNativeControlRegion() supports ControlPart::ButtonDown as
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,
174 // GTK+ also draws tabs right->left since there is a
175 // hardcoded 2 pixel overlap between adjacent tabs
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,
184 // For scrollbars that have 3 buttons (most KDE themes)
185 HasThreeButtons
= 5000,
187 BackgroundWindow
= 6000,
188 BackgroundDialog
= 6001,
190 //to draw natively the border of frames
193 //to draw natively the focus rects
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.
206 enum class ControlState
{
214 DOUBLEBUFFERING
= 0x4000, ///< Set when the control is painted using double-buffering via VirtualDevice.
215 CACHING_ALLOWED
= 0x8000, ///< Set when the control is completely visible (i.e. not clipped).
218 template<> struct o3tl::typed_flags
<ControlState
>: o3tl::is_typed_flags
<ControlState
, 0xC06F> {};
222 * Identifies the tri-state value options
226 enum class ButtonValue
{
235 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */