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_WINDOW_HXX 25 #define _SV_WINDOW_HXX 26 27 #include <vcl/sv.h> 28 #include <vcl/dllapi.h> 29 #include <vcl/outdev.hxx> 30 #include <tools/resid.hxx> 31 #ifndef _SV_POINTR_HXX 32 #include <vcl/pointr.hxx> 33 #endif 34 #include <tools/wintypes.hxx> 35 #ifndef _SV_APPTYPES_HXX 36 #include <vcl/apptypes.hxx> 37 #endif 38 #include <vcl/inputctx.hxx> 39 #include <vcl/vclevent.hxx> 40 // Only for compatibility - because many people outside haven't included event.hxx 41 #ifndef _VCL_EVENT_HXX 42 #include <vcl/event.hxx> 43 #endif 44 #include <vcl/region.hxx> 45 #include <vcl/salnativewidgets.hxx> 46 #include <rtl/ustring.hxx> 47 #include <cppuhelper/weakref.hxx> 48 #include <com/sun/star/uno/Reference.hxx> 49 #include <boost/shared_ptr.hpp> 50 51 class VirtualDevice; 52 struct ImplDelData; 53 struct ImplWinData; 54 struct ImplOverlapData; 55 struct ImplFrameData; 56 struct ImplCalcToTopData; 57 struct SystemEnvData; 58 struct SystemParentData; 59 class ImplBorderWindow; 60 class VirtualDevice; 61 class Timer; 62 class Cursor; 63 class DockingManager; 64 class ScrollBar; 65 class Bitmap; 66 class Image; 67 class MouseEvent; 68 class KeyEvent; 69 class CommandEvent; 70 class TrackingEvent; 71 class HelpEvent; 72 class DataChangedEvent; 73 class NotifyEvent; 74 class SystemWindow; 75 class SalFrame; 76 class SalObject; 77 class MenuFloatingWindow; 78 class UNOWindowData; 79 // Nur fuer ExecuteDrag: 80 struct IDataObject; 81 class VCLXWindow; 82 struct ImplAccessibleInfos; 83 84 namespace com { 85 namespace sun { 86 namespace star { 87 namespace accessibility { 88 class XAccessible; 89 }}}} 90 91 namespace com { 92 namespace sun { 93 namespace star { 94 namespace beans { 95 struct PropertyValue; 96 }}}} 97 98 namespace com { 99 namespace sun { 100 namespace star { 101 namespace rendering { 102 class XCanvas; 103 class XSpriteCanvas; 104 }}}} 105 106 namespace com { 107 namespace sun { 108 namespace star { 109 namespace awt { 110 class XWindowPeer; 111 class XWindow; 112 } 113 namespace uno { 114 class Any; 115 class XInterface; 116 } 117 namespace datatransfer { 118 namespace clipboard { 119 class XClipboard; 120 } 121 122 namespace dnd { 123 class XDragGestureRecognizer; 124 class XDragSource; 125 class XDropTarget; 126 } } } } } 127 128 namespace vcl { 129 struct ControlLayoutData; 130 class WindowArranger; 131 struct ExtWindowImpl; 132 } 133 134 namespace svt { class PopupWindowControllerImpl; } 135 136 // --------------- 137 // - WindowTypes - 138 // --------------- 139 140 // Type fuer GetWindow() 141 #define WINDOW_PARENT ((sal_uInt16)0) 142 #define WINDOW_FIRSTCHILD ((sal_uInt16)1) 143 #define WINDOW_LASTCHILD ((sal_uInt16)2) 144 #define WINDOW_PREV ((sal_uInt16)3) 145 #define WINDOW_NEXT ((sal_uInt16)4) 146 #define WINDOW_FIRSTOVERLAP ((sal_uInt16)5) 147 #define WINDOW_LASTOVERLAP ((sal_uInt16)6) 148 #define WINDOW_OVERLAP ((sal_uInt16)7) 149 #define WINDOW_PARENTOVERLAP ((sal_uInt16)8) 150 #define WINDOW_CLIENT ((sal_uInt16)9) 151 #define WINDOW_REALPARENT ((sal_uInt16)10) 152 #define WINDOW_FRAME ((sal_uInt16)11) 153 #define WINDOW_BORDER ((sal_uInt16)12) 154 #define WINDOW_FIRSTTOPWINDOWCHILD ((sal_uInt16)13) 155 #define WINDOW_LASTTOPWINDOWCHILD ((sal_uInt16)14) 156 #define WINDOW_PREVTOPWINDOWSIBLING ((sal_uInt16)15) 157 #define WINDOW_NEXTTOPWINDOWSIBLING ((sal_uInt16)16) 158 159 // Flags for SetPosSizePixel() 160 #define WINDOW_POSSIZE_X ((sal_uInt16)0x0001) 161 #define WINDOW_POSSIZE_Y ((sal_uInt16)0x0002) 162 #define WINDOW_POSSIZE_WIDTH ((sal_uInt16)0x0004) 163 #define WINDOW_POSSIZE_HEIGHT ((sal_uInt16)0x0008) 164 #define WINDOW_POSSIZE_POS (WINDOW_POSSIZE_X | WINDOW_POSSIZE_Y) 165 #define WINDOW_POSSIZE_SIZE (WINDOW_POSSIZE_WIDTH | WINDOW_POSSIZE_HEIGHT) 166 #define WINDOW_POSSIZE_POSSIZE (WINDOW_POSSIZE_POS | WINDOW_POSSIZE_SIZE) 167 #define WINDOW_POSSIZE_ALL (WINDOW_POSSIZE_POSSIZE) 168 #define WINDOW_POSSIZE_DROPDOWN ((sal_uInt16)0x0010) 169 170 // Flags for Show() 171 #define SHOW_NOPARENTUPDATE ((sal_uInt16)0x0001) 172 #define SHOW_NOFOCUSCHANGE ((sal_uInt16)0x0002) 173 #define SHOW_NOACTIVATE ((sal_uInt16)0x0004) 174 #define SHOW_FOREGROUNDTASK ((sal_uInt16)0x0008) 175 176 // Flags for SetZOrder() 177 #define WINDOW_ZORDER_BEFOR ((sal_uInt16)0x0001) 178 #define WINDOW_ZORDER_BEHIND ((sal_uInt16)0x0002) 179 #define WINDOW_ZORDER_FIRST ((sal_uInt16)0x0004) 180 #define WINDOW_ZORDER_LAST ((sal_uInt16)0x0008) 181 182 // Activate-Flags 183 #define ACTIVATE_MODE_GRABFOCUS ((sal_uInt16)0x0001) 184 185 // ToTop-Flags 186 #define TOTOP_RESTOREWHENMIN ((sal_uInt16)0x0001) 187 #define TOTOP_FOREGROUNDTASK ((sal_uInt16)0x0002) 188 #define TOTOP_NOGRABFOCUS ((sal_uInt16)0x0004) 189 //#if 0 // _SOLAR__PRIVATE // vcl internal only 190 #define TOTOP_GRABFOCUSONLY ((sal_uInt16)0x0008) 191 //#endif 192 193 // Flags for Invalidate 194 #define INVALIDATE_CHILDREN ((sal_uInt16)0x0001) 195 #define INVALIDATE_NOCHILDREN ((sal_uInt16)0x0002) 196 #define INVALIDATE_NOERASE ((sal_uInt16)0x0004) 197 #define INVALIDATE_UPDATE ((sal_uInt16)0x0008) 198 #define INVALIDATE_TRANSPARENT ((sal_uInt16)0x0010) 199 #define INVALIDATE_NOTRANSPARENT ((sal_uInt16)0x0020) 200 #define INVALIDATE_NOCLIPCHILDREN ((sal_uInt16)0x4000) 201 // Temporaer fuer Kompatibilitaet 202 #define INVALIDATE_BACKGROUND INVALIDATE_TRANSPARENT 203 204 // Flags for Validate 205 #define VALIDATE_CHILDREN ((sal_uInt16)0x0001) 206 #define VALIDATE_NOCHILDREN ((sal_uInt16)0x0002) 207 208 // Flags for Scroll 209 #define SCROLL_CLIP ((sal_uInt16)0x0001) 210 #define SCROLL_CHILDREN ((sal_uInt16)0x0002) 211 #define SCROLL_NOCHILDREN ((sal_uInt16)0x0004) 212 #define SCROLL_NOERASE ((sal_uInt16)0x0008) 213 #define SCROLL_NOINVALIDATE ((sal_uInt16)0x0010) 214 #define SCROLL_NOWINDOWINVALIDATE ((sal_uInt16)0x0020) 215 #define SCROLL_USECLIPREGION ((sal_uInt16)0x0040) 216 #define SCROLL_UPDATE ((sal_uInt16)0x0080) 217 218 // Flags for ParentClipMode 219 #define PARENTCLIPMODE_CLIP ((sal_uInt16)0x0001) 220 #define PARENTCLIPMODE_NOCLIP ((sal_uInt16)0x0002) 221 222 // Flags for Invert() 223 #define INVERT_HIGHLIGHT ((sal_uInt16)0x0001) 224 #define INVERT_50 ((sal_uInt16)0x0002) 225 226 // Flags for ShowTracking() 227 #define SHOWTRACK_SMALL ((sal_uInt16)0x0001) 228 #define SHOWTRACK_BIG ((sal_uInt16)0x0002) 229 #define SHOWTRACK_SPLIT ((sal_uInt16)0x0003) 230 #define SHOWTRACK_OBJECT ((sal_uInt16)0x0004) 231 #define SHOWTRACK_WINDOW ((sal_uInt16)0x1000) 232 #define SHOWTRACK_CLIP ((sal_uInt16)0x2000) 233 #define SHOWTRACK_STYLE ((sal_uInt16)0x000F) 234 235 // Flags for StartTracking() 236 #define STARTTRACK_KEYINPUT ((sal_uInt16)0x0001) 237 #define STARTTRACK_KEYMOD ((sal_uInt16)0x0002) 238 #define STARTTRACK_NOKEYCANCEL ((sal_uInt16)0x0004) 239 #define STARTTRACK_SCROLLREPEAT ((sal_uInt16)0x0008) 240 #define STARTTRACK_BUTTONREPEAT ((sal_uInt16)0x0010) 241 #define STARTTRACK_MOUSEBUTTONDOWN ((sal_uInt16)0x0020) 242 #define STARTTRACK_FOCUSCANCEL ((sal_uInt16)0x0040) 243 244 // Flags for StartAutoScroll() 245 #define AUTOSCROLL_VERT ((sal_uInt16)0x0001) 246 #define AUTOSCROLL_HORZ ((sal_uInt16)0x0002) 247 248 // Flags for StateChanged() 249 typedef sal_uInt16 StateChangedType; 250 #define STATE_CHANGE_INITSHOW ((StateChangedType)1) 251 #define STATE_CHANGE_VISIBLE ((StateChangedType)2) 252 #define STATE_CHANGE_UPDATEMODE ((StateChangedType)3) 253 #define STATE_CHANGE_ENABLE ((StateChangedType)4) 254 #define STATE_CHANGE_TEXT ((StateChangedType)5) 255 #define STATE_CHANGE_IMAGE ((StateChangedType)6) 256 #define STATE_CHANGE_DATA ((StateChangedType)7) 257 #define STATE_CHANGE_STATE ((StateChangedType)8) 258 #define STATE_CHANGE_STYLE ((StateChangedType)9) 259 #define STATE_CHANGE_ZOOM ((StateChangedType)10) 260 #define STATE_CHANGE_BORDER ((StateChangedType)11) 261 #define STATE_CHANGE_TRANSPARENT ((StateChangedType)12) 262 #define STATE_CHANGE_CONTROLFONT ((StateChangedType)13) 263 #define STATE_CHANGE_CONTROLFOREGROUND ((StateChangedType)14) 264 #define STATE_CHANGE_CONTROLBACKGROUND ((StateChangedType)15) 265 #define STATE_CHANGE_READONLY ((StateChangedType)16) 266 #define STATE_CHANGE_FORMAT ((StateChangedType)17) 267 #define STATE_CHANGE_EXTENDEDSTYLE ((StateChangedType)18) 268 #define STATE_CHANGE_MIRRORING ((StateChangedType)19) 269 #define STATE_CHANGE_CONTROL_FOCUS ((StateChangedType)20) 270 #define STATE_CHANGE_USER ((StateChangedType)10000) 271 272 // GetFocusFlags 273 #define GETFOCUS_TAB ((sal_uInt16)0x0001) 274 #define GETFOCUS_CURSOR ((sal_uInt16)0x0002) 275 #define GETFOCUS_MNEMONIC ((sal_uInt16)0x0004) 276 #define GETFOCUS_FORWARD ((sal_uInt16)0x0010) 277 #define GETFOCUS_BACKWARD ((sal_uInt16)0x0020) 278 #define GETFOCUS_AROUND ((sal_uInt16)0x0040) 279 #define GETFOCUS_UNIQUEMNEMONIC ((sal_uInt16)0x0100) 280 #define GETFOCUS_INIT ((sal_uInt16)0x0200) 281 #define GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0400) 282 283 // Draw-Flags fuer Draw() 284 #define WINDOW_DRAW_MONO ((sal_uLong)0x00000001) 285 #define WINDOW_DRAW_NOBORDER ((sal_uLong)0x00000002) 286 #define WINDOW_DRAW_NOCONTROLS ((sal_uLong)0x00000004) 287 #define WINDOW_DRAW_NODISABLE ((sal_uLong)0x00000008) 288 #define WINDOW_DRAW_NOMNEMONIC ((sal_uLong)0x00000010) 289 #define WINDOW_DRAW_NOSELECTION ((sal_uLong)0x00000020) 290 #define WINDOW_DRAW_NOFOCUS ((sal_uLong)0x00000040) 291 #define WINDOW_DRAW_NOBACKGROUND ((sal_uLong)0x00000080) 292 #define WINDOW_DRAW_ROLLOVER ((sal_uLong)0x00000100) 293 294 // Border-Styles fuer SetBorder() 295 #define WINDOW_BORDER_NORMAL ((sal_uInt16)0x0001) 296 #define WINDOW_BORDER_MONO ((sal_uInt16)0x0002) 297 #define WINDOW_BORDER_ACTIVE ((sal_uInt16)0x0004) 298 #define WINDOW_BORDER_DOUBLEOUT ((sal_uInt16)0x0008) 299 #define WINDOW_BORDER_MENU ((sal_uInt16)0x0010) 300 #define WINDOW_BORDER_NOBORDER ((sal_uInt16)0x1000) 301 #define WINDOW_BORDER_REMOVEBORDER ((sal_uInt16)0x2000) 302 303 // DialogControl-Flags 304 #define WINDOW_DLGCTRL_RETURN ((sal_uInt16)0x0001) 305 #define WINDOW_DLGCTRL_WANTFOCUS ((sal_uInt16)0x0002) 306 #define WINDOW_DLGCTRL_MOD1TAB ((sal_uInt16)0x0004) 307 #define WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0008) 308 309 // GetWindowClipRegionPixel-Flags 310 #define WINDOW_GETCLIPREGION_NULL ((sal_uInt16)0x0001) 311 #define WINDOW_GETCLIPREGION_NOCHILDREN ((sal_uInt16)0x0002) 312 313 // EndExtTextInput-Flags 314 #define EXTTEXTINPUT_END_COMPLETE ((sal_uInt16)0x0001) 315 #define EXTTEXTINPUT_END_CANCEL ((sal_uInt16)0x0002) 316 317 //#if 0 // _SOLAR__PRIVATE 318 #define IMPL_MINSIZE_BUTTON_WIDTH 70 319 #define IMPL_MINSIZE_BUTTON_HEIGHT 22 320 #define IMPL_EXTRA_BUTTON_WIDTH 18 321 #define IMPL_EXTRA_BUTTON_HEIGHT 10 322 #define IMPL_SEP_BUTTON_X 5 323 #define IMPL_SEP_BUTTON_Y 5 324 #define IMPL_MINSIZE_MSGBOX_WIDTH 150 325 #define IMPL_MINSIZE_MSGBOX_HEIGHT 80 326 #define IMPL_DIALOG_OFFSET 5 327 #define IMPL_DIALOG_BAR_OFFSET 3 328 #define IMPL_MSGBOX_OFFSET_EXTRA_X 0 329 #define IMPL_MSGBOX_OFFSET_EXTRA_Y 2 330 #define IMPL_SEP_MSGBOX_IMAGE 8 331 332 #define DLGWINDOW_PREV 0 333 #define DLGWINDOW_NEXT 1 334 #define DLGWINDOW_FIRST 2 335 //#endif 336 337 enum WindowSizeType { 338 WINDOWSIZE_MINIMUM, 339 WINDOWSIZE_PREFERRED, 340 WINDOWSIZE_MAXIMUM 341 }; 342 343 // ---------- 344 // - Window - 345 // ---------- 346 347 #ifdef DBG_UTIL 348 const char* ImplDbgCheckWindow( const void* pObj ); 349 #endif 350 351 class WindowImpl; 352 class VCL_DLLPUBLIC Window : public OutputDevice 353 { 354 friend class Cursor; 355 friend class OutputDevice; 356 friend class Application; 357 friend class SystemWindow; 358 friend class WorkWindow; 359 friend class Dialog; 360 friend class MessBox; 361 friend class DockingWindow; 362 friend class FloatingWindow; 363 friend class GroupBox; 364 friend class PushButton; 365 friend class RadioButton; 366 friend class SystemChildWindow; 367 friend class ImplBorderWindow; 368 369 // TODO: improve missing functionality 370 // only required because of SetFloatingMode() 371 friend class ImplDockingWindowWrapper; 372 friend class ImplPopupFloatWin; 373 friend class MenuFloatingWindow; 374 375 friend class svt::PopupWindowControllerImpl; 376 377 private: 378 // NOTE: to remove many dependencies of other modules 379 // to this central file, all members are now hidden 380 // in the WindowImpl class and all inline functions 381 // were removed 382 // 383 // Please do *not* add new members or inline functions to class Window, 384 // but use class WindowImpl instead 385 // 386 WindowImpl* mpWindowImpl; 387 388 SAL_DLLPRIVATE void ImplInitWindowData( WindowType nType ); 389 390 #ifdef DBG_UTIL 391 friend const char* ImplDbgCheckWindow( const void* pObj ); 392 #endif 393 friend Window* ImplFindWindow( const SalFrame* pFrame, Point& rSalFramePos ); 394 public: 395 SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData ); 396 SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle, const ::com::sun::star::uno::Any& aSystemWorkWindowToken ); 397 SAL_DLLPRIVATE WinBits ImplInitRes( const ResId& rResId ); 398 SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId ); 399 SAL_DLLPRIVATE void ImplWindowRes( const ResId& rResId ); 400 SAL_DLLPRIVATE void ImplSetFrameParent( const Window* pParent ); 401 SAL_DLLPRIVATE void ImplInsertWindow( Window* pParent ); 402 SAL_DLLPRIVATE void ImplRemoveWindow( sal_Bool bRemoveFrameData ); 403 SAL_DLLPRIVATE Window* ImplGetWindow(); 404 SAL_DLLPRIVATE ImplFrameData* ImplGetFrameData(); 405 SAL_DLLPRIVATE SalFrame* ImplGetFrame() const; 406 SAL_DLLPRIVATE ImplWinData* ImplGetWinData() const; 407 SAL_DLLPRIVATE SalGraphics* ImplGetFrameGraphics() const; 408 SAL_DLLPRIVATE void ImplCallFocusChangeActivate( Window* pNewOverlapWindow, Window* pOldOverlapWindow ); 409 SAL_DLLPRIVATE Window* ImplFindWindow( const Point& rFramePos ); 410 SAL_DLLPRIVATE sal_uInt16 ImplHitTest( const Point& rFramePos ); 411 SAL_DLLPRIVATE Window* ImplGetParent() const; 412 SAL_DLLPRIVATE Window* ImplGetClientWindow() const; 413 SAL_DLLPRIVATE Window* ImplGetBorderWindow() const; 414 SAL_DLLPRIVATE Window* ImplGetFirstOverlapWindow(); 415 SAL_DLLPRIVATE const Window* ImplGetFirstOverlapWindow() const; 416 SAL_DLLPRIVATE Window* ImplGetFrameWindow() const; 417 SAL_DLLPRIVATE sal_Bool ImplIsRealParentPath( const Window* pWindow ) const; 418 SAL_DLLPRIVATE sal_Bool ImplIsChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const; 419 SAL_DLLPRIVATE sal_Bool ImplIsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const; 420 SAL_DLLPRIVATE Window* ImplGetSameParent( const Window* pWindow ) const; 421 SAL_DLLPRIVATE sal_Bool ImplIsDockingWindow() const; 422 SAL_DLLPRIVATE sal_Bool ImplIsFloatingWindow() const; 423 SAL_DLLPRIVATE sal_Bool ImplIsToolbox() const; 424 SAL_DLLPRIVATE sal_Bool ImplIsSplitter() const; 425 SAL_DLLPRIVATE sal_Bool ImplIsPushButton() const; 426 SAL_DLLPRIVATE sal_Bool ImplIsOverlapWindow() const; 427 SAL_DLLPRIVATE void ImplSetActive( sal_Bool bActive ); 428 SAL_DLLPRIVATE sal_Bool ImplIsMouseTransparent() const; 429 SAL_DLLPRIVATE void ImplSetMouseTransparent( sal_Bool bTransparent ); 430 SAL_DLLPRIVATE int ImplTestMousePointerSet(); 431 SAL_DLLPRIVATE PointerStyle ImplGetMousePointer() const; 432 SAL_DLLPRIVATE void ImplResetReallyVisible(); 433 SAL_DLLPRIVATE void ImplSetReallyVisible(); 434 SAL_DLLPRIVATE void ImplCallInitShow(); 435 SAL_DLLPRIVATE void ImplAddDel( ImplDelData* pDel ); 436 SAL_DLLPRIVATE void ImplRemoveDel( ImplDelData* pDel ); 437 SAL_DLLPRIVATE void ImplInitResolutionSettings(); 438 SAL_DLLPRIVATE void ImplPointToLogic( Font& rFont ) const; 439 SAL_DLLPRIVATE void ImplLogicToPoint( Font& rFont ) const; 440 SAL_DLLPRIVATE Point ImplOutputToFrame( const Point& rPos ); 441 SAL_DLLPRIVATE Point ImplFrameToOutput( const Point& rPos ); 442 SAL_DLLPRIVATE void ImplOutputToFrame( Rectangle& rRect ); 443 SAL_DLLPRIVATE void ImplFrameToOutput( Rectangle& rRect ); 444 SAL_DLLPRIVATE sal_Bool ImplSysObjClip( const Region* pOldRegion ); 445 SAL_DLLPRIVATE void ImplUpdateSysObjChildsClip(); 446 SAL_DLLPRIVATE void ImplUpdateSysObjOverlapsClip(); 447 SAL_DLLPRIVATE void ImplUpdateSysObjClip(); 448 SAL_DLLPRIVATE sal_Bool ImplSetClipFlagChilds( sal_Bool bSysObjOnlySmaller = sal_False ); 449 SAL_DLLPRIVATE sal_Bool ImplSetClipFlagOverlapWindows( sal_Bool bSysObjOnlySmaller = sal_False ); 450 SAL_DLLPRIVATE sal_Bool ImplSetClipFlag( sal_Bool bSysObjOnlySmaller = sal_False ); 451 SAL_DLLPRIVATE void ImplIntersectWindowClipRegion( Region& rRegion ); 452 SAL_DLLPRIVATE void ImplIntersectWindowRegion( Region& rRegion ); 453 SAL_DLLPRIVATE void ImplExcludeWindowRegion( Region& rRegion ); 454 SAL_DLLPRIVATE void ImplExcludeOverlapWindows( Region& rRegion ); 455 SAL_DLLPRIVATE void ImplExcludeOverlapWindows2( Region& rRegion ); 456 SAL_DLLPRIVATE void ImplClipBoundaries( Region& rRegion, sal_Bool bThis, sal_Bool bOverlaps ); 457 SAL_DLLPRIVATE sal_Bool ImplClipChilds( Region& rRegion ); 458 SAL_DLLPRIVATE void ImplClipAllChilds( Region& rRegion ); 459 SAL_DLLPRIVATE void ImplClipSiblings( Region& rRegion ); 460 SAL_DLLPRIVATE void ImplInitWinClipRegion(); 461 SAL_DLLPRIVATE void ImplInitWinChildClipRegion(); 462 SAL_DLLPRIVATE Region* ImplGetWinChildClipRegion(); 463 SAL_DLLPRIVATE void ImplIntersectAndUnionOverlapWindows( const Region& rInterRegion, Region& rRegion ); 464 SAL_DLLPRIVATE void ImplIntersectAndUnionOverlapWindows2( const Region& rInterRegion, Region& rRegion ); 465 SAL_DLLPRIVATE void ImplCalcOverlapRegionOverlaps( const Region& rInterRegion, Region& rRegion ); 466 SAL_DLLPRIVATE void ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegion, 467 sal_Bool bChilds, sal_Bool bParent, sal_Bool bSiblings ); 468 SAL_DLLPRIVATE void ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags ); 469 SAL_DLLPRIVATE void ImplCallOverlapPaint(); 470 SAL_DLLPRIVATE void ImplPostPaint(); 471 SAL_DLLPRIVATE void ImplInvalidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags ); 472 SAL_DLLPRIVATE void ImplInvalidateOverlapFrameRegion( const Region& rRegion ); 473 SAL_DLLPRIVATE void ImplInvalidateParentFrameRegion( Region& rRegion ); 474 SAL_DLLPRIVATE void ImplInvalidate( const Region* rRegion, sal_uInt16 nFlags ); 475 SAL_DLLPRIVATE void ImplValidateFrameRegion( const Region* rRegion, sal_uInt16 nFlags ); 476 SAL_DLLPRIVATE void ImplValidate( const Region* rRegion, sal_uInt16 nFlags ); 477 SAL_DLLPRIVATE void ImplMoveInvalidateRegion( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_Bool bChilds ); 478 SAL_DLLPRIVATE void ImplMoveAllInvalidateRegions( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_Bool bChilds ); 479 SAL_DLLPRIVATE void ImplScroll( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_uInt16 nFlags ); 480 SAL_DLLPRIVATE void ImplUpdateAll( sal_Bool bOverlapWindows = sal_True ); 481 SAL_DLLPRIVATE void ImplUpdateWindowPtr( Window* pWindow ); 482 SAL_DLLPRIVATE void ImplUpdateWindowPtr(); 483 SAL_DLLPRIVATE void ImplUpdateOverlapWindowPtr( sal_Bool bNewFrame ); 484 SAL_DLLPRIVATE sal_Bool ImplUpdatePos(); 485 SAL_DLLPRIVATE void ImplUpdateSysObjPos(); 486 SAL_DLLPRIVATE WindowImpl* ImplGetWindowImpl() const { return mpWindowImpl; } 487 SAL_DLLPRIVATE void ImplFreeExtWindowImpl(); 488 // creates ExtWindowImpl on demand, but may return NULL (e.g. if mbInDtor) 489 SAL_DLLPRIVATE vcl::ExtWindowImpl* ImplGetExtWindowImpl() const; 490 SAL_DLLPRIVATE void ImplDeleteOwnedChildren(); 491 /** check whether a font is suitable for UI 492 493 The font to be tested will be checked whether it could display a 494 localized test string. If this is not the case, then the font 495 is deemed unsuitable as UI font. 496 497 @param rFont 498 the font to be tested 499 500 @returns 501 <TRUE/> if the font can be used as UI font 502 <FALSE/> if the font is unsuitable as UI font 503 */ 504 SAL_DLLPRIVATE bool ImplCheckUIFont( const Font& rFont ); 505 SAL_DLLPRIVATE void ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl = sal_True ); 506 SAL_DLLPRIVATE void ImplAlignChilds(); 507 SAL_DLLPRIVATE void ImplPosSizeWindow( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ); 508 SAL_DLLPRIVATE void ImplToBottomChild(); 509 SAL_DLLPRIVATE void ImplCalcToTop( ImplCalcToTopData* pPrevData ); 510 SAL_DLLPRIVATE void ImplCalcChildOverlapToTop( ImplCalcToTopData* pPrevData ); 511 SAL_DLLPRIVATE void ImplToTop( sal_uInt16 nFlags ); 512 SAL_DLLPRIVATE void ImplStartToTop( sal_uInt16 nFlags ); 513 SAL_DLLPRIVATE void ImplFocusToTop( sal_uInt16 nFlags, sal_Bool bReallyVisible ); 514 SAL_DLLPRIVATE void ImplShowAllOverlaps(); 515 SAL_DLLPRIVATE void ImplHideAllOverlaps(); 516 SAL_DLLPRIVATE void ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt ); 517 SAL_DLLPRIVATE void ImplCallMouseMove( sal_uInt16 nMouseCode, sal_Bool bModChanged = sal_False ); 518 SAL_DLLPRIVATE void ImplGenerateMouseMove(); 519 SAL_DLLPRIVATE void ImplGrabFocus( sal_uInt16 nFlags ); 520 SAL_DLLPRIVATE void ImplInvertFocus( const Rectangle& rRect ); 521 SAL_DLLPRIVATE void ImplControlFocus( sal_uInt16 nFlags = 0 ); 522 SAL_DLLPRIVATE Window* ImplGetDlgWindow( sal_uInt16 n, sal_uInt16 nType, sal_uInt16 nStart = 0, sal_uInt16 nEnd = 0xFFFF, sal_uInt16* pIndex = NULL ); 523 SAL_DLLPRIVATE sal_Bool ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput ); 524 SAL_DLLPRIVATE sal_Bool ImplHasDlgCtrl(); 525 SAL_DLLPRIVATE void ImplDlgCtrlNextWindow(); 526 SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged( Window* pWindow, sal_Bool bGetFocus ); 527 SAL_DLLPRIVATE Window* ImplFindDlgCtrlWindow( Window* pWindow ); 528 SAL_DLLPRIVATE long ImplLogicUnitToPixelX( long nX, MapUnit eUnit ); 529 SAL_DLLPRIVATE long ImplLogicUnitToPixelY( long nY, MapUnit eUnit ); 530 SAL_DLLPRIVATE sal_Bool ImplIsWindowInFront( const Window* pTestWindow ) const; 531 SAL_DLLPRIVATE void ImplSaveOverlapBackground(); 532 SAL_DLLPRIVATE sal_Bool ImplRestoreOverlapBackground( Region& rInvRegion ); 533 SAL_DLLPRIVATE void ImplDeleteOverlapBackground(); 534 SAL_DLLPRIVATE void ImplInvalidateAllOverlapBackgrounds(); 535 SAL_DLLPRIVATE static void ImplNewInputContext(); 536 SAL_DLLPRIVATE void ImplCallActivateListeners(Window*); 537 SAL_DLLPRIVATE void ImplCallDeactivateListeners(Window*); 538 DECL_DLLPRIVATE_LINK( ImplHandlePaintHdl, void* ); 539 DECL_DLLPRIVATE_LINK( ImplGenerateMouseMoveHdl, void* ); 540 DECL_DLLPRIVATE_LINK( ImplTrackTimerHdl, Timer* ); 541 DECL_DLLPRIVATE_LINK( ImplAsyncFocusHdl, void* ); 542 DECL_DLLPRIVATE_LINK( ImplAsyncStateChangedHdl, void* ); 543 DECL_DLLPRIVATE_LINK( ImplHideOwnerDrawWindowsHdl, void* ); 544 DECL_DLLPRIVATE_LINK( ImplHandleResizeTimerHdl, void* ); 545 546 SAL_DLLPRIVATE static void ImplCalcSymbolRect( Rectangle& rRect ); 547 SAL_DLLPRIVATE void ImplHandleScroll( ScrollBar* pHScrl, long nX, ScrollBar* pVScrl, long nY ); 548 SAL_DLLPRIVATE sal_Bool ImplGetCurrentBackgroundColor( Color& rCol ); 549 SAL_DLLPRIVATE sal_Bool ImplIsAccessibleCandidate() const; 550 SAL_DLLPRIVATE sal_Bool ImplIsAccessibleNativeFrame() const; 551 SAL_DLLPRIVATE sal_uInt16 ImplGetAccessibleCandidateChildWindowCount( sal_uInt16 nFirstWindowType ) const; 552 SAL_DLLPRIVATE Window* ImplGetAccessibleCandidateChild( sal_uInt16 nChild, sal_uInt16& rChildCount, sal_uInt16 nFirstWindowType, sal_Bool bTopLevel = sal_True ) const; 553 SAL_DLLPRIVATE sal_Bool ImplRegisterAccessibleNativeFrame(); 554 SAL_DLLPRIVATE void ImplRevokeAccessibleNativeFrame(); 555 SAL_DLLPRIVATE void ImplCallResize(); 556 SAL_DLLPRIVATE void ImplExtResize(); 557 SAL_DLLPRIVATE void ImplCallMove(); 558 SAL_DLLPRIVATE Rectangle ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle& rRect ) const; 559 SAL_DLLPRIVATE void ImplMirrorFramePos( Point &pt ) const; 560 SAL_DLLPRIVATE long ImplGetUnmirroredOutOffX(); 561 SAL_DLLPRIVATE void ImplIncModalCount(); 562 SAL_DLLPRIVATE void ImplDecModalCount(); 563 564 // retrieves the list of owner draw decorated windows for this window hiearchy 565 SAL_DLLPRIVATE ::std::vector<Window *>& ImplGetOwnerDrawList(); 566 SAL_DLLPRIVATE Window* ImplGetTopmostFrameWindow(); 567 568 SAL_DLLPRIVATE Rectangle ImplGetWindowExtentsRelative( Window *pRelativeWindow, sal_Bool bClientOnly ) const; 569 SAL_DLLPRIVATE void ImplNotifyIconifiedState( sal_Bool bIconified ); 570 SAL_DLLPRIVATE bool ImplStopDnd(); 571 SAL_DLLPRIVATE void ImplStartDnd(); 572 573 SAL_DLLPRIVATE static void ImplInitAppFontData( Window* pWindow ); 574 SAL_DLLPRIVATE void ImplPaintToDevice( OutputDevice* pTargetOutDev, const Point& rPos ); 575 576 SAL_DLLPRIVATE sal_Bool ImplIsInTaskPaneList(); 577 SAL_DLLPRIVATE void ImplIsInTaskPaneList( sal_Bool mbIsInTaskList ); 578 SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvas > 579 ImplGetCanvas( const Size& rFullscreenSize, bool bFullscreen, bool bSpriteCanvas ) const; 580 581 private: 582 // Default construction is forbidden and not implemented. 583 SAL_DLLPRIVATE Window(); 584 585 // Copy assignment is forbidden and not implemented. 586 SAL_DLLPRIVATE Window (const Window &); 587 SAL_DLLPRIVATE Window & operator= (const Window &); 588 589 protected: 590 // Single argument ctors shall be explicit. 591 explicit Window( WindowType nType ); 592 593 void SetCompoundControl( sal_Bool bCompound ); 594 595 void ImplCallEventListeners( sal_uLong nEvent, void* pData = NULL ); 596 void CallEventListeners( sal_uLong nEvent, void* pData = NULL ); 597 void FireVclEvent( VclSimpleEvent* pEvent ); 598 599 // FIXME: this is a hack to workaround missing layout functionality 600 SAL_DLLPRIVATE void ImplAdjustNWFSizes(); 601 public: 602 // Single argument ctors shall be explicit. 603 explicit Window( Window* pParent, WinBits nStyle = 0 ); 604 605 Window( Window* pParent, const ResId& rResId ); 606 virtual ~Window(); 607 608 virtual void MouseMove( const MouseEvent& rMEvt ); 609 virtual void MouseButtonDown( const MouseEvent& rMEvt ); 610 virtual void MouseButtonUp( const MouseEvent& rMEvt ); 611 virtual void KeyInput( const KeyEvent& rKEvt ); 612 virtual void KeyUp( const KeyEvent& rKEvt ); 613 virtual void PrePaint(); 614 virtual void Paint( const Rectangle& rRect ); 615 616 virtual void PostPaint(); 617 virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ); 618 virtual void Move(); 619 virtual void Resize(); 620 virtual void Activate(); 621 virtual void Deactivate(); 622 virtual void GetFocus(); 623 virtual void LoseFocus(); 624 virtual void RequestHelp( const HelpEvent& rHEvt ); 625 virtual void Command( const CommandEvent& rCEvt ); 626 virtual void Tracking( const TrackingEvent& rTEvt ); 627 virtual void UserEvent( sal_uLong nEvent, void* pEventData ); 628 virtual void StateChanged( StateChangedType nStateChange ); 629 virtual void DataChanged( const DataChangedEvent& rDCEvt ); 630 virtual long PreNotify( NotifyEvent& rNEvt ); 631 virtual long Notify( NotifyEvent& rNEvt ); 632 //IAccessibility2 Implementation 2009----- 633 virtual void NotifyVCLEvent( sal_uLong nEvent ,void* pData = NULL); 634 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > GetAccFlowToSequence(); 635 virtual void SwitchView() {} 636 //-----IAccessibility2 Implementation 2009 637 virtual Window* GetPreferredKeyInputWindow(); 638 639 /*virtual*/ void AddEventListener( const Link& rEventListener ); 640 /*virtual*/ void RemoveEventListener( const Link& rEventListener ); 641 /*virtual*/ void AddChildEventListener( const Link& rEventListener ); 642 /*virtual*/ void RemoveChildEventListener( const Link& rEventListener ); 643 644 sal_uLong PostUserEvent( sal_uLong nEvent, void* pEventData = NULL ); 645 sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL ); 646 sal_Bool PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData = NULL ); 647 sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL ); 648 void RemoveUserEvent( sal_uLong nUserEvent ); 649 void PostStateChanged( StateChangedType nState ); 650 651 void IncrementLockCount(); 652 void DecrementLockCount(); 653 sal_Bool IsLocked( sal_Bool bChilds = sal_False ) const; 654 655 // returns the input language used for the last key stroke 656 // may be LANGUAGE_DONTKNOW if not supported by the OS 657 LanguageType GetInputLanguage() const; 658 659 void SetStyle( WinBits nStyle ); 660 WinBits GetStyle() const; 661 WinBits GetPrevStyle() const; 662 void SetExtendedStyle( WinBits nExtendedStyle ); 663 WinBits GetExtendedStyle() const; 664 WinBits GetPrevExtendedStyle() const; 665 void SetType( WindowType nType ); 666 WindowType GetType() const; 667 sal_Bool IsSystemWindow() const; 668 sal_Bool IsDialog() const; 669 sal_Bool IsMenuFloatingWindow() const; 670 sal_Bool IsToolbarFloatingWindow() const; 671 sal_Bool IsTopWindow() const; 672 SystemWindow* GetSystemWindow() const; 673 674 void EnableAllResize( sal_Bool bEnable = sal_True ); 675 sal_Bool IsAllResizeEnabled() const; 676 677 void SetBorderStyle( sal_uInt16 nBorderStyle ); 678 sal_uInt16 GetBorderStyle() const; 679 void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder, 680 sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const; 681 Size CalcWindowSize( const Size& rOutSz ) const; 682 Size CalcOutputSize( const Size& rWinSz ) const; 683 long CalcTitleWidth() const; 684 685 void EnableClipSiblings( sal_Bool bClipSiblings = sal_True ); 686 sal_Bool IsClipSiblingsEnabled() const; 687 688 void EnableChildTransparentMode( sal_Bool bEnable = sal_True ); 689 sal_Bool IsChildTransparentModeEnabled() const; 690 691 void SetMouseTransparent( sal_Bool bTransparent ); 692 sal_Bool IsMouseTransparent() const; 693 void SetPaintTransparent( sal_Bool bTransparent ); 694 sal_Bool IsPaintTransparent() const; 695 void SetDialogControlStart( sal_Bool bStart ); 696 sal_Bool IsDialogControlStart() const; 697 void SetDialogControlFlags( sal_uInt16 nFlags ); 698 sal_uInt16 GetDialogControlFlags() const; 699 700 struct PointerState 701 { 702 sal_uLong mnState; // the button state 703 Point maPos; // mouse position in output coordinates 704 }; 705 PointerState GetPointerState(); 706 sal_Bool IsMouseOver(); 707 708 sal_uLong GetCurrentModButtons(); 709 710 void SetInputContext( const InputContext& rInputContext ); 711 const InputContext& GetInputContext() const; 712 void EndExtTextInput( sal_uInt16 nFlags ); 713 sal_Bool IsExtTextInput() const; 714 void SetCursorRect( const Rectangle* pRect = NULL, long nExtTextInputWidth = 0 ); 715 const Rectangle* GetCursorRect() const; 716 long GetCursorExtTextInputWidth() const; 717 718 void EnableChildNotify( sal_Bool bEnable ); 719 sal_Bool IsChildNotify() const; 720 721 using OutputDevice::SetSettings; 722 virtual void SetSettings( const AllSettings& rSettings ); 723 virtual void SetSettings( const AllSettings& rSettings, sal_Bool bChild ); 724 void UpdateSettings( const AllSettings& rSettings, sal_Bool bChild = sal_False ); 725 void NotifyAllChilds( DataChangedEvent& rDCEvt ); 726 727 void SetPointFont( const Font& rFont ); 728 Font GetPointFont() const; 729 void SetZoomedPointFont( const Font& rFont ); 730 long GetDrawPixel( OutputDevice* pDev, long nPixels ) const; 731 Font GetDrawPixelFont( OutputDevice* pDev ) const; 732 void GetFontResolution( sal_Int32& nDPIX, sal_Int32& nDPIY ) const; 733 734 void SetControlFont(); 735 void SetControlFont( const Font& rFont ); 736 Font GetControlFont() const; 737 sal_Bool IsControlFont() const; 738 void SetControlForeground(); 739 void SetControlForeground( const Color& rColor ); 740 Color GetControlForeground() const; 741 sal_Bool IsControlForeground() const; 742 void SetControlBackground(); 743 void SetControlBackground( const Color& rColor ); 744 Color GetControlBackground() const; 745 sal_Bool IsControlBackground() const; 746 747 void SetParentClipMode( sal_uInt16 nMode = 0 ); 748 sal_uInt16 GetParentClipMode() const; 749 750 void SetWindowRegionPixel(); 751 void SetWindowRegionPixel( const Region& rRegion ); 752 const Region& GetWindowRegionPixel() const; 753 sal_Bool IsWindowRegionPixel() const; 754 Region GetWindowClipRegionPixel( sal_uInt16 nFlags = 0 ) const; 755 Region GetPaintRegion() const; 756 sal_Bool IsInPaint() const; 757 // while IsInPaint returns true ExpandPaintClipRegion adds the 758 // submitted region to the paint clip region so you can 759 // paint additional parts of your window if necessary 760 void ExpandPaintClipRegion( const Region& rRegion ); 761 762 void SetParent( Window* pNewParent ); 763 Window* GetParent() const; 764 765 void Show( sal_Bool bVisible = sal_True, sal_uInt16 nFlags = 0 ); 766 void Hide( sal_uInt16 nFlags = 0 ) { Show( sal_False, nFlags ); } 767 sal_Bool IsVisible() const; 768 sal_Bool IsReallyVisible() const; 769 // Do not use this function, use IsReallyVisible() 770 sal_Bool IsParentPathVisible() const; 771 sal_Bool IsReallyShown() const; 772 sal_Bool IsInInitShow() const; 773 774 void Enable( bool bEnable = true, bool bChild = true ); 775 void Disable( bool bChild = true ) { Enable( false, bChild ); } 776 sal_Bool IsEnabled() const; 777 778 void EnableInput( sal_Bool bEnable = sal_True, sal_Bool bChild = sal_True ); 779 void EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin, 780 const Window* pExcludeWindow = NULL ); 781 sal_Bool IsInputEnabled() const; 782 783 /** Override <code>EnableInput</code>. This can be necessary due to other people 784 using EnableInput for whole window hierarchies. 785 786 787 <code>AlwaysEnableInput</code> and <code>AlwaysDisableInput</code> are 788 mutually exclusive; the last setter wins. 789 @param bAlways 790 sets always enabled flag 791 792 @param bChild 793 if true children are recursively set to AlwaysEnableInput 794 */ 795 void AlwaysEnableInput( sal_Bool bAlways, sal_Bool bChild = sal_True ); 796 /** returns the current AlwaysEnableInput state 797 @return 798 true if window is in AlwaysEnableInput state 799 */ 800 sal_Bool IsAlwaysEnableInput() const; 801 /** Override <code>EnableInput</code>, counterpart to AlwaysEnableInput. 802 Windows with AlwaysDisableInput will not get key events even if enabled 803 and input enabled.This can be necessary due to other people using EnableInput 804 for whole window hierarchies. 805 806 <code>AlwaysEnableInput</code> and <code>AlwaysDisableInput</code> are 807 mutually exclusive; the last setter wins. 808 809 @param bAlways 810 sets always disable flag 811 812 @param bChild 813 if true children are recursively set to AlwaysDisableInput 814 */ 815 void AlwaysDisableInput( sal_Bool bAlways, sal_Bool bChild = sal_True ); 816 /** returns the current AlwaysDisableInput state 817 @return 818 true if window is in AlwaysEnableInput state 819 */ 820 sal_Bool IsAlwaysDisableInput() const; 821 /** usually event handlers (see AddEventListener and AddChildEventListener) 822 are not called on disabled, modal or input disabled windows. There are however rare cases 823 in which one wants a Window or rather one of its Control subclasses to 824 not evaluate events but still react to those events externally. In these 825 rare cases call SetCallHandlersOnInputDisabled( true ) to have your handler 826 called anyway. 827 828 Currently only mouse events get this special treatment. 829 830 Use this sparingly, chances are if you want to use it you're wroking around 831 the real problem. 832 833 @param bCall 834 Enable/Disable calling event handlers for this disabled, modal or input disabled window. 835 This call is implicity done recursively for possible child windows. 836 */ 837 void SetCallHandlersOnInputDisabled( bool bCall ); 838 /** get state of SetCallHandlersOnInputDisabled 839 840 @returns whether handlers are called regardless of input enabled state 841 */ 842 bool IsCallHandlersOnInputDisabled() const; 843 /** A window is in modal mode if one of its children or subchildren 844 is a running modal window (a modal dialog) 845 846 @returns sal_True if a child or subchild is a running modal window 847 */ 848 sal_Bool IsInModalMode() const; 849 850 void SetActivateMode( sal_uInt16 nMode ); 851 sal_uInt16 GetActivateMode() const; 852 853 void ToTop( sal_uInt16 nFlags = 0 ); 854 void SetZOrder( Window* pRefWindow, sal_uInt16 nFlags ); 855 void EnableAlwaysOnTop( sal_Bool bEnable = sal_True ); 856 sal_Bool IsAlwaysOnTopEnabled() const; 857 858 virtual void SetPosSizePixel( long nX, long nY, 859 long nWidth, long nHeight, 860 sal_uInt16 nFlags = WINDOW_POSSIZE_ALL ); 861 virtual void SetPosPixel( const Point& rNewPos ); 862 virtual Point GetPosPixel() const; 863 virtual void SetSizePixel( const Size& rNewSize ); 864 virtual Size GetSizePixel() const; 865 virtual void SetPosSizePixel( const Point& rNewPos, 866 const Size& rNewSize ); 867 virtual void SetOutputSizePixel( const Size& rNewSize ); 868 sal_Bool IsDefaultPos() const; 869 sal_Bool IsDefaultSize() const; 870 871 // those conversion routines might deliver different results during UI mirroring 872 Point OutputToScreenPixel( const Point& rPos ) const; 873 Point ScreenToOutputPixel( const Point& rPos ) const; 874 // the normalized screen methods work independent from UI mirroring 875 Point OutputToNormalizedScreenPixel( const Point& rPos ) const; 876 Point NormalizedScreenToOutputPixel( const Point& rPos ) const; 877 Point OutputToAbsoluteScreenPixel( const Point& rPos ) const; 878 Point AbsoluteScreenToOutputPixel( const Point& rPos ) const; 879 Rectangle GetDesktopRectPixel() const; 880 // window extents including border and decoratrion 881 Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const; 882 // window extents of the client window, coordinates to be used in SetPosPixel 883 Rectangle GetClientWindowExtentsRelative( Window *pRelativeWindow ) const; 884 885 virtual sal_Bool IsScrollable() const; 886 virtual void Scroll( long nHorzScroll, long nVertScroll, 887 sal_uInt16 nFlags = 0 ); 888 virtual void Scroll( long nHorzScroll, long nVertScroll, 889 const Rectangle& rRect, sal_uInt16 nFlags = 0 ); 890 virtual void Invalidate( sal_uInt16 nFlags = 0 ); 891 virtual void Invalidate( const Rectangle& rRect, sal_uInt16 nFlags = 0 ); 892 virtual void Invalidate( const Region& rRegion, sal_uInt16 nFlags = 0 ); 893 void Validate( sal_uInt16 nFlags = 0 ); 894 void Validate( const Rectangle& rRect, sal_uInt16 nFlags = 0 ); 895 void Validate( const Region& rRegion, sal_uInt16 nFlags = 0 ); 896 sal_Bool HasPaintEvent() const; 897 void Update(); 898 void Flush(); 899 void Sync(); 900 901 // toggles new docking support, enabled via toolkit 902 void EnableDocking( sal_Bool bEnable = sal_True ); 903 // retrieves the single dockingmanager instance 904 static DockingManager* GetDockingManager(); 905 906 void EnablePaint( sal_Bool bEnable ); 907 sal_Bool IsPaintEnabled() const; 908 void SetUpdateMode( sal_Bool bUpdate ); 909 sal_Bool IsUpdateMode() const; 910 void SetParentUpdateMode( sal_Bool bUpdate ); 911 sal_Bool IsParentUpdateMode() const; 912 913 void GrabFocus(); 914 sal_Bool HasFocus() const; 915 sal_Bool HasChildPathFocus( sal_Bool bSystemWindow = sal_False ) const; 916 sal_Bool IsActive() const; 917 sal_Bool HasActiveChildFrame(); 918 sal_uInt16 GetGetFocusFlags() const; 919 void GrabFocusToDocument(); 920 921 /** 922 * Set this when you need to act as if the window has focus even if it 923 * doesn't. This is necessary for implementing tab stops inside floating 924 * windows, but floating windows don't get focus from the system. 925 */ 926 void SetFakeFocus( bool bFocus ); 927 928 sal_Bool IsCompoundControl() const; 929 sal_Bool HasCompoundControlFocus() const; 930 931 static sal_uIntPtr SaveFocus(); 932 static sal_Bool EndSaveFocus( sal_uIntPtr nSaveId, sal_Bool bRestore = sal_True ); 933 934 void CaptureMouse(); 935 void ReleaseMouse(); 936 sal_Bool IsMouseCaptured() const; 937 938 void SetPointer( const Pointer& rPointer ); 939 const Pointer& GetPointer() const; 940 void EnableChildPointerOverwrite( sal_Bool bOverwrite = sal_True ); 941 sal_Bool IsChildPointerOverwrite() const; 942 void SetPointerPosPixel( const Point& rPos ); 943 Point GetPointerPosPixel(); 944 Point GetLastPointerPosPixel(); 945 void ShowPointer( sal_Bool bVisible ); 946 sal_Bool IsPointerVisible() const; 947 void EnterWait(); 948 void LeaveWait(); 949 sal_Bool IsWait() const; 950 951 void SetCursor( Cursor* pCursor ); 952 Cursor* GetCursor() const; 953 954 void SetZoom( const Fraction& rZoom ); 955 const Fraction& GetZoom() const; 956 sal_Bool IsZoom() const; 957 long CalcZoom( long n ) const; 958 959 virtual void SetText( const XubString& rStr ); 960 virtual String GetText() const; 961 // return the actual text displayed 962 // this may have e.g. accellerators removed or portions 963 // replaced by ellipsis 964 virtual String GetDisplayText() const; 965 // gets the visible background color. for transparent windows 966 // this may be the parent's background color; for controls 967 // this may be a child's background color (e.g. ListBox) 968 virtual const Wallpaper& GetDisplayBackground() const; 969 970 void SetHelpText( const XubString& rHelpText ); 971 const XubString& GetHelpText() const; 972 973 void SetQuickHelpText( const XubString& rHelpText ); 974 const XubString& GetQuickHelpText() const; 975 976 void SetHelpId( const rtl::OString& ); 977 const rtl::OString& GetHelpId() const; 978 979 void SetUniqueId( const rtl::OString& ); 980 const rtl::OString& GetUniqueId() const; 981 const rtl::OString& GetUniqueOrHelpId() const; 982 983 Window* FindWindow( const Point& rPos ) const; 984 985 sal_uInt16 GetChildCount() const; 986 Window* GetChild( sal_uInt16 nChild ) const; 987 Window* GetWindow( sal_uInt16 nType ) const; 988 sal_Bool IsChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const; 989 sal_Bool IsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const; 990 991 void SetData( void* pNewData ); 992 void* GetData() const; 993 994 // Should be merged in the next top level build !!! 995 Bitmap SnapShot( sal_Bool bBorder ) const; 996 Bitmap SnapShot() const; 997 998 void ShowFocus( const Rectangle& rRect ); 999 void HideFocus(); 1000 1001 void Invert( const Rectangle& rRect, sal_uInt16 nFlags = 0 ); 1002 void Invert( const Polygon& rPoly, sal_uInt16 nFlags = 0 ); 1003 1004 // transparent background for selected or checked items in toolboxes etc. 1005 void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly ); 1006 // the same, but fills a passed Color with a text color complementing the selection background 1007 void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, Color* pSelectionTextColor ); 1008 // support rounded edges in the selection rect 1009 void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, long nCornerRadius, Color* pSelectionTextColor, Color* pPaintColor ); 1010 1011 void ShowTracking( const Rectangle& rRect, 1012 sal_uInt16 nFlags = SHOWTRACK_SMALL ); 1013 void HideTracking(); 1014 void InvertTracking( const Rectangle& rRect, 1015 sal_uInt16 nFlags = SHOWTRACK_SMALL ); 1016 void InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags = 0 ); 1017 1018 void StartTracking( sal_uInt16 nFlags = 0 ); 1019 void EndTracking( sal_uInt16 nFlags = 0 ); 1020 sal_Bool IsTracking() const; 1021 1022 void StartAutoScroll( sal_uInt16 nFlags ); 1023 void EndAutoScroll(); 1024 sal_Bool IsAutoScroll() const; 1025 1026 sal_Bool HandleScrollCommand( const CommandEvent& rCmd, 1027 ScrollBar* pHScrl = NULL, 1028 ScrollBar* pVScrl = NULL ); 1029 1030 void SaveBackground( const Point& rPos, const Size& rSize, 1031 const Point& rDestOff, VirtualDevice& rSaveDevice ); 1032 1033 const SystemEnvData* GetSystemData() const; 1034 ::com::sun::star::uno::Any GetSystemDataAny() const; 1035 1036 // API zum Setzen/Abfragen des Komponenteninterfaces 1037 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > GetComponentInterface( sal_Bool bCreate = sal_True ); 1038 virtual void SetComponentInterface( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xIFace ); 1039 1040 // Accessibility 1041 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True ); 1042 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); 1043 void SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ); 1044 1045 Window* GetAccessibleParentWindow() const; 1046 sal_uInt16 GetAccessibleChildWindowCount(); 1047 Window* GetAccessibleChildWindow( sal_uInt16 n ); 1048 1049 void SetAccessibleRole( sal_uInt16 nRole ); 1050 sal_uInt16 GetAccessibleRole() const; 1051 1052 void SetAccessibleName( const String& rName ); 1053 String GetAccessibleName() const; 1054 1055 void SetAccessibleDescription( const String& rDescr ); 1056 String GetAccessibleDescription() const; 1057 1058 void SetAccessibleRelationLabeledBy( Window* pLabeledBy ); 1059 Window* GetAccessibleRelationLabeledBy() const; 1060 1061 void SetAccessibleRelationLabelFor( Window* pLabelFor ); 1062 Window* GetAccessibleRelationLabelFor() const; 1063 1064 void SetAccessibleRelationMemberOf( Window* pMemberOf ); 1065 Window* GetAccessibleRelationMemberOf() const; 1066 1067 1068 // to avoid sending accessibility events in cases like closing dialogs 1069 // by default checks complete parent path 1070 sal_Bool IsAccessibilityEventsSuppressed( sal_Bool bTraverseParentPath = sal_True ); 1071 void SetAccessibilityEventsSuppressed(sal_Bool bSuppressed); 1072 1073 /// request XCanvas render interface for this window 1074 ::com::sun::star::uno::Reference< 1075 ::com::sun::star::rendering::XCanvas > GetCanvas() const; 1076 /// request XSpriteCanvas render interface for this window 1077 ::com::sun::star::uno::Reference< 1078 ::com::sun::star::rendering::XSpriteCanvas > GetSpriteCanvas() const; 1079 /// request fullscreen XSpriteCanvas render interface for this window 1080 ::com::sun::star::uno::Reference< 1081 ::com::sun::star::rendering::XSpriteCanvas > GetFullscreenSpriteCanvas( const Size& rFullscreenSize ) const; 1082 1083 /* records all DrawText operations within the passed rectangle; 1084 * a synchronous paint is sent to achieve this 1085 */ 1086 void RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& rRect ); 1087 1088 // Setzen und Abfragen fuer das Toolkit 1089 VCLXWindow* GetWindowPeer() const; 1090 void SetWindowPeer( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer, VCLXWindow* pVCLXWindow ); 1091 1092 // Merken, ob vom Toolkit erzeugt 1093 sal_Bool IsCreatedWithToolkit() const; 1094 void SetCreatedWithToolkit( sal_Bool b ); 1095 1096 // Deprecated - can use SetAccessibleRelationLabelFor/By nowadys 1097 virtual Window* GetParentLabelFor( const Window* pLabel ) const; 1098 virtual Window* GetParentLabeledBy( const Window* pLabeled ) const; 1099 KeyEvent GetActivationKey() const; 1100 1101 // Drag and Drop interfaces 1102 virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > GetDropTarget(); 1103 virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > GetDragSource(); 1104 virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer > GetDragGestureRecognizer(); 1105 // only for RVP transmission 1106 void GetDragSourceDropTarget(::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& xDragSource,::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > &xDropTarget ); 1107 1108 // Clipboard/Selection interfaces 1109 virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetClipboard(); 1110 virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetPrimarySelection(); 1111 1112 // Advisory Sizing - what is a good size for this widget ? 1113 virtual Size GetOptimalSize(WindowSizeType eType) const; 1114 1115 //------------------------------------- 1116 // Native Widget Rendering functions 1117 //------------------------------------- 1118 1119 // form controls must never use native widgets, this can be toggled here 1120 void EnableNativeWidget( sal_Bool bEnable = sal_True ); 1121 sal_Bool IsNativeWidgetEnabled() const; 1122 1123 // a helper method for a Control's Draw method 1124 void PaintToDevice( OutputDevice* pDevice, const Point& rPos, const Size& rSize ); 1125 1126 /* mark Window for deletion in top of event queue 1127 */ 1128 void doLazyDelete(); 1129 1130 // let the window intercept the KeyDown messages of the system children 1131 void InterceptChildWindowKeyDown( sal_Bool bIntercept ); 1132 1133 virtual XubString GetSurroundingText() const; 1134 virtual Selection GetSurroundingTextSelection() const; 1135 1136 // ExtImpl 1137 1138 // layouting 1139 boost::shared_ptr< vcl::WindowArranger > getLayout(); 1140 1141 /* add a child Window 1142 addWindow will do the following things 1143 - insert the passed window into the child list (equivalent to i_pWin->SetParent( this )) 1144 - mark the window as "owned", meaning that the added Window will be destroyed by 1145 the parent's desctructor. 1146 This means: do not pass in member windows or stack objects here. Do not cause 1147 the destructor of the added window to be called in any way. 1148 1149 to avoid ownership pass i_bTakeOwnership as "false" 1150 */ 1151 void addWindow( Window* i_pWin, bool i_bTakeOwnership = true ); 1152 1153 /* remove a child Window 1154 the remove window functions will 1155 - reparent the searched window (equivalent to i_pWin->SetParent( i_pNewParent )) 1156 - return a pointer to the removed window or NULL if i_pWin was not found 1157 caution: ownership passes to the new parent or the caller, if the new parent was NULL 1158 */ 1159 Window* removeWindow( Window* i_pWin, Window* i_pNewParent = NULL ); 1160 1161 /* return the identifier of this window 1162 */ 1163 const rtl::OUString& getIdentifier() const; 1164 /* set an identifier 1165 identifiers have only loosely defined rules per se 1166 in context of Window they must be unique over the window 1167 hierarchy you'd like to find them again using the findWindow method 1168 */ 1169 void setIdentifier( const rtl::OUString& ); 1170 1171 /* returns the first found descendant that matches 1172 the passed identifier or NULL 1173 */ 1174 Window* findWindow( const rtl::OUString& ) const; 1175 1176 /* get/set properties 1177 this will contain window properties (like visible, enabled) 1178 as well as properties of derived classes (e.g. text of Edit fields) 1179 */ 1180 virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getProperties() const; 1181 /* 1182 */ 1183 virtual void setProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& ); 1184 1185 1186 void EnableThemeSupport (void); 1187 void DisableThemeSupport (void); 1188 1189 virtual ImplBorderWindow* CreateBorderWindow ( 1190 Window* pParent, 1191 const WinBits nStyle, 1192 const sal_uInt16 nTypeStyle); 1193 }; 1194 1195 1196 #endif // _SV_WINDOW_HXX 1197