bump product version to 4.1.6.2
[LibreOffice.git] / vcl / inc / salwtype.hxx
blob55bc006f90e5735db171252809b0e317f990c32d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _SV_SALWTYPE_HXX
21 #define _SV_SALWTYPE_HXX
23 #include <i18nlangtag/lang.h>
24 #include <tools/string.hxx>
25 #include <tools/solar.h>
27 class SalGraphics;
28 class SalFrame;
29 class SalObject;
30 class Window;
32 class FontSelectPattern;
34 // ------------
35 // - SalEvent -
36 // ------------
38 #define SALEVENT_MOUSEMOVE ((sal_uInt16)1)
39 #define SALEVENT_MOUSELEAVE ((sal_uInt16)2)
40 #define SALEVENT_MOUSEBUTTONDOWN ((sal_uInt16)3)
41 #define SALEVENT_MOUSEBUTTONUP ((sal_uInt16)4)
42 #define SALEVENT_KEYINPUT ((sal_uInt16)5)
43 #define SALEVENT_KEYUP ((sal_uInt16)6)
44 #define SALEVENT_KEYMODCHANGE ((sal_uInt16)7)
45 #define SALEVENT_PAINT ((sal_uInt16)8)
46 #define SALEVENT_RESIZE ((sal_uInt16)9)
47 #define SALEVENT_GETFOCUS ((sal_uInt16)10)
48 #define SALEVENT_LOSEFOCUS ((sal_uInt16)11)
49 #define SALEVENT_CLOSE ((sal_uInt16)12)
50 #define SALEVENT_SHUTDOWN ((sal_uInt16)13)
51 #define SALEVENT_SETTINGSCHANGED ((sal_uInt16)14)
52 #define SALEVENT_VOLUMECHANGED ((sal_uInt16)15)
53 #define SALEVENT_PRINTERCHANGED ((sal_uInt16)16)
54 #define SALEVENT_DISPLAYCHANGED ((sal_uInt16)17)
55 #define SALEVENT_FONTCHANGED ((sal_uInt16)18)
56 #define SALEVENT_DATETIMECHANGED ((sal_uInt16)19)
57 #define SALEVENT_KEYBOARDCHANGED ((sal_uInt16)20)
58 #define SALEVENT_WHEELMOUSE ((sal_uInt16)21)
59 #define SALEVENT_USEREVENT ((sal_uInt16)22)
60 #define SALEVENT_MOUSEACTIVATE ((sal_uInt16)23)
61 #define SALEVENT_EXTTEXTINPUT ((sal_uInt16)24)
62 #define SALEVENT_ENDEXTTEXTINPUT ((sal_uInt16)25)
63 #define SALEVENT_EXTTEXTINPUTPOS ((sal_uInt16)26)
64 #define SALEVENT_INPUTCONTEXTCHANGE ((sal_uInt16)27)
65 #define SALEVENT_MOVE ((sal_uInt16)28)
66 #define SALEVENT_MOVERESIZE ((sal_uInt16)29)
67 #define SALEVENT_CLOSEPOPUPS ((sal_uInt16)30)
68 #define SALEVENT_EXTERNALKEYINPUT ((sal_uInt16)31)
69 #define SALEVENT_EXTERNALKEYUP ((sal_uInt16)32)
70 #define SALEVENT_MENUCOMMAND ((sal_uInt16)33)
71 #define SALEVENT_MENUHIGHLIGHT ((sal_uInt16)34)
72 #define SALEVENT_MENUACTIVATE ((sal_uInt16)35)
73 #define SALEVENT_MENUDEACTIVATE ((sal_uInt16)36)
74 #define SALEVENT_EXTERNALMOUSEMOVE ((sal_uInt16)37)
75 #define SALEVENT_EXTERNALMOUSEBUTTONDOWN ((sal_uInt16)38)
76 #define SALEVENT_EXTERNALMOUSEBUTTONUP ((sal_uInt16)39)
77 #define SALEVENT_INPUTLANGUAGECHANGE ((sal_uInt16)40)
78 #define SALEVENT_SHOWDIALOG ((sal_uInt16)41)
79 #define SALEVENT_MENUBUTTONCOMMAND ((sal_uInt16)42)
80 #define SALEVENT_SURROUNDINGTEXTREQUEST ((sal_uInt16)43)
81 #define SALEVENT_SURROUNDINGTEXTSELECTIONCHANGE ((sal_uInt16)44)
82 #define SALEVENT_STARTRECONVERSION ((sal_uInt16)45)
83 #define SALEVENT_EXTERNALZOOM ((sal_uInt16)46)
84 #define SALEVENT_EXTERNALSCROLL ((sal_uInt16)47)
85 #define SALEVENT_QUERYCHARPOSITION ((sal_uInt16)48)
87 // MOUSELEAVE must send, when the pointer leave the client area and
88 // the mouse is not captured
89 // MOUSEMOVE, MOUSELEAVE, MOUSEBUTTONDOWN and MOUSEBUTTONUP
90 // MAC: Ctrl+Button is MOUSE_RIGHT
91 struct SalMouseEvent
93 sal_uLong mnTime; // Time in ms, when event is created
94 long mnX; // X-Position (Pixel, TopLeft-Output)
95 long mnY; // Y-Position (Pixel, TopLeft-Output)
96 sal_uInt16 mnButton; // 0-MouseMove/MouseLeave, MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE
97 sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2|MOUSE_LEFT|MOUSE_MIDDLE|MOUSE_RIGHT)
100 // KEYINPUT and KEYUP
101 struct SalKeyEvent
103 sal_uLong mnTime; // Time in ms, when event is created
104 sal_uInt16 mnCode; // SV-KeyCode (KEY_xxx | KEY_SHIFT | KEY_MOD1 | KEY_MOD2)
105 sal_uInt16 mnCharCode; // SV-CharCode
106 sal_uInt16 mnRepeat; // Repeat-Count (KeyInputs-1)
109 // MENUEVENT
110 struct SalMenuEvent
112 sal_uInt16 mnId; // Menu item ID
113 void* mpMenu; // pointer to VCL menu (class Menu)
115 SalMenuEvent() : mnId( 0 ), mpMenu( NULL ) {}
116 SalMenuEvent( sal_uInt16 i_nId, void* i_pMenu )
117 : mnId( i_nId ), mpMenu( i_pMenu ) {}
120 // KEYMODCHANGE
121 struct SalKeyModEvent
123 sal_uLong mnTime; // Time in ms, when event is created
124 sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2)
125 sal_uInt16 mnModKeyCode; // extended Modifier (MODKEY_LEFT,MODKEY_RIGHT,MODKEY_PRESS,MODKEY_RELEASE)
128 // PAINT
129 struct SalPaintEvent
131 long mnBoundX; // BoundRect - X
132 long mnBoundY; // BoundRect - Y
133 long mnBoundWidth; // BoundRect - Width
134 long mnBoundHeight; // BoundRect - Height
135 bool mbImmediateUpdate; // set to true to force an immediate update
137 SalPaintEvent( long x, long y, long w, long h, bool bImmediate = false ) :
138 mnBoundX( x ), mnBoundY( y ),
139 mnBoundWidth( w ), mnBoundHeight( h ),
140 mbImmediateUpdate( bImmediate )
144 // USEREVENT
145 // pEvent == pData
147 // WHEELMOUSE
148 #define SAL_WHEELMOUSE_EVENT_PAGESCROLL ((sal_uLong)0xFFFFFFFF)
149 struct SalWheelMouseEvent
151 sal_uLong mnTime; // Time in ms, when event is created
152 long mnX; // X-Position (Pixel, TopLeft-Output)
153 long mnY; // Y-Position (Pixel, TopLeft-Output)
154 long mnDelta; // Number of rotations
155 long mnNotchDelta; // Number of fixed rotations
156 sal_uLong mnScrollLines; // Actual number of lines to scroll
157 sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2|MOUSE_LEFT|MOUSE_MIDDLE|MOUSE_RIGHT)
158 sal_Bool mbHorz; // Horizontal
159 sal_Bool mbDeltaIsPixel; // delta value is a pixel value (on mac)
161 SalWheelMouseEvent()
162 : mnTime( 0 ), mnX( 0 ), mnY( 0 ), mnDelta( 0 ), mnNotchDelta( 0 ), mnScrollLines( 0 ), mnCode( 0 ), mbHorz( sal_False ), mbDeltaIsPixel( sal_False )
166 // MOUSEACTIVATE
167 struct SalMouseActivateEvent
169 long mnX; // X-Position (Pixel, TopLeft-Output)
170 long mnY; // Y-Position (Pixel, TopLeft-Output)
173 // EXTTEXTINPUT
174 struct SalExtTextInputEvent
176 sal_uLong mnTime; // Time in ms, when event is created
177 OUString maText; // Text
178 const sal_uInt16* mpTextAttr; // Text-Attribute
179 sal_uLong mnCursorPos; // Cursor-Position
180 sal_uLong mnDeltaStart; // Start-Position of last change
181 sal_uInt8 mnCursorFlags; // EXTTEXTINPUT_CURSOR_xxx
182 sal_Bool mbOnlyCursor; // sal_True: Only Cursor-Position has been changed
185 // EXTTEXTINPUTPOS
186 struct SalExtTextInputPosEvent
188 long mnX; // Cursor-X-Position to upper left corner of frame
189 long mnY; // Cursor-Y-Position to upper left corner of frame
190 long mnWidth; // Cursor-Width in Pixel
191 long mnHeight; // Cursor-Height in Pixel
192 long mnExtWidth; // Width of the PreEdit area
193 bool mbVertical; // true if in vertical mode
196 // INPUTCONTEXTCHANGE
197 struct SalInputContextChangeEvent
199 LanguageType meLanguage; // new language
202 // SURROUNDINGTEXTREQUEST
203 struct SalSurroundingTextRequestEvent
205 OUString maText; // Text
206 sal_uLong mnStart; // The beginning index of selected range
207 sal_uLong mnEnd; // The end index of selected range
210 // SURROUNDINGTEXTSELECTIONCHANGE
211 struct SalSurroundingTextSelectionChangeEvent
213 sal_uLong mnStart; // The beginning index of selected range
214 sal_uLong mnEnd; // The end index of selected range
217 // QUERYCHARPOSITION
218 struct SalQueryCharPositionEvent
220 bool mbValid; // The data is valid or not.
221 sal_uLong mnCharPos; // The index of character in a composition.
222 bool mbVertical; // The text is vertical or not.
223 long mnCursorBoundX; // The cursor bounds corresponding to the character specified by mnCharPos - X
224 long mnCursorBoundY; // The cursor bounds corresponding to the character specified by mnCharPos - Y
225 long mnCursorBoundWidth; // The cursor bounds corresponding to the character specified by mnCharPos - Width
226 long mnCursorBoundHeight; // The cursor bounds corresponding to the character specified by mnCharPos - Height
229 // ------------------
230 // - SalFrame-Types -
231 // ------------------
233 typedef long (*SALFRAMEPROC)( Window* pInst, SalFrame* pFrame,
234 sal_uInt16 nEvent, const void* pEvent );
236 // --------------------
237 // - SalObject-Events -
238 // --------------------
240 #define SALOBJ_EVENT_GETFOCUS ((sal_uInt16)1)
241 #define SALOBJ_EVENT_LOSEFOCUS ((sal_uInt16)2)
242 #define SALOBJ_EVENT_TOTOP ((sal_uInt16)3)
243 #define SALOBJ_EVENT_COUNT ((sal_uInt16)4)
245 // ------------------
246 // - SalObject-Types -
247 // ------------------
249 typedef long (*SALOBJECTPROC)( void* pInst, SalObject* pObject,
250 sal_uInt16 nEvent, const void* pEvent );
252 // -----------------
253 // - SalFrameState -
254 // -----------------
256 struct SalFrameState
258 sal_uLong mnMask;
259 long mnX;
260 long mnY;
261 long mnWidth;
262 long mnHeight;
263 long mnMaximizedX;
264 long mnMaximizedY;
265 long mnMaximizedWidth;
266 long mnMaximizedHeight;
267 sal_uLong mnState;
270 // -------------------
271 // - SalInputContext -
272 // -------------------
274 // Have to match DEFINEs in inputctx.hxx, as these are not converted
275 #define SAL_INPUTCONTEXT_TEXT ((sal_uLong)0x00000001)
276 #define SAL_INPUTCONTEXT_EXTTEXTINPUT ((sal_uLong)0x00000002)
277 #define SAL_INPUTCONTEXT_EXTTEXTINPUT_ON ((sal_uLong)0x00000004)
278 #define SAL_INPUTCONTEXT_EXTTEXTINPUT_OFF ((sal_uLong)0x00000008)
279 #define SAL_INPUTCONTEXT_CHANGELANGUAGE ((sal_uLong)0x00000010)
281 struct SalInputContext
283 FontSelectPattern* mpFont;
284 LanguageType meLanguage;
285 sal_uLong mnOptions;
288 typedef void (*SALTIMERPROC)();
290 #endif // _SV_SALWTYPE_HXX
292 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */