1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _SV_SALWTYPE_HXX 25 #define _SV_SALWTYPE_HXX 26 27 #include <i18npool/lang.h> 28 #include <tools/string.hxx> 29 #include <vcl/sv.h> 30 31 class SalGraphics; 32 class SalFrame; 33 class SalObject; 34 class Window; 35 36 class ImplFontSelectData; 37 38 // --------------- 39 // - SalExtInput - 40 // --------------- 41 42 // Muessen mit den Defines in cmdevt.hxx uebereinstimmen, da diese 43 // nicht konvertiert werden 44 #define SAL_EXTTEXTINPUT_ATTR_GRAYWAVELINE ((sal_uInt16)0x0100) 45 #define SAL_EXTTEXTINPUT_ATTR_UNDERLINE ((sal_uInt16)0x0200) 46 #define SAL_EXTTEXTINPUT_ATTR_BOLDUNDERLINE ((sal_uInt16)0x0400) 47 #define SAL_EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE ((sal_uInt16)0x0800) 48 #define SAL_EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE ((sal_uInt16)0x1000) 49 #define SAL_EXTTEXTINPUT_ATTR_HIGHLIGHT ((sal_uInt16)0x2000) 50 #define SAL_EXTTEXTINPUT_ATTR_REDTEXT ((sal_uInt16)0x4000) 51 #define SAL_EXTTEXTINPUT_ATTR_HALFTONETEXT ((sal_uInt16)0x8000) 52 53 #define SAL_EXTTEXTINPUT_CURSOR_INVISIBLE ((sal_uInt16)0x0001) 54 #define SAL_EXTTEXTINPUT_CURSOR_OVERWRITE ((sal_uInt16)0x0002) 55 56 // ------------ 57 // - SalEvent - 58 // ------------ 59 60 #define SALEVENT_MOUSEMOVE ((sal_uInt16)1) 61 #define SALEVENT_MOUSELEAVE ((sal_uInt16)2) 62 #define SALEVENT_MOUSEBUTTONDOWN ((sal_uInt16)3) 63 #define SALEVENT_MOUSEBUTTONUP ((sal_uInt16)4) 64 #define SALEVENT_KEYINPUT ((sal_uInt16)5) 65 #define SALEVENT_KEYUP ((sal_uInt16)6) 66 #define SALEVENT_KEYMODCHANGE ((sal_uInt16)7) 67 #define SALEVENT_PAINT ((sal_uInt16)8) 68 #define SALEVENT_RESIZE ((sal_uInt16)9) 69 #define SALEVENT_GETFOCUS ((sal_uInt16)10) 70 #define SALEVENT_LOSEFOCUS ((sal_uInt16)11) 71 #define SALEVENT_CLOSE ((sal_uInt16)12) 72 #define SALEVENT_SHUTDOWN ((sal_uInt16)13) 73 #define SALEVENT_SETTINGSCHANGED ((sal_uInt16)14) 74 #define SALEVENT_VOLUMECHANGED ((sal_uInt16)15) 75 #define SALEVENT_PRINTERCHANGED ((sal_uInt16)16) 76 #define SALEVENT_DISPLAYCHANGED ((sal_uInt16)17) 77 #define SALEVENT_FONTCHANGED ((sal_uInt16)18) 78 #define SALEVENT_DATETIMECHANGED ((sal_uInt16)19) 79 #define SALEVENT_KEYBOARDCHANGED ((sal_uInt16)20) 80 #define SALEVENT_WHEELMOUSE ((sal_uInt16)21) 81 #define SALEVENT_USEREVENT ((sal_uInt16)22) 82 #define SALEVENT_MOUSEACTIVATE ((sal_uInt16)23) 83 #define SALEVENT_EXTTEXTINPUT ((sal_uInt16)24) 84 #define SALEVENT_ENDEXTTEXTINPUT ((sal_uInt16)25) 85 #define SALEVENT_EXTTEXTINPUTPOS ((sal_uInt16)26) 86 #define SALEVENT_INPUTCONTEXTCHANGE ((sal_uInt16)27) 87 #define SALEVENT_MOVE ((sal_uInt16)28) 88 #define SALEVENT_MOVERESIZE ((sal_uInt16)29) 89 #define SALEVENT_CLOSEPOPUPS ((sal_uInt16)30) 90 #define SALEVENT_EXTERNALKEYINPUT ((sal_uInt16)31) 91 #define SALEVENT_EXTERNALKEYUP ((sal_uInt16)32) 92 #define SALEVENT_MENUCOMMAND ((sal_uInt16)33) 93 #define SALEVENT_MENUHIGHLIGHT ((sal_uInt16)34) 94 #define SALEVENT_MENUACTIVATE ((sal_uInt16)35) 95 #define SALEVENT_MENUDEACTIVATE ((sal_uInt16)36) 96 #define SALEVENT_EXTERNALMOUSEMOVE ((sal_uInt16)37) 97 #define SALEVENT_EXTERNALMOUSEBUTTONDOWN ((sal_uInt16)38) 98 #define SALEVENT_EXTERNALMOUSEBUTTONUP ((sal_uInt16)39) 99 #define SALEVENT_INPUTLANGUAGECHANGE ((sal_uInt16)40) 100 #define SALEVENT_SHOWDIALOG ((sal_uInt16)41) 101 #define SALEVENT_MENUBUTTONCOMMAND ((sal_uInt16)42) 102 #define SALEVENT_SURROUNDINGTEXTREQUEST ((sal_uInt16)43) 103 #define SALEVENT_SURROUNDINGTEXTSELECTIONCHANGE ((sal_uInt16)44) 104 #define SALEVENT_STARTRECONVERSION ((sal_uInt16)45) 105 #define SALEVENT_COUNT ((sal_uInt16)45) 106 107 // MOUSELEAVE must send, when the pointer leave the client area and 108 // the mouse is not captured 109 // MOUSEMOVE, MOUSELEAVE, MOUSEBUTTONDOWN and MOUSEBUTTONUP 110 // MAC: Ctrl+Button is MOUSE_RIGHT 111 struct SalMouseEvent 112 { 113 sal_uLong mnTime; // Time in ms, when event is created 114 long mnX; // X-Position (Pixel, TopLeft-Output) 115 long mnY; // Y-Position (Pixel, TopLeft-Output) 116 sal_uInt16 mnButton; // 0-MouseMove/MouseLeave, MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE 117 sal_uInt16 mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT) 118 }; 119 120 // KEYINPUT and KEYUP 121 struct SalKeyEvent 122 { 123 sal_uLong mnTime; // Time in ms, when event is created 124 sal_uInt16 mnCode; // SV-KeyCode (KEY_xxx | KEY_SHIFT | KEY_MOD1 | KEY_MOD2) 125 sal_uInt16 mnCharCode; // SV-CharCode 126 sal_uInt16 mnRepeat; // Repeat-Count (KeyInputs-1) 127 }; 128 129 // MENUEVENT 130 struct SalMenuEvent 131 { 132 sal_uInt16 mnId; // Menu item ID 133 void* mpMenu; // pointer to VCL menu (class Menu) 134 SalMenuEventSalMenuEvent135 SalMenuEvent() : mnId( 0 ), mpMenu( NULL ) {} SalMenuEventSalMenuEvent136 SalMenuEvent( sal_uInt16 i_nId, void* i_pMenu ) 137 : mnId( i_nId ), mpMenu( i_pMenu ) {} 138 }; 139 140 // KEYMODCHANGE 141 struct SalKeyModEvent 142 { 143 sal_uLong mnTime; // Time in ms, when event is created 144 sal_uInt16 mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2) 145 sal_uInt16 mnModKeyCode; // extended Modifier (MODKEY_LEFT, MODKEY_RIGHT, MODKEY_PRESS, MODKEY_RELEASE) 146 }; 147 148 // PAINT 149 struct SalPaintEvent 150 { 151 long mnBoundX; // BoundRect - X 152 long mnBoundY; // BoundRect - Y 153 long mnBoundWidth; // BoundRect - Width 154 long mnBoundHeight; // BoundRect - Height 155 bool mbImmediateUpdate; // set to true to force an immediate update 156 SalPaintEventSalPaintEvent157 SalPaintEvent( long x, long y, long w, long h, bool bImmediate = false ) : 158 mnBoundX( x ), mnBoundY( y ), 159 mnBoundWidth( w ), mnBoundHeight( h ), 160 mbImmediateUpdate( bImmediate ) 161 {} 162 }; 163 164 // USEREVENT 165 // pEvent == pData 166 167 // WHEELMOUSE 168 #define SAL_WHEELMOUSE_EVENT_PAGESCROLL ((sal_uLong)0xFFFFFFFF) 169 struct SalWheelMouseEvent 170 { 171 sal_uLong mnTime; // Time in ms, when event is created 172 long mnX; // X-Position (Pixel, TopLeft-Output) 173 long mnY; // Y-Position (Pixel, TopLeft-Output) 174 long mnDelta; // Anzahl Drehungen 175 long mnNotchDelta; // Anzahl feste Drehungen 176 sal_uLong mnScrollLines; // Aktuelle Anzahl zu scrollende Zeilen 177 sal_uInt16 mnCode; // SV-ModifierCode (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT) 178 sal_Bool mbHorz; // Horizontal 179 sal_Bool mbDeltaIsPixel; // delta value is a pixel value (on mac) 180 SalWheelMouseEventSalWheelMouseEvent181 SalWheelMouseEvent() 182 : mnTime( 0 ), mnX( 0 ), mnY( 0 ), mnDelta( 0 ), mnNotchDelta( 0 ), mnScrollLines( 0 ), mnCode( 0 ), mbHorz( sal_False ), mbDeltaIsPixel( sal_False ) 183 {} 184 }; 185 186 // MOUSEACTIVATE 187 struct SalMouseActivateEvent 188 { 189 long mnX; // X-Position (Pixel, TopLeft-Output) 190 long mnY; // Y-Position (Pixel, TopLeft-Output) 191 }; 192 193 #ifdef __cplusplus 194 195 // EXTTEXTINPUT 196 struct SalExtTextInputEvent 197 { 198 sal_uLong mnTime; // Time in ms, when event is created 199 UniString maText; // Text 200 const sal_uInt16* mpTextAttr; // Text-Attribute 201 sal_uLong mnCursorPos; // Cursor-Position 202 sal_uLong mnDeltaStart; // Start-Position der letzten Aenderung 203 sal_uInt8 mnCursorFlags; // SAL_EXTTEXTINPUT_CURSOR_xxx 204 sal_Bool mbOnlyCursor; // sal_True: Nur Cursor-Position wurde geaendert 205 }; 206 207 #endif // __cplusplus 208 209 // EXTTEXTINPUTPOS 210 struct SalExtTextInputPosEvent 211 { 212 long mnX; // Cursor-X-Position to upper left corner of frame 213 long mnY; // Cursor-Y-Position to upper left corner of frame 214 long mnWidth; // Cursor-Width in Pixel 215 long mnHeight; // Cursor-Height in Pixel 216 long mnExtWidth; // Width of the PreEdit area 217 bool mbVertical; // true if in vertical mode 218 }; 219 220 #ifdef __cplusplus 221 222 // INPUTCONTEXTCHANGE 223 struct SalInputContextChangeEvent 224 { 225 LanguageType meLanguage; // Neue Sprache 226 }; 227 228 #endif // __cplusplus 229 230 #ifdef __cplusplus 231 232 // SURROUNDINGTEXTREQUEST 233 struct SalSurroundingTextRequestEvent 234 { 235 UniString maText; // Text 236 sal_uLong mnStart; // The beginning index of selected range 237 sal_uLong mnEnd; // The end index of selected range 238 }; 239 240 #endif // __cplusplus 241 242 #ifdef __cplusplus 243 244 // SURROUNDINGTEXTSELECTIONCHANGE 245 struct SalSurroundingTextSelectionChangeEvent 246 { 247 sal_uLong mnStart; // The beginning index of selected range 248 sal_uLong mnEnd; // The end index of selected range 249 }; 250 251 #endif // __cplusplus 252 253 // ------------------ 254 // - SalFrame-Types - 255 // ------------------ 256 257 typedef long (*SALFRAMEPROC)( Window* pInst, SalFrame* pFrame, 258 sal_uInt16 nEvent, const void* pEvent ); 259 260 // -------------------- 261 // - SalObject-Events - 262 // -------------------- 263 264 #define SALOBJ_EVENT_GETFOCUS ((sal_uInt16)1) 265 #define SALOBJ_EVENT_LOSEFOCUS ((sal_uInt16)2) 266 #define SALOBJ_EVENT_TOTOP ((sal_uInt16)3) 267 #define SALOBJ_EVENT_COUNT ((sal_uInt16)4) 268 269 // ------------------ 270 // - SalObject-Types - 271 // ------------------ 272 273 typedef long (*SALOBJECTPROC)( void* pInst, SalObject* pObject, 274 sal_uInt16 nEvent, const void* pEvent ); 275 276 // ----------------- 277 // - SalFrameState - 278 // ----------------- 279 280 // Must be the same as in syswin.hxx 281 #define SAL_FRAMESTATE_MASK_X ((sal_uLong)0x00000001) 282 #define SAL_FRAMESTATE_MASK_Y ((sal_uLong)0x00000002) 283 #define SAL_FRAMESTATE_MASK_WIDTH ((sal_uLong)0x00000004) 284 #define SAL_FRAMESTATE_MASK_HEIGHT ((sal_uLong)0x00000008) 285 #define SAL_FRAMESTATE_MASK_MAXIMIZED_X ((sal_uLong)0x00000100) 286 #define SAL_FRAMESTATE_MASK_MAXIMIZED_Y ((sal_uLong)0x00000200) 287 #define SAL_FRAMESTATE_MASK_MAXIMIZED_WIDTH ((sal_uLong)0x00000400) 288 #define SAL_FRAMESTATE_MASK_MAXIMIZED_HEIGHT ((sal_uLong)0x00000800) 289 #define SAL_FRAMESTATE_MASK_STATE ((sal_uLong)0x00000010) 290 291 #define SAL_FRAMESTATE_NORMAL ((sal_uLong)0x00000001) 292 #define SAL_FRAMESTATE_MINIMIZED ((sal_uLong)0x00000002) 293 #define SAL_FRAMESTATE_MAXIMIZED ((sal_uLong)0x00000004) 294 #define SAL_FRAMESTATE_ROLLUP ((sal_uLong)0x00000008) 295 #define SAL_FRAMESTATE_MAXIMIZED_HORZ ((sal_uLong)0x00000010) 296 #define SAL_FRAMESTATE_MAXIMIZED_VERT ((sal_uLong)0x00000020) 297 #define SAL_FRAMESTATE_SYSTEMMASK ((sal_uLong)0x0000FFFF) 298 299 struct SalFrameState 300 { 301 sal_uLong mnMask; 302 long mnX; 303 long mnY; 304 long mnWidth; 305 long mnHeight; 306 long mnMaximizedX; 307 long mnMaximizedY; 308 long mnMaximizedWidth; 309 long mnMaximizedHeight; 310 sal_uLong mnState; 311 }; 312 313 // ------------------- 314 // - SalInputContext - 315 // ------------------- 316 317 // Muessen mit den Defines in inputctx.hxx uebereinstimmen, da diese 318 // nicht konvertiert werden 319 #define SAL_INPUTCONTEXT_TEXT ((sal_uLong)0x00000001) 320 #define SAL_INPUTCONTEXT_EXTTEXTINPUT ((sal_uLong)0x00000002) 321 #define SAL_INPUTCONTEXT_EXTTEXTINPUT_ON ((sal_uLong)0x00000004) 322 #define SAL_INPUTCONTEXT_EXTTEXTINPUT_OFF ((sal_uLong)0x00000008) 323 #define SAL_INPUTCONTEXT_CHANGELANGUAGE ((sal_uLong)0x00000010) 324 325 #ifdef __cplusplus 326 327 struct SalInputContext 328 { 329 ImplFontSelectData* mpFont; 330 LanguageType meLanguage; 331 sal_uLong mnOptions; 332 }; 333 334 #endif // __cplusplus 335 336 // ------------------ 337 // - SalTimer-Types - 338 // ------------------ 339 340 typedef void (*SALTIMERPROC)(); 341 342 #endif // _SV_SALWTYPE_HXX 343