1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
;
39 enum class WindowState
;
41 enum class InputContextFlags
;
42 enum class WindowStateMask
;
43 enum class ExtTextInputAttr
;
44 enum class ModKeyFlags
;
82 ExternalMouseButtonDown
,
83 ExternalMouseButtonUp
,
87 SurroundingTextRequest
,
88 DeleteSurroundingTextRequest
,
89 SurroundingTextSelectionChange
,
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)
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
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)
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
) {}
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)
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)
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()
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
{
238 struct SalInputContext
240 rtl::Reference
<LogicalFontInstance
> mpFont
;
241 InputContextFlags mnOptions
;
244 struct SalGestureSwipeEvent
252 struct SalGestureLongPressEvent
258 struct SalGestureEvent
260 GestureEventPanType meEventType
;
261 PanningOrientation meOrientation
;
267 struct SalGestureZoomEvent
269 GestureEventZoomType meEventType
= GestureEventZoomType::Begin
;
272 double mfScaleDelta
= 0;
275 struct SalGestureRotateEvent
277 GestureEventRotateType meEventType
= GestureEventRotateType::Begin
;
280 double mfAngleDelta
= 0;
283 typedef void (*SALTIMERPROC
)();
285 #endif // INCLUDED_VCL_INC_SALWTYPE_HXX
287 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */