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/ustring.hxx>
25 #include <tools/solar.h>
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
;
74 ExternalMouseButtonDown
,
75 ExternalMouseButtonUp
,
79 SurroundingTextRequest
,
80 SurroundingTextSelectionChange
,
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
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
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)
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
) {}
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)
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)
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()
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
{
226 typedef long (*SALOBJECTPROC
)( void* pInst
, SalObjEvent nEvent
);
230 WindowStateMask mnMask
;
237 long mnMaximizedWidth
;
238 long mnMaximizedHeight
;
239 WindowStateState mnState
;
242 struct SalInputContext
244 FontSelectPattern
* mpFont
;
245 LanguageType meLanguage
;
246 InputContextFlags mnOptions
;
257 struct SalLongPressEvent
263 typedef void (*SALTIMERPROC
)( bool idle
);
265 #endif // INCLUDED_VCL_INC_SALWTYPE_HXX
267 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */