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 <tools/long.hxx>
28 #include <vcl/GestureEvent.hxx>
29 
31 class SalGraphics;
32 class SalFrame;
33 class SalObject;
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;
40 
41 enum class SalEvent {
42  NONE,
43  MouseMove,
44  MouseLeave,
47  KeyInput,
48  KeyUp,
50  Paint,
51  Resize,
52  GetFocus,
53  LoseFocus,
54  Close,
55  Shutdown,
60  WheelMouse,
61  UserEvent,
67  Move,
68  MoveResize,
80  ShowDialog,
87  Swipe,
88  LongPress,
90  Gesture,
91 };
92 
94 {
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)
99 
100 protected:
101  SalAbstractMouseEvent() : mnTime(0), mnX(0), mnY(0), mnCode(0) {}
102 };
103 
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
109 {
110  sal_uInt16 mnButton; // 0-MouseMove/MouseLeave, MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE
111 
112  SalMouseEvent() : mnButton(0) {}
113 };
114 
115 // KEYINPUT and KEYUP
117 {
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)
121 };
122 
123 // MENUEVENT
125 {
126  sal_uInt16 mnId; // Menu item ID
127  void* mpMenu; // pointer to VCL menu (class Menu)
128 
129  SalMenuEvent() : mnId( 0 ), mpMenu( nullptr ) {}
130  SalMenuEvent( sal_uInt16 i_nId, void* i_pMenu )
131  : mnId( i_nId ), mpMenu( i_pMenu ) {}
132 };
133 
134 // KEYMODCHANGE
136 {
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)
140 };
141 
143 {
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
149 
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 )
154  {}
155 };
156 
157 #define SAL_WHEELMOUSE_EVENT_PAGESCROLL (sal_uLong(0xFFFFFFFF))
159 {
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)
165 
167  : mnDelta(0), mnNotchDelta(0), mnScrollLines(0), mbHorz(false), mbDeltaIsPixel(false)
168  {}
169 };
170 
172 {
173  OUString maText; // Text
174  const ExtTextInputAttr* mpTextAttr; // Text-Attribute
175  sal_Int32 mnCursorPos; // Cursor-Position
176  sal_uInt8 mnCursorFlags; // EXTTEXTINPUT_CURSOR_xxx
177 };
178 
180 {
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
188  : mnX(0)
189  , mnY(0)
190  , mnWidth(0)
191  , mnHeight(0)
192  , mnExtWidth(0)
193  , mbVertical(false)
194  {
195  }
196 };
197 
199 {
200 };
201 
203 {
204  OUString maText; // Text
205  sal_uLong mnStart; // The beginning index of selected range
206  sal_uLong mnEnd; // The end index of selected range
207 };
208 
210 {
211  sal_uLong mnStart; // The beginning index of selected range
212  sal_uLong mnEnd; // The end index of selected range
213 };
214 
216 {
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
224 };
225 
226 typedef bool (*SALFRAMEPROC)( vcl::Window* pInst, SalEvent nEvent, const void* pEvent );
227 
228 enum class SalObjEvent {
229  GetFocus = 1,
230  LoseFocus = 2,
231  ToTop = 3
232 };
233 
235 {
246 };
247 
249 {
252 };
253 
255 {
256  double mnVelocityX;
257  double mnVelocityY;
260 };
261 
263 {
266 };
267 
269 {
272  double mfOffset;
275 };
276 
277 typedef void (*SALTIMERPROC)();
278 
279 #endif // INCLUDED_VCL_INC_SALWTYPE_HXX
280 
281 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools::Long mnBoundY
Definition: salwtype.hxx:145
SalPaintEvent(tools::Long x, tools::Long y, tools::Long w, tools::Long h, bool bImmediate=false)
Definition: salwtype.hxx:150
WindowStateState mnState
Definition: salwtype.hxx:245
tools::Long mnY
Definition: salwtype.hxx:259
tools::Long mnMaximizedHeight
Definition: salwtype.hxx:244
sal_uIntPtr sal_uLong
long Long
tools::Long mnBoundHeight
Definition: salwtype.hxx:147
sal_uInt16 mnButton
Definition: salwtype.hxx:110
ModKeyFlags
Definition: keycodes.hxx:163
double mnVelocityY
Definition: salwtype.hxx:257
sal_uInt16 mnCode
Definition: salwtype.hxx:138
sal_uInt16 mnCode
Definition: salwtype.hxx:118
GestureEventType meEventType
Definition: salwtype.hxx:270
bool mbImmediateUpdate
Definition: salwtype.hxx:148
WindowStateMask
Definition: vclenum.hxx:123
tools::Long mnY
Definition: salwtype.hxx:274
tools::Long mnMaximizedX
Definition: salwtype.hxx:241
tools::Long mnExtWidth
Definition: salwtype.hxx:185
SalObjEvent
Definition: salwtype.hxx:228
tools::Long mnWidth
Definition: salwtype.hxx:239
tools::Long mnBoundWidth
Definition: salwtype.hxx:146
tools::Long mnCursorBoundWidth
Definition: salwtype.hxx:222
tools::Long mnY
Definition: salwtype.hxx:265
sal_Int32 mnCursorPos
Definition: salwtype.hxx:175
tools::Long mnMaximizedWidth
Definition: salwtype.hxx:243
tools::Long mnCursorBoundHeight
Definition: salwtype.hxx:223
tools::Long mnDelta
Definition: salwtype.hxx:160
rtl::Reference< LogicalFontInstance > mpFont
Definition: salwtype.hxx:250
tools::Long mnBoundX
Definition: salwtype.hxx:144
InputContextFlags mnOptions
Definition: salwtype.hxx:251
sal_uInt16 mnCharCode
Definition: salwtype.hxx:119
GestureEventType
tools::Long mnHeight
Definition: salwtype.hxx:240
SalEvent
Definition: salwtype.hxx:41
tools::Long mnX
Definition: salwtype.hxx:258
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
void(* SALTIMERPROC)()
Definition: salwtype.hxx:277
unsigned char sal_uInt8
SalMenuEvent(sal_uInt16 i_nId, void *i_pMenu)
Definition: salwtype.hxx:130
tools::Long mnX
Definition: salwtype.hxx:264
PanningOrientation
tools::Long mnCursorBoundY
Definition: salwtype.hxx:221
PanningOrientation meOrientation
Definition: salwtype.hxx:271
tools::Long mnNotchDelta
Definition: salwtype.hxx:161
sal_uInt16 mnId
Definition: salwtype.hxx:126
sal_uInt16 mnRepeat
Definition: salwtype.hxx:120
tools::Long mnMaximizedY
Definition: salwtype.hxx:242
sal_uInt8 mnCursorFlags
Definition: salwtype.hxx:176
tools::Long mnX
Definition: salwtype.hxx:237
tools::Long mnCursorBoundX
Definition: salwtype.hxx:220
tools::Long mnY
Definition: salwtype.hxx:238
ExtTextInputAttr
WindowStateState
Definition: vclenum.hxx:305
ModKeyFlags mnModKeyCode
Definition: salwtype.hxx:139
bool(* SALFRAMEPROC)(vcl::Window *pInst, SalEvent nEvent, const void *pEvent)
Definition: salwtype.hxx:226
WindowStateMask mnMask
Definition: salwtype.hxx:236
void * mpMenu
Definition: salwtype.hxx:127
const ExtTextInputAttr * mpTextAttr
Definition: salwtype.hxx:174
InputContextFlags
Definition: inputctx.hxx:28
tools::Long mnX
Definition: salwtype.hxx:273
double mnVelocityX
Definition: salwtype.hxx:256
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo