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 
92 {
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 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2|MOUSE_LEFT|MOUSE_MIDDLE|MOUSE_RIGHT)
97 
98 protected:
99  SalAbstractMouseEvent() : mnTime(0), mnX(0), mnY(0), mnCode(0) {}
100 };
101 
102 // MOUSELEAVE must send, when the pointer leave the client area and
103 // the mouse is not captured
104 // MOUSEMOVE, MOUSELEAVE, MOUSEBUTTONDOWN and MOUSEBUTTONUP
105 // MAC: Ctrl+Button is MOUSE_RIGHT
107 {
108  sal_uInt16 mnButton; // 0-MouseMove/MouseLeave, MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE
109 
110  SalMouseEvent() : mnButton(0) {}
111 };
112 
113 // KEYINPUT and KEYUP
115 {
116  sal_uInt16 mnCode; // SV-KeyCode (KEY_xxx | KEY_SHIFT | KEY_MOD1 | KEY_MOD2)
117  sal_uInt16 mnCharCode; // SV-CharCode
118  sal_uInt16 mnRepeat; // Repeat-Count (KeyInputs-1)
119 };
120 
121 // MENUEVENT
123 {
124  sal_uInt16 mnId; // Menu item ID
125  void* mpMenu; // pointer to VCL menu (class Menu)
126 
127  SalMenuEvent() : mnId( 0 ), mpMenu( nullptr ) {}
128  SalMenuEvent( sal_uInt16 i_nId, void* i_pMenu )
129  : mnId( i_nId ), mpMenu( i_pMenu ) {}
130 };
131 
132 // KEYMODCHANGE
134 {
135  bool mbDown; // Whether the change occurred on a key down event
136  sal_uInt16 mnCode; // SV-Modifiercode (KEY_SHIFT|KEY_MOD1|KEY_MOD2)
137  ModKeyFlags mnModKeyCode; // extended Modifier (MODKEY_LEFT,MODKEY_RIGHT,MODKEY_PRESS,MODKEY_RELEASE)
138 };
139 
141 {
142  long mnBoundX; // BoundRect - X
143  long mnBoundY; // BoundRect - Y
144  long mnBoundWidth; // BoundRect - Width
145  long mnBoundHeight; // BoundRect - Height
146  bool mbImmediateUpdate; // set to true to force an immediate update
147 
148  SalPaintEvent( long x, long y, long w, long h, bool bImmediate = false ) :
149  mnBoundX( x ), mnBoundY( y ),
150  mnBoundWidth( w ), mnBoundHeight( h ),
151  mbImmediateUpdate( bImmediate )
152  {}
153 };
154 
155 #define SAL_WHEELMOUSE_EVENT_PAGESCROLL (sal_uLong(0xFFFFFFFF))
157 {
158  long mnDelta; // Number of rotations
159  long mnNotchDelta; // Number of fixed rotations
160  double mnScrollLines; // Actual number of lines to scroll
161  bool mbHorz; // Horizontal
162  bool mbDeltaIsPixel; // delta value is a pixel value (on touch devices)
163 
165  : mnDelta(0), mnNotchDelta(0), mnScrollLines(0), mbHorz(false), mbDeltaIsPixel(false)
166  {}
167 };
168 
170 {
171  OUString maText; // Text
172  const ExtTextInputAttr* mpTextAttr; // Text-Attribute
173  sal_Int32 mnCursorPos; // Cursor-Position
174  sal_uInt8 mnCursorFlags; // EXTTEXTINPUT_CURSOR_xxx
175 };
176 
178 {
179  long mnX; // Cursor-X-Position to upper left corner of frame
180  long mnY; // Cursor-Y-Position to upper left corner of frame
181  long mnWidth; // Cursor-Width in Pixel
182  long mnHeight; // Cursor-Height in Pixel
183  long mnExtWidth; // Width of the PreEdit area
184  bool mbVertical; // true if in vertical mode
186  : mnX(0)
187  , mnY(0)
188  , mnWidth(0)
189  , mnHeight(0)
190  , mnExtWidth(0)
191  , mbVertical(false)
192  {
193  }
194 };
195 
197 {
198 };
199 
201 {
202  OUString maText; // Text
203  sal_uLong mnStart; // The beginning index of selected range
204  sal_uLong mnEnd; // The end index of selected range
205 };
206 
208 {
209  sal_uLong mnStart; // The beginning index of selected range
210  sal_uLong mnEnd; // The end index of selected range
211 };
212 
214 {
215  bool mbValid; // The data is valid or not.
216  sal_uLong mnCharPos; // The index of character in a composition.
217  bool mbVertical; // The text is vertical or not.
218  long mnCursorBoundX; // The cursor bounds corresponding to the character specified by mnCharPos - X
219  long mnCursorBoundY; // The cursor bounds corresponding to the character specified by mnCharPos - Y
220  long mnCursorBoundWidth; // The cursor bounds corresponding to the character specified by mnCharPos - Width
221  long mnCursorBoundHeight; // The cursor bounds corresponding to the character specified by mnCharPos - Height
222 };
223 
224 typedef bool (*SALFRAMEPROC)( vcl::Window* pInst, SalEvent nEvent, const void* pEvent );
225 
226 enum class SalObjEvent {
227  GetFocus = 1,
228  LoseFocus = 2,
229  ToTop = 3
230 };
231 
233 {
235  long mnX;
236  long mnY;
237  long mnWidth;
238  long mnHeight;
244 };
245 
247 {
250 };
251 
253 {
254  double mnVelocityX;
255  double mnVelocityY;
256  long mnX;
257  long mnY;
258 };
259 
261 {
262  long mnX;
263  long mnY;
264 };
265 
267 {
270  double mfOffset;
271  long mnX;
272  long mnY;
273 };
274 
275 typedef void (*SALTIMERPROC)();
276 
277 #endif // INCLUDED_VCL_INC_SALWTYPE_HXX
278 
279 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
WindowStateState mnState
Definition: salwtype.hxx:243
sal_uIntPtr sal_uLong
sal_uInt16 mnButton
Definition: salwtype.hxx:108
ModKeyFlags
Definition: keycodes.hxx:163
double mnVelocityY
Definition: salwtype.hxx:255
sal_uInt16 mnCode
Definition: salwtype.hxx:136
long mnBoundWidth
Definition: salwtype.hxx:144
sal_uInt16 mnCode
Definition: salwtype.hxx:116
GestureEventType meEventType
Definition: salwtype.hxx:268
bool mbImmediateUpdate
Definition: salwtype.hxx:146
WindowStateMask
Definition: vclenum.hxx:123
SalObjEvent
Definition: salwtype.hxx:226
sal_Int32 mnCursorPos
Definition: salwtype.hxx:173
rtl::Reference< LogicalFontInstance > mpFont
Definition: salwtype.hxx:248
InputContextFlags mnOptions
Definition: salwtype.hxx:249
sal_uInt16 mnCharCode
Definition: salwtype.hxx:117
GestureEventType
SalEvent
Definition: salwtype.hxx:40
long mnBoundHeight
Definition: salwtype.hxx:145
long mnMaximizedY
Definition: salwtype.hxx:240
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
void(* SALTIMERPROC)()
Definition: salwtype.hxx:275
unsigned char sal_uInt8
SalMenuEvent(sal_uInt16 i_nId, void *i_pMenu)
Definition: salwtype.hxx:128
PanningOrientation
long mnMaximizedX
Definition: salwtype.hxx:239
PanningOrientation meOrientation
Definition: salwtype.hxx:269
SalPaintEvent(long x, long y, long w, long h, bool bImmediate=false)
Definition: salwtype.hxx:148
sal_uInt16 mnId
Definition: salwtype.hxx:124
sal_uInt16 mnRepeat
Definition: salwtype.hxx:118
sal_uInt8 mnCursorFlags
Definition: salwtype.hxx:174
ExtTextInputAttr
WindowStateState
Definition: vclenum.hxx:304
ModKeyFlags mnModKeyCode
Definition: salwtype.hxx:137
bool(* SALFRAMEPROC)(vcl::Window *pInst, SalEvent nEvent, const void *pEvent)
Definition: salwtype.hxx:224
long mnMaximizedWidth
Definition: salwtype.hxx:241
WindowStateMask mnMask
Definition: salwtype.hxx:234
void * mpMenu
Definition: salwtype.hxx:125
const ExtTextInputAttr * mpTextAttr
Definition: salwtype.hxx:172
InputContextFlags
Definition: inputctx.hxx:28
double mnVelocityX
Definition: salwtype.hxx:254
long mnMaximizedHeight
Definition: salwtype.hxx:242
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo