Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / vcl / inc / salwtype.hxx
blob12ed894b67f321a9d90cb6249e58b9d654557ae9
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 INCLUDED_VCL_INC_SALWTYPE_HXX
21 #define INCLUDED_VCL_INC_SALWTYPE_HXX
23 #include <i18nlangtag/lang.h>
24 #include <rtl/ustring.hxx>
25 #include <tools/solar.h>
27 class SalGraphics;
28 class SalFrame;
29 class SalObject;
30 namespace vcl { class Window; }
31 class FontSelectPattern;
32 enum class InputContextFlags;
33 enum class WindowStateMask;
34 enum class WindowStateState;
35 enum class ExtTextInputAttr;
36 enum class ModKeyFlags;
38 enum class SalEvent {
39 NONE,
40 MouseMove,
41 MouseLeave,
42 MouseButtonDown,
43 MouseButtonUp,
44 KeyInput,
45 KeyUp,
46 KeyModChange,
47 Paint,
48 Resize,
49 GetFocus,
50 LoseFocus,
51 Close,
52 Shutdown,
53 SettingsChanged,
54 PrinterChanged,
55 DisplayChanged,
56 FontChanged,
57 WheelMouse,
58 UserEvent,
59 MouseActivate,
60 ExtTextInput,
61 EndExtTextInput,
62 ExtTextInputPos,
63 InputContextChange,
64 Move,
65 MoveResize,
66 ClosePopups,
67 ExternalKeyInput,
68 ExternalKeyUp,
69 MenuCommand,
70 MenuHighlight,
71 MenuActivate,
72 MenuDeactivate,
73 ExternalMouseMove,
74 ExternalMouseButtonDown,
75 ExternalMouseButtonUp,
76 InputLanguageChange,
77 ShowDialog,
78 MenuButtonCommand,
79 SurroundingTextRequest,
80 SurroundingTextSelectionChange,
81 StartReconversion,
82 QueryCharPosition,
83 Swipe,
84 LongPress
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_uInt64 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_uInt64 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( nullptr ) {}
116 SalMenuEvent( sal_uInt16 i_nId, void* i_pMenu )
117 : mnId( i_nId ), mpMenu( i_pMenu ) {}
120 // KEYMODCHANGE
121 struct SalKeyModEvent
123 bool mbDown; // Whether the change occurred on a key down event
124 sal_uInt64 mnTime; // Time in ms, when event is created
125 sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2)
126 ModKeyFlags mnModKeyCode; // extended Modifier (MODKEY_LEFT,MODKEY_RIGHT,MODKEY_PRESS,MODKEY_RELEASE)
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 #define SAL_WHEELMOUSE_EVENT_PAGESCROLL ((sal_uLong)0xFFFFFFFF)
145 struct SalWheelMouseEvent
147 sal_uInt64 mnTime; // Time in ms, when event is created
148 long mnX; // X-Position (Pixel, TopLeft-Output)
149 long mnY; // Y-Position (Pixel, TopLeft-Output)
150 long mnDelta; // Number of rotations
151 long mnNotchDelta; // Number of fixed rotations
152 double mnScrollLines; // Actual number of lines to scroll
153 sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2|MOUSE_LEFT|MOUSE_MIDDLE|MOUSE_RIGHT)
154 bool mbHorz; // Horizontal
155 bool mbDeltaIsPixel; // delta value is a pixel value (on touch devices)
157 SalWheelMouseEvent()
158 : mnTime( 0 ), mnX( 0 ), mnY( 0 ), mnDelta( 0 ), mnNotchDelta( 0 ), mnScrollLines( 0 ), mnCode( 0 ), mbHorz( false ), mbDeltaIsPixel( false )
162 struct SalExtTextInputEvent
164 OUString maText; // Text
165 const ExtTextInputAttr* mpTextAttr; // Text-Attribute
166 sal_Int32 mnCursorPos; // Cursor-Position
167 sal_uInt8 mnCursorFlags; // EXTTEXTINPUT_CURSOR_xxx
170 struct SalExtTextInputPosEvent
172 long mnX; // Cursor-X-Position to upper left corner of frame
173 long mnY; // Cursor-Y-Position to upper left corner of frame
174 long mnWidth; // Cursor-Width in Pixel
175 long mnHeight; // Cursor-Height in Pixel
176 long mnExtWidth; // Width of the PreEdit area
177 bool mbVertical; // true if in vertical mode
178 SalExtTextInputPosEvent()
179 : mnX(0)
180 , mnY(0)
181 , mnWidth(0)
182 , mnHeight(0)
183 , mnExtWidth(0)
184 , mbVertical(false)
189 struct SalInputContextChangeEvent
191 LanguageType meLanguage; // new language
194 struct SalSurroundingTextRequestEvent
196 OUString maText; // Text
197 sal_uLong mnStart; // The beginning index of selected range
198 sal_uLong mnEnd; // The end index of selected range
201 struct SalSurroundingTextSelectionChangeEvent
203 sal_uLong mnStart; // The beginning index of selected range
204 sal_uLong mnEnd; // The end index of selected range
207 struct SalQueryCharPositionEvent
209 bool mbValid; // The data is valid or not.
210 sal_uLong mnCharPos; // The index of character in a composition.
211 bool mbVertical; // The text is vertical or not.
212 long mnCursorBoundX; // The cursor bounds corresponding to the character specified by mnCharPos - X
213 long mnCursorBoundY; // The cursor bounds corresponding to the character specified by mnCharPos - Y
214 long mnCursorBoundWidth; // The cursor bounds corresponding to the character specified by mnCharPos - Width
215 long mnCursorBoundHeight; // The cursor bounds corresponding to the character specified by mnCharPos - Height
218 typedef bool (*SALFRAMEPROC)( vcl::Window* pInst, SalEvent nEvent, const void* pEvent );
220 enum class SalObjEvent {
221 GetFocus = 1,
222 LoseFocus = 2,
223 ToTop = 3
226 typedef long (*SALOBJECTPROC)( void* pInst, SalObjEvent nEvent );
228 struct SalFrameState
230 WindowStateMask mnMask;
231 long mnX;
232 long mnY;
233 long mnWidth;
234 long mnHeight;
235 long mnMaximizedX;
236 long mnMaximizedY;
237 long mnMaximizedWidth;
238 long mnMaximizedHeight;
239 WindowStateState mnState;
242 struct SalInputContext
244 FontSelectPattern* mpFont;
245 LanguageType meLanguage;
246 InputContextFlags mnOptions;
249 struct SalSwipeEvent
251 double mnVelocityX;
252 double mnVelocityY;
253 long mnX;
254 long mnY;
257 struct SalLongPressEvent
259 long mnX;
260 long mnY;
263 typedef void (*SALTIMERPROC)( bool idle );
265 #endif // INCLUDED_VCL_INC_SALWTYPE_HXX
267 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */