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 <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
;
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
;
77 ExternalMouseButtonDown
,
78 ExternalMouseButtonUp
,
82 SurroundingTextRequest
,
83 DeleteSurroundingTextRequest
,
84 SurroundingTextSelectionChange
,
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)
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
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)
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
) {}
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)
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)
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()
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
{
236 WindowStateMask mnMask
;
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
;
262 struct SalLongPressEvent
268 struct SalGestureEvent
270 GestureEventType meEventType
;
271 PanningOrientation meOrientation
;
277 typedef void (*SALTIMERPROC
)();
279 #endif // INCLUDED_VCL_INC_SALWTYPE_HXX
281 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */