tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / vcl / inc / salwtype.hxx
blobd197f17fe47aad40d978ec462490502fff54c6dd
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 <rtl/ref.hxx>
24 #include <rtl/ustring.hxx>
25 #include <tools/gen.hxx>
26 #include <tools/solar.h>
27 #include <tools/long.hxx>
28 #include <vcl/GestureEventPan.hxx>
29 #include <vcl/GestureEventZoom.hxx>
30 #include <vcl/GestureEventRotate.hxx>
32 class LogicalFontInstance;
33 class SalGraphics;
34 class SalFrame;
35 class SalObject;
36 namespace vcl
38 class Window;
39 enum class WindowState;
41 enum class InputContextFlags;
42 enum class WindowStateMask;
43 enum class ExtTextInputAttr;
44 enum class ModKeyFlags;
46 enum class SalEvent {
47 NONE,
48 MouseMove,
49 MouseLeave,
50 MouseButtonDown,
51 MouseButtonUp,
52 KeyInput,
53 KeyUp,
54 KeyModChange,
55 Paint,
56 Resize,
57 GetFocus,
58 LoseFocus,
59 Close,
60 Shutdown,
61 SettingsChanged,
62 PrinterChanged,
63 DisplayChanged,
64 FontChanged,
65 WheelMouse,
66 UserEvent,
67 MouseActivate,
68 ExtTextInput,
69 EndExtTextInput,
70 ExtTextInputPos,
71 InputContextChange,
72 Move,
73 MoveResize,
74 ClosePopups,
75 ExternalKeyInput,
76 ExternalKeyUp,
77 MenuCommand,
78 MenuHighlight,
79 MenuActivate,
80 MenuDeactivate,
81 ExternalMouseMove,
82 ExternalMouseButtonDown,
83 ExternalMouseButtonUp,
84 InputLanguageChange,
85 ShowDialog,
86 MenuButtonCommand,
87 SurroundingTextRequest,
88 DeleteSurroundingTextRequest,
89 SurroundingTextSelectionChange,
90 StartReconversion,
91 QueryCharPosition,
92 GestureSwipe,
93 GestureLongPress,
94 ExternalGesture,
95 GesturePan,
96 GestureZoom,
97 GestureRotate,
100 struct SalAbstractMouseEvent
102 sal_uInt64 mnTime; // Time in ms, when event is created
103 tools::Long mnX; // X-Position (Pixel, TopLeft-Output)
104 tools::Long mnY; // Y-Position (Pixel, TopLeft-Output)
105 sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2|MOUSE_LEFT|MOUSE_MIDDLE|MOUSE_RIGHT)
107 protected:
108 SalAbstractMouseEvent() : mnTime(0), mnX(0), mnY(0), mnCode(0) {}
111 // MOUSELEAVE must send, when the pointer leave the client area and
112 // the mouse is not captured
113 // MOUSEMOVE, MOUSELEAVE, MOUSEBUTTONDOWN and MOUSEBUTTONUP
114 // MAC: Ctrl+Button is MOUSE_RIGHT
115 struct SalMouseEvent final : public SalAbstractMouseEvent
117 sal_uInt16 mnButton; // 0-MouseMove/MouseLeave, MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE
119 SalMouseEvent() : mnButton(0) {}
122 // KEYINPUT and KEYUP
123 struct SalKeyEvent
125 sal_uInt16 mnCode; // SV-KeyCode (KEY_xxx | KEY_SHIFT | KEY_MOD1 | KEY_MOD2)
126 sal_uInt16 mnCharCode; // SV-CharCode
127 sal_uInt16 mnRepeat; // Repeat-Count (KeyInputs-1)
130 // MENUEVENT
131 struct SalMenuEvent
133 sal_uInt16 mnId; // Menu item ID
134 void* mpMenu; // pointer to VCL menu (class Menu)
136 SalMenuEvent() : mnId( 0 ), mpMenu( nullptr ) {}
137 SalMenuEvent( sal_uInt16 i_nId, void* i_pMenu )
138 : mnId( i_nId ), mpMenu( i_pMenu ) {}
141 // KEYMODCHANGE
142 struct SalKeyModEvent
144 bool mbDown; // Whether the change occurred on a key down event
145 sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2)
146 ModKeyFlags mnModKeyCode; // extended Modifier (MODKEY_LEFT,MODKEY_RIGHT,MODKEY_PRESS,MODKEY_RELEASE)
149 struct SalPaintEvent
151 tools::Long mnBoundX; // BoundRect - X
152 tools::Long mnBoundY; // BoundRect - Y
153 tools::Long mnBoundWidth; // BoundRect - Width
154 tools::Long mnBoundHeight; // BoundRect - Height
155 bool mbImmediateUpdate; // set to true to force an immediate update
157 SalPaintEvent( tools::Long x, tools::Long y, tools::Long w, tools::Long h, bool bImmediate = false ) :
158 mnBoundX( x ), mnBoundY( y ),
159 mnBoundWidth( w ), mnBoundHeight( h ),
160 mbImmediateUpdate( bImmediate )
164 #define SAL_WHEELMOUSE_EVENT_PAGESCROLL (sal_uLong(0xFFFFFFFF))
165 struct SalWheelMouseEvent final : public SalAbstractMouseEvent
167 tools::Long mnDelta; // Number of rotations
168 tools::Long mnNotchDelta; // Number of fixed rotations
169 double mnScrollLines; // Actual number of lines to scroll
170 bool mbHorz; // Horizontal
171 bool mbDeltaIsPixel; // delta value is a pixel value (on touch devices)
173 SalWheelMouseEvent()
174 : mnDelta(0), mnNotchDelta(0), mnScrollLines(0), mbHorz(false), mbDeltaIsPixel(false)
178 struct SalExtTextInputEvent
180 OUString maText; // Text
181 const ExtTextInputAttr* mpTextAttr; // Text-Attribute
182 sal_Int32 mnCursorPos; // Cursor-Position
183 sal_uInt8 mnCursorFlags; // EXTTEXTINPUT_CURSOR_xxx
186 struct SalExtTextInputPosEvent
188 tools::Long mnX; // Cursor-X-Position to upper left corner of frame
189 tools::Long mnY; // Cursor-Y-Position to upper left corner of frame
190 tools::Long mnWidth; // Cursor-Width in Pixel
191 tools::Long mnHeight; // Cursor-Height in Pixel
192 tools::Long mnExtWidth; // Width of the PreEdit area
193 bool mbVertical; // true if in vertical mode
194 SalExtTextInputPosEvent()
195 : mnX(0)
196 , mnY(0)
197 , mnWidth(0)
198 , mnHeight(0)
199 , mnExtWidth(0)
200 , mbVertical(false)
205 struct SalInputContextChangeEvent
209 struct SalSurroundingTextRequestEvent
211 OUString maText; // Text
212 sal_uLong mnStart; // The beginning index of selected range
213 sal_uLong mnEnd; // The end index of selected range
216 struct SalSurroundingTextSelectionChangeEvent
218 sal_uLong mnStart; // The beginning index of selected range
219 sal_uLong mnEnd; // The end index of selected range
222 struct SalQueryCharPositionEvent
224 sal_uLong mnCharPos; // The index of character in a composition.
225 AbsoluteScreenPixelRectangle maCursorBound; // The cursor bounds corresponding to the character specified by mnCharPos - X
226 bool mbValid; // The data is valid or not.
227 bool mbVertical; // The text is vertical or not.
230 typedef bool (*SALFRAMEPROC)( vcl::Window* pInst, SalEvent nEvent, const void* pEvent );
232 enum class SalObjEvent {
233 GetFocus = 1,
234 LoseFocus = 2,
235 ToTop = 3
238 struct SalInputContext
240 rtl::Reference<LogicalFontInstance> mpFont;
241 InputContextFlags mnOptions;
244 struct SalGestureSwipeEvent
246 double mnVelocityX;
247 double mnVelocityY;
248 tools::Long mnX;
249 tools::Long mnY;
252 struct SalGestureLongPressEvent
254 tools::Long mnX;
255 tools::Long mnY;
258 struct SalGestureEvent
260 GestureEventPanType meEventType;
261 PanningOrientation meOrientation;
262 double mfOffset;
263 tools::Long mnX;
264 tools::Long mnY;
267 struct SalGestureZoomEvent
269 GestureEventZoomType meEventType = GestureEventZoomType::Begin;
270 tools::Long mnX = 0;
271 tools::Long mnY = 0;
272 double mfScaleDelta = 0;
275 struct SalGestureRotateEvent
277 GestureEventRotateType meEventType = GestureEventRotateType::Begin;
278 tools::Long mnX = 0;
279 tools::Long mnY = 0;
280 double mfAngleDelta = 0;
283 typedef void (*SALTIMERPROC)();
285 #endif // INCLUDED_VCL_INC_SALWTYPE_HXX
287 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */