LibreOffice Module vcl (master)  1
salwtype.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_VCL_INC_SALWTYPE_HXX
21 #define INCLUDED_VCL_INC_SALWTYPE_HXX
22 
23 #include <i18nlangtag/lang.h>
24 #include <rtl/ref.hxx>
25 #include <rtl/ustring.hxx>
26 #include <tools/solar.h>
27 #include <vcl/GestureEvent.hxx>
28 
30 class SalGraphics;
31 class SalFrame;
32 class SalObject;
33 namespace vcl { class Window; }
34 enum class InputContextFlags;
35 enum class WindowStateMask;
36 enum class WindowStateState;
37 enum class ExtTextInputAttr;
38 enum class ModKeyFlags;
39 
40 enum class SalEvent {
41  NONE,
42  MouseMove,
43  MouseLeave,
46  KeyInput,
47  KeyUp,
49  Paint,
50  Resize,
51  GetFocus,
52  LoseFocus,
53  Close,
54  Shutdown,
59  WheelMouse,
60  UserEvent,
66  Move,
67  MoveResize,
79  ShowDialog,
85  Swipe,
86  LongPress,
88  Gesture,
89 };
90 
91 // MOUSELEAVE must send, when the pointer leave the client area and
92 // the mouse is not captured
93 // MOUSEMOVE, MOUSELEAVE, MOUSEBUTTONDOWN and MOUSEBUTTONUP
94 // MAC: Ctrl+Button is MOUSE_RIGHT
96 {
97  sal_uInt64 mnTime; // Time in ms, when event is created
98  long mnX; // X-Position (Pixel, TopLeft-Output)
99  long mnY; // Y-Position (Pixel, TopLeft-Output)
100  sal_uInt16 mnButton; // 0-MouseMove/MouseLeave, MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE
101  sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2|MOUSE_LEFT|MOUSE_MIDDLE|MOUSE_RIGHT)
102 };
103 
104 // KEYINPUT and KEYUP
106 {
107  sal_uInt16 mnCode; // SV-KeyCode (KEY_xxx | KEY_SHIFT | KEY_MOD1 | KEY_MOD2)
108  sal_uInt16 mnCharCode; // SV-CharCode
109  sal_uInt16 mnRepeat; // Repeat-Count (KeyInputs-1)
110 };
111 
112 // MENUEVENT
114 {
115  sal_uInt16 mnId; // Menu item ID
116  void* mpMenu; // pointer to VCL menu (class Menu)
117 
118  SalMenuEvent() : mnId( 0 ), mpMenu( nullptr ) {}
119  SalMenuEvent( sal_uInt16 i_nId, void* i_pMenu )
120  : mnId( i_nId ), mpMenu( i_pMenu ) {}
121 };
122 
123 // KEYMODCHANGE
125 {
126  bool mbDown; // Whether the change occurred on a key down event
127  sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2)
128  ModKeyFlags mnModKeyCode; // extended Modifier (MODKEY_LEFT,MODKEY_RIGHT,MODKEY_PRESS,MODKEY_RELEASE)
129 };
130 
132 {
133  long mnBoundX; // BoundRect - X
134  long mnBoundY; // BoundRect - Y
135  long mnBoundWidth; // BoundRect - Width
136  long mnBoundHeight; // BoundRect - Height
137  bool mbImmediateUpdate; // set to true to force an immediate update
138 
139  SalPaintEvent( long x, long y, long w, long h, bool bImmediate = false ) :
140  mnBoundX( x ), mnBoundY( y ),
141  mnBoundWidth( w ), mnBoundHeight( h ),
142  mbImmediateUpdate( bImmediate )
143  {}
144 };
145 
146 #define SAL_WHEELMOUSE_EVENT_PAGESCROLL (sal_uLong(0xFFFFFFFF))
148 {
149  sal_uInt64 mnTime; // Time in ms, when event is created
150  long mnX; // X-Position (Pixel, TopLeft-Output)
151  long mnY; // Y-Position (Pixel, TopLeft-Output)
152  long mnDelta; // Number of rotations
153  long mnNotchDelta; // Number of fixed rotations
154  double mnScrollLines; // Actual number of lines to scroll
155  sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2|MOUSE_LEFT|MOUSE_MIDDLE|MOUSE_RIGHT)
156  bool mbHorz; // Horizontal
157  bool mbDeltaIsPixel; // delta value is a pixel value (on touch devices)
158 
160  : mnTime( 0 ), mnX( 0 ), mnY( 0 ), mnDelta( 0 ), mnNotchDelta( 0 ), mnScrollLines( 0 ), mnCode( 0 ), mbHorz( false ), mbDeltaIsPixel( false )
161  {}
162 };
163 
165 {
166  OUString maText; // Text
167  const ExtTextInputAttr* mpTextAttr; // Text-Attribute
168  sal_Int32 mnCursorPos; // Cursor-Position
169  sal_uInt8 mnCursorFlags; // EXTTEXTINPUT_CURSOR_xxx
170 };
171 
173 {
174  long mnX; // Cursor-X-Position to upper left corner of frame
175  long mnY; // Cursor-Y-Position to upper left corner of frame
176  long mnWidth; // Cursor-Width in Pixel
177  long mnHeight; // Cursor-Height in Pixel
178  long mnExtWidth; // Width of the PreEdit area
179  bool mbVertical; // true if in vertical mode
181  : mnX(0)
182  , mnY(0)
183  , mnWidth(0)
184  , mnHeight(0)
185  , mnExtWidth(0)
186  , mbVertical(false)
187  {
188  }
189 };
190 
192 {
193 };
194 
196 {
197  OUString maText; // Text
198  sal_uLong mnStart; // The beginning index of selected range
199  sal_uLong mnEnd; // The end index of selected range
200 };
201 
203 {
204  sal_uLong const mnStart; // The beginning index of selected range
205  sal_uLong const mnEnd; // The end index of selected range
206 };
207 
209 {
210  bool mbValid; // The data is valid or not.
211  sal_uLong mnCharPos; // The index of character in a composition.
212  bool mbVertical; // The text is vertical or not.
213  long mnCursorBoundX; // The cursor bounds corresponding to the character specified by mnCharPos - X
214  long mnCursorBoundY; // The cursor bounds corresponding to the character specified by mnCharPos - Y
215  long mnCursorBoundWidth; // The cursor bounds corresponding to the character specified by mnCharPos - Width
216  long mnCursorBoundHeight; // The cursor bounds corresponding to the character specified by mnCharPos - Height
217 };
218 
219 typedef bool (*SALFRAMEPROC)( vcl::Window* pInst, SalEvent nEvent, const void* pEvent );
220 
221 enum class SalObjEvent {
222  GetFocus = 1,
223  LoseFocus = 2,
224  ToTop = 3
225 };
226 
228 {
230  long mnX;
231  long mnY;
232  long mnWidth;
233  long mnHeight;
239 };
240 
242 {
245 };
246 
248 {
249  double mnVelocityX;
250  double mnVelocityY;
251  long mnX;
252  long mnY;
253 };
254 
256 {
257  long mnX;
258  long mnY;
259 };
260 
262 {
265  double mfOffset;
266  long mnX;
267  long mnY;
268 };
269 
270 typedef void (*SALTIMERPROC)();
271 
272 #endif // INCLUDED_VCL_INC_SALWTYPE_HXX
273 
274 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
WindowStateState mnState
Definition: salwtype.hxx:238
sal_uIntPtr sal_uLong
sal_uInt16 mnButton
Definition: salwtype.hxx:100
ModKeyFlags
Definition: keycodes.hxx:163
double mnVelocityY
Definition: salwtype.hxx:250
sal_uInt16 mnCode
Definition: salwtype.hxx:127
long mnBoundWidth
Definition: salwtype.hxx:135
sal_uInt16 mnCode
Definition: salwtype.hxx:107
GestureEventType meEventType
Definition: salwtype.hxx:263
bool mbImmediateUpdate
Definition: salwtype.hxx:137
WindowStateMask
Definition: vclenum.hxx:123
SalObjEvent
Definition: salwtype.hxx:221
sal_Int32 mnCursorPos
Definition: salwtype.hxx:168
rtl::Reference< LogicalFontInstance > mpFont
Definition: salwtype.hxx:243
sal_uInt64 mnTime
Definition: salwtype.hxx:97
InputContextFlags mnOptions
Definition: salwtype.hxx:244
sal_uInt16 mnCharCode
Definition: salwtype.hxx:108
GestureEventType
SalEvent
Definition: salwtype.hxx:40
long mnBoundHeight
Definition: salwtype.hxx:136
sal_uInt16 mnCode
Definition: salwtype.hxx:155
long mnMaximizedY
Definition: salwtype.hxx:235
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
void(* SALTIMERPROC)()
Definition: salwtype.hxx:270
sal_uInt16 mnCode
Definition: salwtype.hxx:101
unsigned char sal_uInt8
sal_uInt64 mnTime
Definition: salwtype.hxx:149
SalMenuEvent(sal_uInt16 i_nId, void *i_pMenu)
Definition: salwtype.hxx:119
PanningOrientation
long mnMaximizedX
Definition: salwtype.hxx:234
PanningOrientation meOrientation
Definition: salwtype.hxx:264
SalPaintEvent(long x, long y, long w, long h, bool bImmediate=false)
Definition: salwtype.hxx:139
sal_uInt16 mnId
Definition: salwtype.hxx:115
sal_uInt16 mnRepeat
Definition: salwtype.hxx:109
sal_uInt8 mnCursorFlags
Definition: salwtype.hxx:169
ExtTextInputAttr
WindowStateState
Definition: vclenum.hxx:301
ModKeyFlags mnModKeyCode
Definition: salwtype.hxx:128
bool(* SALFRAMEPROC)(vcl::Window *pInst, SalEvent nEvent, const void *pEvent)
Definition: salwtype.hxx:219
long mnMaximizedWidth
Definition: salwtype.hxx:236
WindowStateMask mnMask
Definition: salwtype.hxx:229
void * mpMenu
Definition: salwtype.hxx:116
const ExtTextInputAttr * mpTextAttr
Definition: salwtype.hxx:167
InputContextFlags
Definition: inputctx.hxx:28
double mnVelocityX
Definition: salwtype.hxx:249
long mnMaximizedHeight
Definition: salwtype.hxx:237
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo