bump product version to 7.2.5.1
[LibreOffice.git] / vcl / inc / salwtype.hxx
blob2b07854271ef178f3f0632cbc0b27176975a6ab9
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/ref.hxx>
25 #include <rtl/ustring.hxx>
26 #include <tools/solar.h>
27 #include <tools/long.hxx>
28 #include <vcl/GestureEvent.hxx>
30 class LogicalFontInstance;
31 class SalGraphics;
32 class SalFrame;
33 class SalObject;
34 namespace vcl { class Window; }
35 enum class InputContextFlags;
36 enum class WindowStateMask;
37 enum class WindowStateState;
38 enum class ExtTextInputAttr;
39 enum class ModKeyFlags;
41 enum class SalEvent {
42 NONE,
43 MouseMove,
44 MouseLeave,
45 MouseButtonDown,
46 MouseButtonUp,
47 KeyInput,
48 KeyUp,
49 KeyModChange,
50 Paint,
51 Resize,
52 GetFocus,
53 LoseFocus,
54 Close,
55 Shutdown,
56 SettingsChanged,
57 PrinterChanged,
58 DisplayChanged,
59 FontChanged,
60 WheelMouse,
61 UserEvent,
62 MouseActivate,
63 ExtTextInput,
64 EndExtTextInput,
65 ExtTextInputPos,
66 InputContextChange,
67 Move,
68 MoveResize,
69 ClosePopups,
70 ExternalKeyInput,
71 ExternalKeyUp,
72 MenuCommand,
73 MenuHighlight,
74 MenuActivate,
75 MenuDeactivate,
76 ExternalMouseMove,
77 ExternalMouseButtonDown,
78 ExternalMouseButtonUp,
79 InputLanguageChange,
80 ShowDialog,
81 MenuButtonCommand,
82 SurroundingTextRequest,
83 DeleteSurroundingTextRequest,
84 SurroundingTextSelectionChange,
85 StartReconversion,
86 QueryCharPosition,
87 Swipe,
88 LongPress,
89 ExternalGesture,
90 Gesture,
93 struct SalAbstractMouseEvent
95 sal_uInt64 mnTime; // Time in ms, when event is created
96 tools::Long mnX; // X-Position (Pixel, TopLeft-Output)
97 tools::Long mnY; // Y-Position (Pixel, TopLeft-Output)
98 sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2|MOUSE_LEFT|MOUSE_MIDDLE|MOUSE_RIGHT)
100 protected:
101 SalAbstractMouseEvent() : mnTime(0), mnX(0), mnY(0), mnCode(0) {}
104 // MOUSELEAVE must send, when the pointer leave the client area and
105 // the mouse is not captured
106 // MOUSEMOVE, MOUSELEAVE, MOUSEBUTTONDOWN and MOUSEBUTTONUP
107 // MAC: Ctrl+Button is MOUSE_RIGHT
108 struct SalMouseEvent final : public SalAbstractMouseEvent
110 sal_uInt16 mnButton; // 0-MouseMove/MouseLeave, MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE
112 SalMouseEvent() : mnButton(0) {}
115 // KEYINPUT and KEYUP
116 struct SalKeyEvent
118 sal_uInt16 mnCode; // SV-KeyCode (KEY_xxx | KEY_SHIFT | KEY_MOD1 | KEY_MOD2)
119 sal_uInt16 mnCharCode; // SV-CharCode
120 sal_uInt16 mnRepeat; // Repeat-Count (KeyInputs-1)
123 // MENUEVENT
124 struct SalMenuEvent
126 sal_uInt16 mnId; // Menu item ID
127 void* mpMenu; // pointer to VCL menu (class Menu)
129 SalMenuEvent() : mnId( 0 ), mpMenu( nullptr ) {}
130 SalMenuEvent( sal_uInt16 i_nId, void* i_pMenu )
131 : mnId( i_nId ), mpMenu( i_pMenu ) {}
134 // KEYMODCHANGE
135 struct SalKeyModEvent
137 bool mbDown; // Whether the change occurred on a key down event
138 sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2)
139 ModKeyFlags mnModKeyCode; // extended Modifier (MODKEY_LEFT,MODKEY_RIGHT,MODKEY_PRESS,MODKEY_RELEASE)
142 struct SalPaintEvent
144 tools::Long mnBoundX; // BoundRect - X
145 tools::Long mnBoundY; // BoundRect - Y
146 tools::Long mnBoundWidth; // BoundRect - Width
147 tools::Long mnBoundHeight; // BoundRect - Height
148 bool mbImmediateUpdate; // set to true to force an immediate update
150 SalPaintEvent( tools::Long x, tools::Long y, tools::Long w, tools::Long h, bool bImmediate = false ) :
151 mnBoundX( x ), mnBoundY( y ),
152 mnBoundWidth( w ), mnBoundHeight( h ),
153 mbImmediateUpdate( bImmediate )
157 #define SAL_WHEELMOUSE_EVENT_PAGESCROLL (sal_uLong(0xFFFFFFFF))
158 struct SalWheelMouseEvent final : public SalAbstractMouseEvent
160 tools::Long mnDelta; // Number of rotations
161 tools::Long mnNotchDelta; // Number of fixed rotations
162 double mnScrollLines; // Actual number of lines to scroll
163 bool mbHorz; // Horizontal
164 bool mbDeltaIsPixel; // delta value is a pixel value (on touch devices)
166 SalWheelMouseEvent()
167 : mnDelta(0), mnNotchDelta(0), mnScrollLines(0), mbHorz(false), mbDeltaIsPixel(false)
171 struct SalExtTextInputEvent
173 OUString maText; // Text
174 const ExtTextInputAttr* mpTextAttr; // Text-Attribute
175 sal_Int32 mnCursorPos; // Cursor-Position
176 sal_uInt8 mnCursorFlags; // EXTTEXTINPUT_CURSOR_xxx
179 struct SalExtTextInputPosEvent
181 tools::Long mnX; // Cursor-X-Position to upper left corner of frame
182 tools::Long mnY; // Cursor-Y-Position to upper left corner of frame
183 tools::Long mnWidth; // Cursor-Width in Pixel
184 tools::Long mnHeight; // Cursor-Height in Pixel
185 tools::Long mnExtWidth; // Width of the PreEdit area
186 bool mbVertical; // true if in vertical mode
187 SalExtTextInputPosEvent()
188 : mnX(0)
189 , mnY(0)
190 , mnWidth(0)
191 , mnHeight(0)
192 , mnExtWidth(0)
193 , mbVertical(false)
198 struct SalInputContextChangeEvent
202 struct SalSurroundingTextRequestEvent
204 OUString maText; // Text
205 sal_uLong mnStart; // The beginning index of selected range
206 sal_uLong mnEnd; // The end index of selected range
209 struct SalSurroundingTextSelectionChangeEvent
211 sal_uLong mnStart; // The beginning index of selected range
212 sal_uLong mnEnd; // The end index of selected range
215 struct SalQueryCharPositionEvent
217 bool mbValid; // The data is valid or not.
218 sal_uLong mnCharPos; // The index of character in a composition.
219 bool mbVertical; // The text is vertical or not.
220 tools::Long mnCursorBoundX; // The cursor bounds corresponding to the character specified by mnCharPos - X
221 tools::Long mnCursorBoundY; // The cursor bounds corresponding to the character specified by mnCharPos - Y
222 tools::Long mnCursorBoundWidth; // The cursor bounds corresponding to the character specified by mnCharPos - Width
223 tools::Long mnCursorBoundHeight; // The cursor bounds corresponding to the character specified by mnCharPos - Height
226 typedef bool (*SALFRAMEPROC)( vcl::Window* pInst, SalEvent nEvent, const void* pEvent );
228 enum class SalObjEvent {
229 GetFocus = 1,
230 LoseFocus = 2,
231 ToTop = 3
234 struct SalFrameState
236 WindowStateMask mnMask;
237 tools::Long mnX;
238 tools::Long mnY;
239 tools::Long mnWidth;
240 tools::Long mnHeight;
241 tools::Long mnMaximizedX;
242 tools::Long mnMaximizedY;
243 tools::Long mnMaximizedWidth;
244 tools::Long mnMaximizedHeight;
245 WindowStateState mnState;
248 struct SalInputContext
250 rtl::Reference<LogicalFontInstance> mpFont;
251 InputContextFlags mnOptions;
254 struct SalSwipeEvent
256 double mnVelocityX;
257 double mnVelocityY;
258 tools::Long mnX;
259 tools::Long mnY;
262 struct SalLongPressEvent
264 tools::Long mnX;
265 tools::Long mnY;
268 struct SalGestureEvent
270 GestureEventType meEventType;
271 PanningOrientation meOrientation;
272 double mfOffset;
273 tools::Long mnX;
274 tools::Long mnY;
277 typedef void (*SALTIMERPROC)();
279 #endif // INCLUDED_VCL_INC_SALWTYPE_HXX
281 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */