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 #ifndef INCLUDED_TOOLS_WINTYPES_HXX
20 #define INCLUDED_TOOLS_WINTYPES_HXX
21 
22 #include <sal/types.h>
23 
24 // Window-Types
25 
26 enum class WindowType : sal_uInt16
27 {
28     NONE                 = 0,
29     FIRST                = 0x0130, // 304
30     MESSBOX              = FIRST, // 0
31     INFOBOX              ,
32     WARNINGBOX           ,
33     ERRORBOX             ,
34     QUERYBOX             ,
35     WINDOW               ,
36     WORKWINDOW           ,
37     CONTAINER            ,
38     FLOATINGWINDOW       ,
39     DIALOG               ,
40     MODELESSDIALOG       , // 10 (314)
41     MODALDIALOG          ,
42     CONTROL              ,
43     PUSHBUTTON           ,
44     OKBUTTON             ,
45     CANCELBUTTON         ,
46     HELPBUTTON           ,
47     IMAGEBUTTON          ,
48     MENUBUTTON           ,
49     MOREBUTTON           ,
50     SPINBUTTON           , // 20 (324)
51     RADIOBUTTON          ,
52     CHECKBOX             ,
53     TRISTATEBOX          ,
54     EDIT                 ,
55     MULTILINEEDIT        ,
56     COMBOBOX             ,
57     LISTBOX              ,
58     MULTILISTBOX         ,
59     FIXEDTEXT            ,
60     FIXEDLINE            , // 30 (334)
61     FIXEDBITMAP          ,
62     FIXEDIMAGE           ,
63     GROUPBOX             ,
64     SCROLLBAR            ,
65     SCROLLBARBOX         ,
66     SPLITTER             ,
67     SPLITWINDOW          ,
68     SPINFIELD            ,
69     PATTERNFIELD         ,
70     NUMERICFIELD         , // 40 (344)
71     METRICFIELD          ,
72     CURRENCYFIELD        ,
73     DATEFIELD            ,
74     TIMEFIELD            ,
75     PATTERNBOX           ,
76     NUMERICBOX           ,
77     METRICBOX            ,
78     CURRENCYBOX          ,
79     DATEBOX              ,
80     TIMEBOX              , // 50 (354)
81     LONGCURRENCYFIELD    ,
82     LONGCURRENCYBOX      ,
83     SCROLLWINDOW         ,
84     TOOLBOX              ,
85     DOCKINGWINDOW        ,
86     STATUSBAR            ,
87     TABPAGE              ,
88     TABCONTROL           ,
89     TABDIALOG            ,
90     BORDERWINDOW         , // 60 (364)
91     BUTTONDIALOG         ,
92     SYSTEMCHILDWINDOW    ,
93     SLIDER               ,
94     MENUBARWINDOW        ,
95     TREELISTBOX          ,
96     HELPTEXTWINDOW       ,
97     INTROWINDOW          ,
98     LISTBOXWINDOW        ,
99     DOCKINGAREA          ,
100     RULER                , // 70 (374)
101     CALCINPUTLINE        ,
102     HEADERBAR            ,
103     VERTICALTABCONTROL   ,
104     LAST                 = VERTICALTABCONTROL,
105     // only used in vclxtoolkit.cxx
106     TOOLKIT_FRAMEWINDOW        = 0x1000,
107     TOOLKIT_SYSTEMCHILDWINDOW  = 0x1001,
108 };
109 
110 // Window-Bits
111 
112 typedef sal_Int64 WinBits;
113 
114 // Window-Bits for Window
115 WinBits const WB_CLIPCHILDREN =         0x00000001;
116 WinBits const WB_DIALOGCONTROL =        0x00000002;
117 WinBits const WB_NODIALOGCONTROL =      0x00000004;
118 WinBits const WB_BORDER =               0x00000008;
119 WinBits const WB_NOBORDER =             0x00000010;
120 WinBits const WB_SIZEABLE =             0x00000020;
121 WinBits const WB_3DLOOK =               0x00000040;
122 WinBits const WB_ALLOWMENUBAR =         0x00000080;
123 
124 // Window-Bits for SystemWindows
125 WinBits const WB_MOVEABLE =             0x00000100;
126 WinBits const WB_ROLLABLE =             0x00000200;
127 WinBits const WB_CLOSEABLE =            0x00000400;
128 WinBits const WB_STANDALONE =           0x00000800;
129 WinBits const WB_APP =                  0x00001000;
130 WinBits const WB_SYSTEMWINDOW =         SAL_CONST_INT64(0x40000000);
131 // warning: do not confuse WB_SYSTEMCHILDWINDOW with the SystemChildWindow class
132 //
133 // the SystemChildWindow class was there first and is a very specialized
134 // system child window type for plugged applications. The SystemChildWindow class
135 // explicitly should never use the WB_SYSTEMCHILDWINDOW WinBit
136 //
137 // WB_SYSTEMCHILDWINDOW on the other hand is to be used on system windows
138 // which should be created as system child windows with (more or less)
139 // normal event handling
140 WinBits const WB_SYSTEMCHILDWINDOW =    SAL_CONST_INT64(0x8000000000);
141 WinBits const WB_SIZEMOVE =             (WB_SIZEABLE | WB_MOVEABLE);
142 
143 // Standard-Window-Bits for ChildWindows
144 WinBits const WB_TABSTOP =              0x00000100;
145 WinBits const WB_NOTABSTOP =            0x00000200;
146 WinBits const WB_GROUP =                0x00000400;
147 WinBits const WB_NOGROUP =              0x00000800;
148 WinBits const WB_HORZ =                 0x00001000;
149 WinBits const WB_VERT =                 0x00002000;
150 WinBits const WB_LEFT =                 0x00004000;
151 WinBits const WB_CENTER =               0x00008000;
152 WinBits const WB_RIGHT =                0x00010000;
153 WinBits const WB_TOP =                  0x00020000;
154 WinBits const WB_VCENTER =              0x00040000;
155 WinBits const WB_BOTTOM =               0x00080000;
156 WinBits const WB_DRAG =                 0x00100000;
157 WinBits const WB_SPIN =                 0x00200000;
158 WinBits const WB_REPEAT =               0x00400000;
159 WinBits const WB_NOPOINTERFOCUS =       0x00800000;
160 WinBits const WB_WORDBREAK =            0x01000000;
161 WinBits const WB_NOLABEL =              0x02000000;
162 WinBits const WB_SORT =                 0x04000000;
163 WinBits const WB_DROPDOWN =             0x08000000;
164 WinBits const WB_HIDE =                 SAL_CONST_INT64(0x80000000);
165 WinBits const WB_AUTOHSCROLL =          SAL_CONST_INT64(0x10000000);
166 WinBits const WB_DOCKABLE =             SAL_CONST_INT64(0x20000000);
167 WinBits const WB_AUTOVSCROLL =          SAL_CONST_INT64(0x40000000);
168 WinBits const WB_HYPHENATION =          SAL_CONST_INT64(0x800000000) | WB_WORDBREAK;
169 // #i93011# style bit for some child windows, that want their children checked for accelerators
170 WinBits const WB_CHILDDLGCTRL =         SAL_CONST_INT64(0x100000000000);
171 
172 // system floating window
173 WinBits const WB_SYSTEMFLOATWIN =       SAL_CONST_INT64(0x100000000);
174 WinBits const WB_INTROWIN =             SAL_CONST_INT64(0x200000000);
175 WinBits const WB_NOSHADOW =             SAL_CONST_INT64(0x400000000);
176 WinBits const WB_TOOLTIPWIN =           SAL_CONST_INT64(0x800000000);
177 WinBits const WB_OWNERDRAWDECORATION =  SAL_CONST_INT64(0x2000000000);
178 WinBits const WB_DEFAULTWIN =           SAL_CONST_INT64(0x4000000000);
179 WinBits const WB_POPUP =                SAL_CONST_INT64(0x20000000);
180 
181 WinBits const WB_HSCROLL =              WB_HORZ;
182 WinBits const WB_VSCROLL =              WB_VERT;
183 
184 // Window-Bits for PushButtons
185 WinBits const WB_DEFBUTTON =            0x10000000;
186 WinBits const WB_NOLIGHTBORDER =        0x20000000;
187 WinBits const WB_RECTSTYLE =            0x08000000;
188 WinBits const WB_SMALLSTYLE =           0x04000000;
189 WinBits const WB_TOGGLE =               SAL_CONST_INT64(0x1000000000);
190 WinBits const WB_BEVELBUTTON =          SAL_CONST_INT64(0x2000000000);
191 WinBits const WB_FLATBUTTON =           SAL_CONST_INT64(0x4000000000);
192 
193 // Window-Bits for FixedText
194 WinBits const WB_PATHELLIPSIS =         0x00100000;
195 WinBits const WB_EXTRAOFFSET =          0x02000000;
196 WinBits const WB_NOMULTILINE =          0x10000000;
197 
198 // Window-Bits for Edit
199 WinBits const WB_READONLY =             0x02000000;
200 WinBits const WB_NOHIDESELECTION =      SAL_CONST_INT64(0x1000000000);
201 
202 // Window-Bits for MultiLineEdit
203 WinBits const WB_IGNORETAB =            0x20000000;
204 
205 // Window-Bits for ListBox and MultiListBox
206 WinBits const WB_SIMPLEMODE =           0x20000000;
207 // Special case where the listbox is used as a dropdown popup (not a combobox)
208 WinBits const WB_LISTBOX_POPUP =        0x40000000;
209 
210 // Window-Bits for FixedBitmap
211 WinBits const WB_SCALE =                0x08000000;
212 
213 // Window-Bits for ToolBox
214 WinBits const WB_SCROLL =               0x02000000;
215 
216 // Window-Bits for SplitWindow
217 WinBits const WB_NOSPLITDRAW =          0x01000000;
218 
219 // Standard-WinBits
220 WinBits const WB_STDWORK =              WB_SIZEMOVE | WB_CLOSEABLE;
221 WinBits const WB_STDDOCKWIN =           WB_DOCKABLE | WB_MOVEABLE | WB_CLOSEABLE;
222 WinBits const WB_STDFLOATWIN =          WB_SIZEMOVE | WB_CLOSEABLE | WB_ROLLABLE;
223 WinBits const WB_STDDIALOG =            WB_MOVEABLE | WB_CLOSEABLE;
224 WinBits const WB_STDMODELESS =          WB_STDDIALOG;
225 WinBits const WB_STDMODAL =             WB_STDDIALOG;
226 WinBits const WB_STDTABCONTROL =        0;
227 WinBits const WB_STDPOPUP =             WB_BORDER | WB_POPUP | WB_SYSTEMWINDOW | WB_3DLOOK | WB_DIALOGCONTROL;
228 
229 // For TreeListBox
230 WinBits const WB_HASBUTTONS =           SAL_CONST_INT64(0x000100000000);
231 WinBits const WB_HASLINES =             SAL_CONST_INT64(0x000200000000);
232 WinBits const WB_HASLINESATROOT =       SAL_CONST_INT64(0x000400000000);
233 WinBits const WB_HASBUTTONSATROOT =     SAL_CONST_INT64(0x000800000000);
234 WinBits const WB_NOINITIALSELECTION =   SAL_CONST_INT64(0x001000000000);
235 WinBits const WB_HIDESELECTION =        SAL_CONST_INT64(0x002000000000);
236 // DO NOT USE: 0x008000000000, that's WB_SYSTEMCHILDWINDOW
237 
238 
239 enum class WindowAlign { Left, Top, Right, Bottom };
240 
241 enum class ImageAlign { Left, Top, Right, Bottom,
242                   LeftTop, LeftBottom, TopLeft,
243                   TopRight, RightTop, RightBottom,
244                   BottomLeft, BottomRight, Center };
245 
246 enum class SymbolAlign { LEFT, RIGHT };
247 
248 // ButtonDialog-Types
249 
250 enum class StandardButtonType
251 {
252     OK           = 0,
253     Cancel       = 1,
254     Yes          = 2,
255     No           = 3,
256     Retry        = 4,
257     Help         = 5,
258     Close        = 6,
259     More         = 7,
260     Ignore       = 8,
261     Abort        = 9,
262     Less         = 10,
263     Back         = 11,
264     Next         = 12,
265     Finish       = 13,
266     Count        = 14,
267 };
268 
269 // prominent place for ListBox window types
270 
271 enum class ProminentEntry { TOP, MIDDLE };
272 
273 #endif
274 
275 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
276