LibreOffice Module vcl (master)  1
vclenum.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  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_VCL_VCLENUM_HXX
21 #define INCLUDED_VCL_VCLENUM_HXX
22 
23 #include <sal/types.h>
24 #include <o3tl/typed_flags_set.hxx>
25 
27 
28 enum class TimeFieldFormat : sal_Int32 { F_NONE, F_SEC, F_SEC_CS };
29 
31 
32 enum class MenuItemBits : sal_Int16
33 {
34  NONE = 0x0000,
35  CHECKABLE = 0x0001,
36  RADIOCHECK = 0x0002,
37  AUTOCHECK = 0x0004,
38  HELP = 0x0010,
39  POPUPSELECT = 0x0020,
40  // These have been said to be a preliminary (sic) solution since 2007
41  NOSELECT = 0x0040,
42  ICON = 0x0080,
43  TEXT = 0x0100,
44 };
45 namespace o3tl
46 {
47  template<> struct typed_flags<MenuItemBits> : is_typed_flags<MenuItemBits, 0x1f7> {};
48 }
49 
50 enum class ToolBoxItemBits
51 {
52  NONE = 0x0000,
53  CHECKABLE = 0x0001,
54  RADIOCHECK = 0x0002,
55  AUTOCHECK = 0x0004,
56  LEFT = 0x0008,
57  AUTOSIZE = 0x0010,
58  DROPDOWN = 0x0020,
59  REPEAT = 0x0040,
60  DROPDOWNONLY = 0x00a0, // 0x0080 | DROPDOWN
61  TEXT_ONLY = 0x0100,
62  ICON_ONLY = 0x0200
63 };
64 namespace o3tl
65 {
66  template<> struct typed_flags<ToolBoxItemBits> : is_typed_flags<ToolBoxItemBits, 0x3ff> {};
67 }
68 
70 
72 
73 enum class SymbolType : sal_uInt16
74 {
75  DONTKNOW = 0,
76  IMAGE = 1,
77  ARROW_UP = 2,
78  ARROW_DOWN = 3,
79  ARROW_LEFT = 4,
80  ARROW_RIGHT = 5,
81  SPIN_UP = 6,
82  SPIN_DOWN = 7,
83  SPIN_LEFT = 8,
84  SPIN_RIGHT = 9,
85  FIRST = 10,
86  LAST = 11,
87  PREV = 12,
88  NEXT = 13,
89  PAGEUP = 14,
90  PAGEDOWN = 15,
91  PLAY = 16,
92  STOP = 19,
93  CLOSE = 25,
94  CHECKMARK = 28,
95  RADIOCHECKMARK = 29,
96  FLOAT = 31,
97  DOCK = 32,
98  HIDE = 33,
99  HELP = 34,
100  PLUS = 35,
102 };
103 
104 
105 // Border styles for SetBorder()
106 enum class WindowBorderStyle : sal_Int16
107 {
108  NONE = 0x0000,
109  NORMAL = 0x0001,
110  MONO = 0x0002,
111  MENU = 0x0010,
112  NWF = 0x0020,
113  NOBORDER = 0x1000,
114  REMOVEBORDER = 0x2000
115 };
116 namespace o3tl
117 {
118  template<> struct typed_flags<WindowBorderStyle> : is_typed_flags<WindowBorderStyle, 0x3033> {};
119 }
120 
121 enum class WindowStateMask {
122  NONE = 0x0000,
123  X = 0x0001,
124  Y = 0x0002,
125  Width = 0x0004,
126  Height = 0x0008,
127  State = 0x0010,
128  Minimized = 0x0020,
129  MaximizedX = 0x0100,
130  MaximizedY = 0x0200,
131  MaximizedWidth = 0x0400,
132  MaximizedHeight = 0x0800,
133  Pos = X | Y,
135 };
136 namespace o3tl
137 {
138  template<> struct typed_flags<WindowStateMask> : is_typed_flags<WindowStateMask, 0x0f3f> {};
139 }
140 
141 enum class TimeFormat
142 {
143  Hour12, Hour24
144 };
145 
147 {
149  Short24H, Long24H,
150  Short12H, Long12H,
152 };
153 
155 {
157  SystemLong,
162 };
163 
164 // this appears to be a direct copy of css::awt::GradientStyle
165 enum class GradientStyle
166 {
167  Linear = 0,
168  Axial = 1,
169  Radial = 2,
170  Elliptical = 3,
171  Square = 4,
172  Rect = 5,
174 };
175 
176 enum class HatchStyle
177 {
178  Single = 0,
179  Double = 1,
180  Triple = 2,
182 };
183 
184 enum class LineStyle
185 {
186  NONE = 0,
187  Solid = 1,
188  Dash = 2,
190 };
191 
192 typedef sal_uInt32 sal_UCS4; // TODO: this should be moved to rtl
193 
195 
197 {
198  double xx, xy, yx, yy;
199  ItalicMatrix() : xx(1), xy(0), yx(0), yy(1) {}
200 };
201 
202 inline bool operator ==(const ItalicMatrix& a, const ItalicMatrix& b)
203 {
204  return a.xx == b.xx && a.xy == b.xy && a.yx == b.yx && a.yy == b.yy;
205 }
206 
207 inline bool operator !=(const ItalicMatrix& a, const ItalicMatrix& b)
208 {
209  return !(a == b);
210 }
211 
212 enum class VclAlign
213 {
214  Fill,
215  Start,
216  End,
217  Center
218 };
219 
220 enum class VclPackType
221 {
222  Start = 0,
223  End = 1,
224  LAST = End
225 };
226 
227 // Return Values from Dialog::Execute
229 
231 {
233  RET_OK = 1,
234  RET_YES = 2,
235  RET_NO = 3,
239  RET_HELP = 10
240 };
241 
242 enum class VclButtonsType
243 {
244  NONE,
245  Ok,
246  Close,
247  Cancel,
248  YesNo,
249  OkCancel
250 };
251 
252 enum class VclMessageType
253 {
254  Info,
255  Warning,
256  Question,
257  Error,
258  Other
259 };
260 
262 {
263  NONE,
264  Horizontal,
265  Vertical,
266  Both
267 };
268 
269 enum class VclPolicyType
270 {
271  ALWAYS,
272  AUTOMATIC,
273  NEVER
274 };
275 
276 enum class WizardButtonFlags : sal_Int16
277 {
278  NONE = 0x0000,
279  NEXT = 0x0001,
280  PREVIOUS = 0x0002,
281  FINISH = 0x0004,
282  CANCEL = 0x0008,
283  HELP = 0x0010,
284 };
285 
286 namespace o3tl
287 {
288  template<> struct typed_flags<WizardButtonFlags> : is_typed_flags<WizardButtonFlags, 0x001f> {};
289 }
290 
291 // small, large, size32 force an exact toolbox size for proper alignment
292 // DontCare will let the toolbox decide about its size
294 {
295  DontCare,
296  Small,
297  Large,
298  Size32,
299 };
300 
301 enum class WindowStateState {
302  NONE = 0x0000,
303  Normal = 0x0001,
304  Minimized = 0x0002,
305  Maximized = 0x0004,
306  // Rollup is no longer used, but retained because WindowStateState is serialized
307  // from/to strings describing window state that are stored in a users config
308  Rollup = 0x0008,
309  MaximizedHorz = 0x0010,
310  MaximizedVert = 0x0020,
311  FullScreen = 0x0040,
312  SystemMask = 0xffff
313 };
314 namespace o3tl
315 {
316  template<> struct typed_flags<WindowStateState> : is_typed_flags<WindowStateState, 0xffff> {};
317 }
318 
319 namespace vcl
320 {
321  // The exact sizes of the icons in each size grouping are not necessarily
322  // the exact size indicated by the name, but the upper limit of their size.
323  // e.g. many Size26 icons are often 24x24px and only some 26x26px
324  enum class ImageType
325  {
326  Size16,
327  Size26,
328  Size32,
329  Small = Size16,
330  LAST = Size32,
331  };
332 }
333 
334 enum class DrawFrameStyle
335 {
336  NONE = 0x0000,
337  In = 0x0001,
338  Out = 0x0002,
339  Group = 0x0003,
340  DoubleIn = 0x0004,
341  DoubleOut = 0x0005,
342  NWF = 0x0006,
343 };
344 
345 // Flags for DrawFrame()
346 enum class DrawFrameFlags
347 {
348  NONE = 0x0000,
349  Menu = 0x0010,
350  WindowBorder = 0x0020,
351  BorderWindowBorder = 0x0040,
352  Mono = 0x1000,
353  NoDraw = 0x8000,
354 };
355 namespace o3tl
356 {
357  template<> struct typed_flags<DrawFrameFlags> : is_typed_flags<DrawFrameFlags, 0x9070> {};
358 }
359 
360 enum class TxtAlign
361 {
362  Left,
363  Center,
364  Right
365 };
366 
368 {
369  NONE = 0x000000,
370  AllowTearOff = 0x000001,
371  Down = 0x000002,
372  Up = 0x000004,
373  Left = 0x000008,
374  Right = 0x000010,
375  NoKeyClose = 0x000020,
376  AllMouseButtonClose = 0x000040,
377  NoAppFocusClose = 0x000080,
378  NewLevel = 0x000100,
379  NoMouseUpClose = 0x000200,
380  GrabFocus = 0x000400,
381  NoHorzPlacement = 0x000800,
382 };
383 namespace o3tl
384 {
385  template<> struct typed_flags<FloatWinPopupFlags> : is_typed_flags<FloatWinPopupFlags, 0x0fff> {};
386 }
387 
388 // Flags for Window::Show()
389 enum class ShowFlags
390 {
391  NONE = 0x0000,
392  NoFocusChange = 0x0002,
393  NoActivate = 0x0004,
394  ForegroundTask = 0x0008,
395 };
396 namespace o3tl
397 {
398  template<> struct typed_flags<ShowFlags> : is_typed_flags<ShowFlags, 0x000e> {};
399 }
400 
402 {
403  NONE = 0x0000,
404  Cancel = 0x0001,
405  Key = 0x0002,
406  Focus = 0x0004,
407  Repeat = 0x0100,
408  End = 0x1000,
409 };
410 namespace o3tl
411 {
412  template<> struct typed_flags<TrackingEventFlags> : is_typed_flags<TrackingEventFlags, 0x1107> {};
413 }
414 
415 #endif // INCLUDED_VCL_VCLENUM_HXX
416 
417 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
STRING
Group
bool operator!=(const ItalicMatrix &a, const ItalicMatrix &b)
Definition: vclenum.hxx:207
MenuItemType
Definition: vclenum.hxx:30
ExtTimeFieldFormat
Definition: vclenum.hxx:146
ToolBoxButtonSize
Definition: vclenum.hxx:293
TimeFieldFormat
Definition: vclenum.hxx:28
sal_uInt32 sal_UCS4
Definition: vclenum.hxx:192
VclButtonsType
Definition: vclenum.hxx:242
double xy
Definition: vclenum.hxx:198
the first 4 of these are only used by base/dbaccess
SelectionMode
Definition: vclenum.hxx:26
FloatWinPopupFlags
Definition: vclenum.hxx:367
ButtonType
Definition: vclenum.hxx:71
ToolBoxItemType
Definition: vclenum.hxx:69
OutDevSupportType
Definition: vclenum.hxx:194
MenuItemBits
Definition: vclenum.hxx:32
WizardButtonFlags
Definition: vclenum.hxx:276
TimeFormat
Definition: vclenum.hxx:141
SymbolType
Definition: vclenum.hxx:73
LineStyle
Definition: vclenum.hxx:184
VclSizeGroupMode
Definition: vclenum.hxx:261
WindowStateMask
Definition: vclenum.hxx:121
GradientStyle
VclMessageType
Definition: vclenum.hxx:252
VclPolicyType
Definition: vclenum.hxx:269
bool operator==(const ItalicMatrix &a, const ItalicMatrix &b)
Definition: vclenum.hxx:202
ToolBoxItemBits
Definition: vclenum.hxx:50
VclPackType
Definition: vclenum.hxx:220
ImageType
Definition: vclenum.hxx:324
TrackingEventFlags
Definition: vclenum.hxx:401
VclResponseType
!! in case of changes adjust /basic/source/runtime/methods.cxx msgbox
Definition: vclenum.hxx:230
double xx
Definition: vclenum.hxx:198
DrawFrameStyle
Definition: vclenum.hxx:334
ExtDateFieldFormat
Definition: vclenum.hxx:154
Definition: menu.hxx:123
State
#define SAL_MAX_ENUM
TxtAlign
Definition: vclenum.hxx:360
double yx
Definition: vclenum.hxx:198
ShowFlags
Definition: vclenum.hxx:389
VclAlign
Definition: vclenum.hxx:212
WindowStateState
Definition: vclenum.hxx:301
struct _ADOKey Key
WindowBorderStyle
Definition: vclenum.hxx:106
DrawFrameFlags
Definition: vclenum.hxx:346
HatchStyle
double yy
Definition: vclenum.hxx:198