Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SV_SALWTYPE_HXX
30 : : #define _SV_SALWTYPE_HXX
31 : :
32 : : #include <i18npool/lang.h>
33 : : #include <tools/string.hxx>
34 : : #include <tools/solar.h>
35 : :
36 : : class SalGraphics;
37 : : class SalFrame;
38 : : class SalObject;
39 : : class Window;
40 : :
41 : : class FontSelectPattern;
42 : :
43 : : // ---------------
44 : : // - SalExtInput -
45 : : // ---------------
46 : :
47 : : // Have to match DEFINEs in cmdevt.hxx, as these will not be converted
48 : :
49 : : #define SAL_EXTTEXTINPUT_ATTR_GRAYWAVELINE ((sal_uInt16)0x0100)
50 : : #define SAL_EXTTEXTINPUT_ATTR_UNDERLINE ((sal_uInt16)0x0200)
51 : : #define SAL_EXTTEXTINPUT_ATTR_BOLDUNDERLINE ((sal_uInt16)0x0400)
52 : : #define SAL_EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE ((sal_uInt16)0x0800)
53 : : #define SAL_EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE ((sal_uInt16)0x1000)
54 : : #define SAL_EXTTEXTINPUT_ATTR_HIGHLIGHT ((sal_uInt16)0x2000)
55 : : #define SAL_EXTTEXTINPUT_ATTR_REDTEXT ((sal_uInt16)0x4000)
56 : : #define SAL_EXTTEXTINPUT_ATTR_HALFTONETEXT ((sal_uInt16)0x8000)
57 : :
58 : : #define SAL_EXTTEXTINPUT_CURSOR_INVISIBLE ((sal_uInt16)0x0001)
59 : : #define SAL_EXTTEXTINPUT_CURSOR_OVERWRITE ((sal_uInt16)0x0002)
60 : :
61 : : // ------------
62 : : // - SalEvent -
63 : : // ------------
64 : :
65 : : #define SALEVENT_MOUSEMOVE ((sal_uInt16)1)
66 : : #define SALEVENT_MOUSELEAVE ((sal_uInt16)2)
67 : : #define SALEVENT_MOUSEBUTTONDOWN ((sal_uInt16)3)
68 : : #define SALEVENT_MOUSEBUTTONUP ((sal_uInt16)4)
69 : : #define SALEVENT_KEYINPUT ((sal_uInt16)5)
70 : : #define SALEVENT_KEYUP ((sal_uInt16)6)
71 : : #define SALEVENT_KEYMODCHANGE ((sal_uInt16)7)
72 : : #define SALEVENT_PAINT ((sal_uInt16)8)
73 : : #define SALEVENT_RESIZE ((sal_uInt16)9)
74 : : #define SALEVENT_GETFOCUS ((sal_uInt16)10)
75 : : #define SALEVENT_LOSEFOCUS ((sal_uInt16)11)
76 : : #define SALEVENT_CLOSE ((sal_uInt16)12)
77 : : #define SALEVENT_SHUTDOWN ((sal_uInt16)13)
78 : : #define SALEVENT_SETTINGSCHANGED ((sal_uInt16)14)
79 : : #define SALEVENT_VOLUMECHANGED ((sal_uInt16)15)
80 : : #define SALEVENT_PRINTERCHANGED ((sal_uInt16)16)
81 : : #define SALEVENT_DISPLAYCHANGED ((sal_uInt16)17)
82 : : #define SALEVENT_FONTCHANGED ((sal_uInt16)18)
83 : : #define SALEVENT_DATETIMECHANGED ((sal_uInt16)19)
84 : : #define SALEVENT_KEYBOARDCHANGED ((sal_uInt16)20)
85 : : #define SALEVENT_WHEELMOUSE ((sal_uInt16)21)
86 : : #define SALEVENT_USEREVENT ((sal_uInt16)22)
87 : : #define SALEVENT_MOUSEACTIVATE ((sal_uInt16)23)
88 : : #define SALEVENT_EXTTEXTINPUT ((sal_uInt16)24)
89 : : #define SALEVENT_ENDEXTTEXTINPUT ((sal_uInt16)25)
90 : : #define SALEVENT_EXTTEXTINPUTPOS ((sal_uInt16)26)
91 : : #define SALEVENT_INPUTCONTEXTCHANGE ((sal_uInt16)27)
92 : : #define SALEVENT_MOVE ((sal_uInt16)28)
93 : : #define SALEVENT_MOVERESIZE ((sal_uInt16)29)
94 : : #define SALEVENT_CLOSEPOPUPS ((sal_uInt16)30)
95 : : #define SALEVENT_EXTERNALKEYINPUT ((sal_uInt16)31)
96 : : #define SALEVENT_EXTERNALKEYUP ((sal_uInt16)32)
97 : : #define SALEVENT_MENUCOMMAND ((sal_uInt16)33)
98 : : #define SALEVENT_MENUHIGHLIGHT ((sal_uInt16)34)
99 : : #define SALEVENT_MENUACTIVATE ((sal_uInt16)35)
100 : : #define SALEVENT_MENUDEACTIVATE ((sal_uInt16)36)
101 : : #define SALEVENT_EXTERNALMOUSEMOVE ((sal_uInt16)37)
102 : : #define SALEVENT_EXTERNALMOUSEBUTTONDOWN ((sal_uInt16)38)
103 : : #define SALEVENT_EXTERNALMOUSEBUTTONUP ((sal_uInt16)39)
104 : : #define SALEVENT_INPUTLANGUAGECHANGE ((sal_uInt16)40)
105 : : #define SALEVENT_SHOWDIALOG ((sal_uInt16)41)
106 : : #define SALEVENT_MENUBUTTONCOMMAND ((sal_uInt16)42)
107 : : #define SALEVENT_SURROUNDINGTEXTREQUEST ((sal_uInt16)43)
108 : : #define SALEVENT_SURROUNDINGTEXTSELECTIONCHANGE ((sal_uInt16)44)
109 : : #define SALEVENT_STARTRECONVERSION ((sal_uInt16)45)
110 : : #define SALEVENT_COUNT ((sal_uInt16)45)
111 : :
112 : : // MOUSELEAVE must send, when the pointer leave the client area and
113 : : // the mouse is not captured
114 : : // MOUSEMOVE, MOUSELEAVE, MOUSEBUTTONDOWN and MOUSEBUTTONUP
115 : : // MAC: Ctrl+Button is MOUSE_RIGHT
116 : : struct SalMouseEvent
117 : : {
118 : : sal_uLong mnTime; // Time in ms, when event is created
119 : : long mnX; // X-Position (Pixel, TopLeft-Output)
120 : : long mnY; // Y-Position (Pixel, TopLeft-Output)
121 : : sal_uInt16 mnButton; // 0-MouseMove/MouseLeave, MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE
122 : : sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2|MOUSE_LEFT|MOUSE_MIDDLE|MOUSE_RIGHT)
123 : : };
124 : :
125 : : // KEYINPUT and KEYUP
126 : : struct SalKeyEvent
127 : : {
128 : : sal_uLong mnTime; // Time in ms, when event is created
129 : : sal_uInt16 mnCode; // SV-KeyCode (KEY_xxx | KEY_SHIFT | KEY_MOD1 | KEY_MOD2)
130 : : sal_uInt16 mnCharCode; // SV-CharCode
131 : : sal_uInt16 mnRepeat; // Repeat-Count (KeyInputs-1)
132 : : };
133 : :
134 : : // MENUEVENT
135 : : struct SalMenuEvent
136 : : {
137 : : sal_uInt16 mnId; // Menu item ID
138 : : void* mpMenu; // pointer to VCL menu (class Menu)
139 : :
140 : : SalMenuEvent() : mnId( 0 ), mpMenu( NULL ) {}
141 : : SalMenuEvent( sal_uInt16 i_nId, void* i_pMenu )
142 : : : mnId( i_nId ), mpMenu( i_pMenu ) {}
143 : : };
144 : :
145 : : // KEYMODCHANGE
146 : : struct SalKeyModEvent
147 : : {
148 : : sal_uLong mnTime; // Time in ms, when event is created
149 : : sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2)
150 : : sal_uInt16 mnModKeyCode; // extended Modifier (MODKEY_LEFT,MODKEY_RIGHT,MODKEY_PRESS,MODKEY_RELEASE)
151 : : };
152 : :
153 : : // PAINT
154 : : struct SalPaintEvent
155 : : {
156 : : long mnBoundX; // BoundRect - X
157 : : long mnBoundY; // BoundRect - Y
158 : : long mnBoundWidth; // BoundRect - Width
159 : : long mnBoundHeight; // BoundRect - Height
160 : : bool mbImmediateUpdate; // set to true to force an immediate update
161 : :
162 : 1618 : SalPaintEvent( long x, long y, long w, long h, bool bImmediate = false ) :
163 : : mnBoundX( x ), mnBoundY( y ),
164 : : mnBoundWidth( w ), mnBoundHeight( h ),
165 : 1618 : mbImmediateUpdate( bImmediate )
166 : 1618 : {}
167 : : };
168 : :
169 : : // USEREVENT
170 : : // pEvent == pData
171 : :
172 : : // WHEELMOUSE
173 : : #define SAL_WHEELMOUSE_EVENT_PAGESCROLL ((sal_uLong)0xFFFFFFFF)
174 : : struct SalWheelMouseEvent
175 : : {
176 : : sal_uLong mnTime; // Time in ms, when event is created
177 : : long mnX; // X-Position (Pixel, TopLeft-Output)
178 : : long mnY; // Y-Position (Pixel, TopLeft-Output)
179 : : long mnDelta; // Number of rotations
180 : : long mnNotchDelta; // Number of fixed rotations
181 : : sal_uLong mnScrollLines; // Actual number of lines to scroll
182 : : sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2|MOUSE_LEFT|MOUSE_MIDDLE|MOUSE_RIGHT)
183 : : sal_Bool mbHorz; // Horizontal
184 : : sal_Bool mbDeltaIsPixel; // delta value is a pixel value (on mac)
185 : :
186 : 0 : SalWheelMouseEvent()
187 : 0 : : mnTime( 0 ), mnX( 0 ), mnY( 0 ), mnDelta( 0 ), mnNotchDelta( 0 ), mnScrollLines( 0 ), mnCode( 0 ), mbHorz( sal_False ), mbDeltaIsPixel( sal_False )
188 : 0 : {}
189 : : };
190 : :
191 : : // MOUSEACTIVATE
192 : : struct SalMouseActivateEvent
193 : : {
194 : : long mnX; // X-Position (Pixel, TopLeft-Output)
195 : : long mnY; // Y-Position (Pixel, TopLeft-Output)
196 : : };
197 : :
198 : : #ifdef __cplusplus
199 : :
200 : : // EXTTEXTINPUT
201 : 0 : struct SalExtTextInputEvent
202 : : {
203 : : sal_uLong mnTime; // Time in ms, when event is created
204 : : UniString maText; // Text
205 : : const sal_uInt16* mpTextAttr; // Text-Attribute
206 : : sal_uLong mnCursorPos; // Cursor-Position
207 : : sal_uLong mnDeltaStart; // Start-Position of last change
208 : : sal_uInt8 mnCursorFlags; // SAL_EXTTEXTINPUT_CURSOR_xxx
209 : : sal_Bool mbOnlyCursor; // sal_True: Only Cursor-Position has been changed
210 : : };
211 : :
212 : : #endif // __cplusplus
213 : :
214 : : // EXTTEXTINPUTPOS
215 : : struct SalExtTextInputPosEvent
216 : : {
217 : : long mnX; // Cursor-X-Position to upper left corner of frame
218 : : long mnY; // Cursor-Y-Position to upper left corner of frame
219 : : long mnWidth; // Cursor-Width in Pixel
220 : : long mnHeight; // Cursor-Height in Pixel
221 : : long mnExtWidth; // Width of the PreEdit area
222 : : bool mbVertical; // true if in vertical mode
223 : : };
224 : :
225 : : #ifdef __cplusplus
226 : :
227 : : // INPUTCONTEXTCHANGE
228 : : struct SalInputContextChangeEvent
229 : : {
230 : : LanguageType meLanguage; // new language
231 : : };
232 : :
233 : : #endif // __cplusplus
234 : :
235 : : #ifdef __cplusplus
236 : :
237 : : // SURROUNDINGTEXTREQUEST
238 : : struct SalSurroundingTextRequestEvent
239 : : {
240 : : UniString maText; // Text
241 : : sal_uLong mnStart; // The beginning index of selected range
242 : : sal_uLong mnEnd; // The end index of selected range
243 : : };
244 : :
245 : : #endif // __cplusplus
246 : :
247 : : #ifdef __cplusplus
248 : :
249 : : // SURROUNDINGTEXTSELECTIONCHANGE
250 : : struct SalSurroundingTextSelectionChangeEvent
251 : : {
252 : : sal_uLong mnStart; // The beginning index of selected range
253 : : sal_uLong mnEnd; // The end index of selected range
254 : : };
255 : :
256 : : #endif // __cplusplus
257 : :
258 : : // ------------------
259 : : // - SalFrame-Types -
260 : : // ------------------
261 : :
262 : : typedef long (*SALFRAMEPROC)( Window* pInst, SalFrame* pFrame,
263 : : sal_uInt16 nEvent, const void* pEvent );
264 : :
265 : : // --------------------
266 : : // - SalObject-Events -
267 : : // --------------------
268 : :
269 : : #define SALOBJ_EVENT_GETFOCUS ((sal_uInt16)1)
270 : : #define SALOBJ_EVENT_LOSEFOCUS ((sal_uInt16)2)
271 : : #define SALOBJ_EVENT_TOTOP ((sal_uInt16)3)
272 : : #define SALOBJ_EVENT_COUNT ((sal_uInt16)4)
273 : :
274 : : // ------------------
275 : : // - SalObject-Types -
276 : : // ------------------
277 : :
278 : : typedef long (*SALOBJECTPROC)( void* pInst, SalObject* pObject,
279 : : sal_uInt16 nEvent, const void* pEvent );
280 : :
281 : : // -----------------
282 : : // - SalFrameState -
283 : : // -----------------
284 : :
285 : : // Must be the same as in syswin.hxx
286 : : #define SAL_FRAMESTATE_MASK_X ((sal_uLong)0x00000001)
287 : : #define SAL_FRAMESTATE_MASK_Y ((sal_uLong)0x00000002)
288 : : #define SAL_FRAMESTATE_MASK_WIDTH ((sal_uLong)0x00000004)
289 : : #define SAL_FRAMESTATE_MASK_HEIGHT ((sal_uLong)0x00000008)
290 : : #define SAL_FRAMESTATE_MASK_MAXIMIZED_X ((sal_uLong)0x00000100)
291 : : #define SAL_FRAMESTATE_MASK_MAXIMIZED_Y ((sal_uLong)0x00000200)
292 : : #define SAL_FRAMESTATE_MASK_MAXIMIZED_WIDTH ((sal_uLong)0x00000400)
293 : : #define SAL_FRAMESTATE_MASK_MAXIMIZED_HEIGHT ((sal_uLong)0x00000800)
294 : : #define SAL_FRAMESTATE_MASK_STATE ((sal_uLong)0x00000010)
295 : :
296 : : #define SAL_FRAMESTATE_NORMAL ((sal_uLong)0x00000001)
297 : : #define SAL_FRAMESTATE_MINIMIZED ((sal_uLong)0x00000002)
298 : : #define SAL_FRAMESTATE_MAXIMIZED ((sal_uLong)0x00000004)
299 : : #define SAL_FRAMESTATE_ROLLUP ((sal_uLong)0x00000008)
300 : : #define SAL_FRAMESTATE_MAXIMIZED_HORZ ((sal_uLong)0x00000010)
301 : : #define SAL_FRAMESTATE_MAXIMIZED_VERT ((sal_uLong)0x00000020)
302 : : #define SAL_FRAMESTATE_SYSTEMMASK ((sal_uLong)0x0000FFFF)
303 : :
304 : : struct SalFrameState
305 : : {
306 : : sal_uLong mnMask;
307 : : long mnX;
308 : : long mnY;
309 : : long mnWidth;
310 : : long mnHeight;
311 : : long mnMaximizedX;
312 : : long mnMaximizedY;
313 : : long mnMaximizedWidth;
314 : : long mnMaximizedHeight;
315 : : sal_uLong mnState;
316 : : };
317 : :
318 : : // -------------------
319 : : // - SalInputContext -
320 : : // -------------------
321 : :
322 : : // Have to match DEFINEs in inputctx.hxx, as these are not converted
323 : : #define SAL_INPUTCONTEXT_TEXT ((sal_uLong)0x00000001)
324 : : #define SAL_INPUTCONTEXT_EXTTEXTINPUT ((sal_uLong)0x00000002)
325 : : #define SAL_INPUTCONTEXT_EXTTEXTINPUT_ON ((sal_uLong)0x00000004)
326 : : #define SAL_INPUTCONTEXT_EXTTEXTINPUT_OFF ((sal_uLong)0x00000008)
327 : : #define SAL_INPUTCONTEXT_CHANGELANGUAGE ((sal_uLong)0x00000010)
328 : :
329 : : #ifdef __cplusplus
330 : :
331 : : struct SalInputContext
332 : : {
333 : : FontSelectPattern* mpFont;
334 : : LanguageType meLanguage;
335 : : sal_uLong mnOptions;
336 : : };
337 : :
338 : : #endif // __cplusplus
339 : :
340 : : // ------------------
341 : : // - SalTimer-Types -
342 : : // ------------------
343 : :
344 : : typedef void (*SALTIMERPROC)();
345 : :
346 : : #endif // _SV_SALWTYPE_HXX
347 : :
348 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|