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(); ImplGetWindowImpl() const486 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 virtual void NotifyVCLEvent( sal_uLong nEvent ,void* pData = NULL); 633 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > GetAccFlowToSequence(); SwitchView()634 virtual void SwitchView() {} 635 virtual Window* GetPreferredKeyInputWindow(); 636 637 /*virtual*/ void AddEventListener( const Link& rEventListener ); 638 /*virtual*/ void RemoveEventListener( const Link& rEventListener ); 639 /*virtual*/ void AddChildEventListener( const Link& rEventListener ); 640 /*virtual*/ void RemoveChildEventListener( const Link& rEventListener ); 641 642 sal_uLong PostUserEvent( sal_uLong nEvent, void* pEventData = NULL ); 643 sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL ); 644 sal_Bool PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData = NULL ); 645 sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL ); 646 void RemoveUserEvent( sal_uLong nUserEvent ); 647 void PostStateChanged( StateChangedType nState ); 648 649 void IncrementLockCount(); 650 void DecrementLockCount(); 651 sal_Bool IsLocked( sal_Bool bChilds = sal_False ) const; 652 653 // returns the input language used for the last key stroke 654 // may be LANGUAGE_DONTKNOW if not supported by the OS 655 LanguageType GetInputLanguage() const; 656 657 void SetStyle( WinBits nStyle ); 658 WinBits GetStyle() const; 659 WinBits GetPrevStyle() const; 660 void SetExtendedStyle( WinBits nExtendedStyle ); 661 WinBits GetExtendedStyle() const; 662 WinBits GetPrevExtendedStyle() const; 663 void SetType( WindowType nType ); 664 WindowType GetType() const; 665 sal_Bool IsSystemWindow() const; 666 sal_Bool IsDialog() const; 667 sal_Bool IsMenuFloatingWindow() const; 668 sal_Bool IsToolbarFloatingWindow() const; 669 sal_Bool IsTopWindow() const; 670 SystemWindow* GetSystemWindow() const; 671 672 void EnableAllResize( sal_Bool bEnable = sal_True ); 673 sal_Bool IsAllResizeEnabled() const; 674 675 void SetBorderStyle( sal_uInt16 nBorderStyle ); 676 sal_uInt16 GetBorderStyle() const; 677 void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder, 678 sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const; 679 Size CalcWindowSize( const Size& rOutSz ) const; 680 Size CalcOutputSize( const Size& rWinSz ) const; 681 long CalcTitleWidth() const; 682 683 void EnableClipSiblings( sal_Bool bClipSiblings = sal_True ); 684 sal_Bool IsClipSiblingsEnabled() const; 685 686 void EnableChildTransparentMode( sal_Bool bEnable = sal_True ); 687 sal_Bool IsChildTransparentModeEnabled() const; 688 689 void SetMouseTransparent( sal_Bool bTransparent ); 690 sal_Bool IsMouseTransparent() const; 691 void SetPaintTransparent( sal_Bool bTransparent ); 692 sal_Bool IsPaintTransparent() const; 693 void SetDialogControlStart( sal_Bool bStart ); 694 sal_Bool IsDialogControlStart() const; 695 void SetDialogControlFlags( sal_uInt16 nFlags ); 696 sal_uInt16 GetDialogControlFlags() const; 697 698 struct PointerState 699 { 700 sal_uLong mnState; // the button state 701 Point maPos; // mouse position in output coordinates 702 }; 703 PointerState GetPointerState(); 704 sal_Bool IsMouseOver(); 705 706 sal_uLong GetCurrentModButtons(); 707 708 void SetInputContext( const InputContext& rInputContext ); 709 const InputContext& GetInputContext() const; 710 void EndExtTextInput( sal_uInt16 nFlags ); 711 sal_Bool IsExtTextInput() const; 712 void SetCursorRect( const Rectangle* pRect = NULL, long nExtTextInputWidth = 0 ); 713 const Rectangle* GetCursorRect() const; 714 long GetCursorExtTextInputWidth() const; 715 716 void EnableChildNotify( sal_Bool bEnable ); 717 sal_Bool IsChildNotify() const; 718 719 using OutputDevice::SetSettings; 720 virtual void SetSettings( const AllSettings& rSettings ); 721 virtual void SetSettings( const AllSettings& rSettings, sal_Bool bChild ); 722 void UpdateSettings( const AllSettings& rSettings, sal_Bool bChild = sal_False ); 723 void NotifyAllChilds( DataChangedEvent& rDCEvt ); 724 725 void SetPointFont( const Font& rFont ); 726 Font GetPointFont() const; 727 void SetZoomedPointFont( const Font& rFont ); 728 long GetDrawPixel( OutputDevice* pDev, long nPixels ) const; 729 Font GetDrawPixelFont( OutputDevice* pDev ) const; 730 void GetFontResolution( sal_Int32& nDPIX, sal_Int32& nDPIY ) const; 731 732 void SetControlFont(); 733 void SetControlFont( const Font& rFont ); 734 Font GetControlFont() const; 735 sal_Bool IsControlFont() const; 736 void SetControlForeground(); 737 void SetControlForeground( const Color& rColor ); 738 Color GetControlForeground() const; 739 sal_Bool IsControlForeground() const; 740 void SetControlBackground(); 741 void SetControlBackground( const Color& rColor ); 742 Color GetControlBackground() const; 743 sal_Bool IsControlBackground() const; 744 745 void SetParentClipMode( sal_uInt16 nMode = 0 ); 746 sal_uInt16 GetParentClipMode() const; 747 748 void SetWindowRegionPixel(); 749 void SetWindowRegionPixel( const Region& rRegion ); 750 const Region& GetWindowRegionPixel() const; 751 sal_Bool IsWindowRegionPixel() const; 752 Region GetWindowClipRegionPixel( sal_uInt16 nFlags = 0 ) const; 753 Region GetPaintRegion() const; 754 sal_Bool IsInPaint() const; 755 // while IsInPaint returns true ExpandPaintClipRegion adds the 756 // submitted region to the paint clip region so you can 757 // paint additional parts of your window if necessary 758 void ExpandPaintClipRegion( const Region& rRegion ); 759 760 void SetParent( Window* pNewParent ); 761 Window* GetParent() const; 762 763 void Show( sal_Bool bVisible = sal_True, sal_uInt16 nFlags = 0 ); Hide(sal_uInt16 nFlags=0)764 void Hide( sal_uInt16 nFlags = 0 ) { Show( sal_False, nFlags ); } 765 sal_Bool IsVisible() const; 766 sal_Bool IsReallyVisible() const; 767 // Do not use this function, use IsReallyVisible() 768 sal_Bool IsParentPathVisible() const; 769 sal_Bool IsReallyShown() const; 770 sal_Bool IsInInitShow() const; 771 772 void Enable( bool bEnable = true, bool bChild = true ); Disable(bool bChild=true)773 void Disable( bool bChild = true ) { Enable( false, bChild ); } 774 sal_Bool IsEnabled() const; 775 776 void EnableInput( sal_Bool bEnable = sal_True, sal_Bool bChild = sal_True ); 777 void EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin, 778 const Window* pExcludeWindow = NULL ); 779 sal_Bool IsInputEnabled() const; 780 781 /** Override <code>EnableInput</code>. This can be necessary due to other people 782 using EnableInput for whole window hierarchies. 783 784 785 <code>AlwaysEnableInput</code> and <code>AlwaysDisableInput</code> are 786 mutually exclusive; the last setter wins. 787 @param bAlways 788 sets always enabled flag 789 790 @param bChild 791 if true children are recursively set to AlwaysEnableInput 792 */ 793 void AlwaysEnableInput( sal_Bool bAlways, sal_Bool bChild = sal_True ); 794 /** returns the current AlwaysEnableInput state 795 @return 796 true if window is in AlwaysEnableInput state 797 */ 798 sal_Bool IsAlwaysEnableInput() const; 799 /** Override <code>EnableInput</code>, counterpart to AlwaysEnableInput. 800 Windows with AlwaysDisableInput will not get key events even if enabled 801 and input enabled.This can be necessary due to other people using EnableInput 802 for whole window hierarchies. 803 804 <code>AlwaysEnableInput</code> and <code>AlwaysDisableInput</code> are 805 mutually exclusive; the last setter wins. 806 807 @param bAlways 808 sets always disable flag 809 810 @param bChild 811 if true children are recursively set to AlwaysDisableInput 812 */ 813 void AlwaysDisableInput( sal_Bool bAlways, sal_Bool bChild = sal_True ); 814 /** returns the current AlwaysDisableInput state 815 @return 816 true if window is in AlwaysEnableInput state 817 */ 818 sal_Bool IsAlwaysDisableInput() const; 819 /** usually event handlers (see AddEventListener and AddChildEventListener) 820 are not called on disabled, modal or input disabled windows. There are however rare cases 821 in which one wants a Window or rather one of its Control subclasses to 822 not evaluate events but still react to those events externally. In these 823 rare cases call SetCallHandlersOnInputDisabled( true ) to have your handler 824 called anyway. 825 826 Currently only mouse events get this special treatment. 827 828 Use this sparingly, chances are if you want to use it you're wroking around 829 the real problem. 830 831 @param bCall 832 Enable/Disable calling event handlers for this disabled, modal or input disabled window. 833 This call is implicity done recursively for possible child windows. 834 */ 835 void SetCallHandlersOnInputDisabled( bool bCall ); 836 /** get state of SetCallHandlersOnInputDisabled 837 838 @returns whether handlers are called regardless of input enabled state 839 */ 840 bool IsCallHandlersOnInputDisabled() const; 841 /** A window is in modal mode if one of its children or subchildren 842 is a running modal window (a modal dialog) 843 844 @returns sal_True if a child or subchild is a running modal window 845 */ 846 sal_Bool IsInModalMode() const; 847 848 void SetActivateMode( sal_uInt16 nMode ); 849 sal_uInt16 GetActivateMode() const; 850 851 void ToTop( sal_uInt16 nFlags = 0 ); 852 void SetZOrder( Window* pRefWindow, sal_uInt16 nFlags ); 853 void EnableAlwaysOnTop( sal_Bool bEnable = sal_True ); 854 sal_Bool IsAlwaysOnTopEnabled() const; 855 856 virtual void SetPosSizePixel( long nX, long nY, 857 long nWidth, long nHeight, 858 sal_uInt16 nFlags = WINDOW_POSSIZE_ALL ); 859 virtual void SetPosPixel( const Point& rNewPos ); 860 virtual Point GetPosPixel() const; 861 virtual void SetSizePixel( const Size& rNewSize ); 862 virtual Size GetSizePixel() const; 863 virtual void SetPosSizePixel( const Point& rNewPos, 864 const Size& rNewSize ); 865 virtual void SetOutputSizePixel( const Size& rNewSize ); 866 sal_Bool IsDefaultPos() const; 867 sal_Bool IsDefaultSize() const; 868 869 // those conversion routines might deliver different results during UI mirroring 870 Point OutputToScreenPixel( const Point& rPos ) const; 871 Point ScreenToOutputPixel( const Point& rPos ) const; 872 // the normalized screen methods work independent from UI mirroring 873 Point OutputToNormalizedScreenPixel( const Point& rPos ) const; 874 Point NormalizedScreenToOutputPixel( const Point& rPos ) const; 875 Point OutputToAbsoluteScreenPixel( const Point& rPos ) const; 876 Point AbsoluteScreenToOutputPixel( const Point& rPos ) const; 877 Rectangle GetDesktopRectPixel() const; 878 // window extents including border and decoratrion 879 Rectangle GetWindowExtentsRelative( Window *pRelativeWindow ) const; 880 // window extents of the client window, coordinates to be used in SetPosPixel 881 Rectangle GetClientWindowExtentsRelative( Window *pRelativeWindow ) const; 882 883 virtual sal_Bool IsScrollable() const; 884 virtual void Scroll( long nHorzScroll, long nVertScroll, 885 sal_uInt16 nFlags = 0 ); 886 virtual void Scroll( long nHorzScroll, long nVertScroll, 887 const Rectangle& rRect, sal_uInt16 nFlags = 0 ); 888 virtual void Invalidate( sal_uInt16 nFlags = 0 ); 889 virtual void Invalidate( const Rectangle& rRect, sal_uInt16 nFlags = 0 ); 890 virtual void Invalidate( const Region& rRegion, sal_uInt16 nFlags = 0 ); 891 void Validate( sal_uInt16 nFlags = 0 ); 892 void Validate( const Rectangle& rRect, sal_uInt16 nFlags = 0 ); 893 void Validate( const Region& rRegion, sal_uInt16 nFlags = 0 ); 894 sal_Bool HasPaintEvent() const; 895 void Update(); 896 void Flush(); 897 void Sync(); 898 899 // toggles new docking support, enabled via toolkit 900 void EnableDocking( sal_Bool bEnable = sal_True ); 901 // retrieves the single dockingmanager instance 902 static DockingManager* GetDockingManager(); 903 904 void EnablePaint( sal_Bool bEnable ); 905 sal_Bool IsPaintEnabled() const; 906 void SetUpdateMode( sal_Bool bUpdate ); 907 sal_Bool IsUpdateMode() const; 908 void SetParentUpdateMode( sal_Bool bUpdate ); 909 sal_Bool IsParentUpdateMode() const; 910 911 void GrabFocus(); 912 sal_Bool HasFocus() const; 913 sal_Bool HasChildPathFocus( sal_Bool bSystemWindow = sal_False ) const; 914 sal_Bool IsActive() const; 915 sal_Bool HasActiveChildFrame(); 916 sal_uInt16 GetGetFocusFlags() const; 917 void GrabFocusToDocument(); 918 919 /** 920 * Set this when you need to act as if the window has focus even if it 921 * doesn't. This is necessary for implementing tab stops inside floating 922 * windows, but floating windows don't get focus from the system. 923 */ 924 void SetFakeFocus( bool bFocus ); 925 926 sal_Bool IsCompoundControl() const; 927 sal_Bool HasCompoundControlFocus() const; 928 929 static sal_uIntPtr SaveFocus(); 930 static sal_Bool EndSaveFocus( sal_uIntPtr nSaveId, sal_Bool bRestore = sal_True ); 931 932 void CaptureMouse(); 933 void ReleaseMouse(); 934 sal_Bool IsMouseCaptured() const; 935 936 void SetPointer( const Pointer& rPointer ); 937 const Pointer& GetPointer() const; 938 void EnableChildPointerOverwrite( sal_Bool bOverwrite = sal_True ); 939 sal_Bool IsChildPointerOverwrite() const; 940 void SetPointerPosPixel( const Point& rPos ); 941 Point GetPointerPosPixel(); 942 Point GetLastPointerPosPixel(); 943 void ShowPointer( sal_Bool bVisible ); 944 sal_Bool IsPointerVisible() const; 945 void EnterWait(); 946 void LeaveWait(); 947 sal_Bool IsWait() const; 948 949 void SetCursor( Cursor* pCursor ); 950 Cursor* GetCursor() const; 951 952 void SetZoom( const Fraction& rZoom ); 953 const Fraction& GetZoom() const; 954 sal_Bool IsZoom() const; 955 long CalcZoom( long n ) const; 956 957 virtual void SetText( const XubString& rStr ); 958 virtual String GetText() const; 959 // return the actual text displayed 960 // this may have e.g. accellerators removed or portions 961 // replaced by ellipsis 962 virtual String GetDisplayText() const; 963 // gets the visible background color. for transparent windows 964 // this may be the parent's background color; for controls 965 // this may be a child's background color (e.g. ListBox) 966 virtual const Wallpaper& GetDisplayBackground() const; 967 968 void SetHelpText( const XubString& rHelpText ); 969 const XubString& GetHelpText() const; 970 971 void SetQuickHelpText( const XubString& rHelpText ); 972 const XubString& GetQuickHelpText() const; 973 974 void SetHelpId( const rtl::OString& ); 975 const rtl::OString& GetHelpId() const; 976 977 void SetUniqueId( const rtl::OString& ); 978 const rtl::OString& GetUniqueId() const; 979 const rtl::OString& GetUniqueOrHelpId() const; 980 981 Window* FindWindow( const Point& rPos ) const; 982 983 sal_uInt16 GetChildCount() const; 984 Window* GetChild( sal_uInt16 nChild ) const; 985 Window* GetWindow( sal_uInt16 nType ) const; 986 sal_Bool IsChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const; 987 sal_Bool IsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const; 988 989 void SetData( void* pNewData ); 990 void* GetData() const; 991 992 // Should be merged in the next top level build !!! 993 Bitmap SnapShot( sal_Bool bBorder ) const; 994 Bitmap SnapShot() const; 995 996 void ShowFocus( const Rectangle& rRect ); 997 void HideFocus(); 998 999 void Invert( const Rectangle& rRect, sal_uInt16 nFlags = 0 ); 1000 void Invert( const Polygon& rPoly, sal_uInt16 nFlags = 0 ); 1001 1002 // transparent background for selected or checked items in toolboxes etc. 1003 void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly ); 1004 // the same, but fills a passed Color with a text color complementing the selection background 1005 void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, Color* pSelectionTextColor ); 1006 // support rounded edges in the selection rect 1007 void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, long nCornerRadius, Color* pSelectionTextColor, Color* pPaintColor ); 1008 1009 void ShowTracking( const Rectangle& rRect, 1010 sal_uInt16 nFlags = SHOWTRACK_SMALL ); 1011 void HideTracking(); 1012 void InvertTracking( const Rectangle& rRect, 1013 sal_uInt16 nFlags = SHOWTRACK_SMALL ); 1014 void InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags = 0 ); 1015 1016 void StartTracking( sal_uInt16 nFlags = 0 ); 1017 void EndTracking( sal_uInt16 nFlags = 0 ); 1018 sal_Bool IsTracking() const; 1019 1020 void StartAutoScroll( sal_uInt16 nFlags ); 1021 void EndAutoScroll(); 1022 sal_Bool IsAutoScroll() const; 1023 1024 sal_Bool HandleScrollCommand( const CommandEvent& rCmd, 1025 ScrollBar* pHScrl = NULL, 1026 ScrollBar* pVScrl = NULL ); 1027 1028 void SaveBackground( const Point& rPos, const Size& rSize, 1029 const Point& rDestOff, VirtualDevice& rSaveDevice ); 1030 1031 const SystemEnvData* GetSystemData() const; 1032 ::com::sun::star::uno::Any GetSystemDataAny() const; 1033 1034 // API zum Setzen/Abfragen des Komponenteninterfaces 1035 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > GetComponentInterface( sal_Bool bCreate = sal_True ); 1036 virtual void SetComponentInterface( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xIFace ); 1037 1038 // Accessibility 1039 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True ); 1040 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); 1041 void SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ); 1042 1043 Window* GetAccessibleParentWindow() const; 1044 sal_uInt16 GetAccessibleChildWindowCount(); 1045 Window* GetAccessibleChildWindow( sal_uInt16 n ); 1046 1047 void SetAccessibleRole( sal_uInt16 nRole ); 1048 sal_uInt16 GetAccessibleRole() const; 1049 1050 void SetAccessibleName( const String& rName ); 1051 String GetAccessibleName() const; 1052 1053 void SetAccessibleDescription( const String& rDescr ); 1054 String GetAccessibleDescription() const; 1055 1056 void SetAccessibleRelationLabeledBy( Window* pLabeledBy ); 1057 Window* GetAccessibleRelationLabeledBy() const; 1058 1059 void SetAccessibleRelationLabelFor( Window* pLabelFor ); 1060 Window* GetAccessibleRelationLabelFor() const; 1061 1062 void SetAccessibleRelationMemberOf( Window* pMemberOf ); 1063 Window* GetAccessibleRelationMemberOf() const; 1064 1065 1066 // to avoid sending accessibility events in cases like closing dialogs 1067 // by default checks complete parent path 1068 sal_Bool IsAccessibilityEventsSuppressed( sal_Bool bTraverseParentPath = sal_True ); 1069 void SetAccessibilityEventsSuppressed(sal_Bool bSuppressed); 1070 1071 /// request XCanvas render interface for this window 1072 ::com::sun::star::uno::Reference< 1073 ::com::sun::star::rendering::XCanvas > GetCanvas() const; 1074 /// request XSpriteCanvas render interface for this window 1075 ::com::sun::star::uno::Reference< 1076 ::com::sun::star::rendering::XSpriteCanvas > GetSpriteCanvas() const; 1077 /// request fullscreen XSpriteCanvas render interface for this window 1078 ::com::sun::star::uno::Reference< 1079 ::com::sun::star::rendering::XSpriteCanvas > GetFullscreenSpriteCanvas( const Size& rFullscreenSize ) const; 1080 1081 /* records all DrawText operations within the passed rectangle; 1082 * a synchronous paint is sent to achieve this 1083 */ 1084 void RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& rRect ); 1085 1086 // Setzen und Abfragen fuer das Toolkit 1087 VCLXWindow* GetWindowPeer() const; 1088 void SetWindowPeer( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer, VCLXWindow* pVCLXWindow ); 1089 1090 // Merken, ob vom Toolkit erzeugt 1091 sal_Bool IsCreatedWithToolkit() const; 1092 void SetCreatedWithToolkit( sal_Bool b ); 1093 1094 // Deprecated - can use SetAccessibleRelationLabelFor/By nowadys 1095 virtual Window* GetParentLabelFor( const Window* pLabel ) const; 1096 virtual Window* GetParentLabeledBy( const Window* pLabeled ) const; 1097 KeyEvent GetActivationKey() const; 1098 1099 // Drag and Drop interfaces 1100 virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > GetDropTarget(); 1101 virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > GetDragSource(); 1102 virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer > GetDragGestureRecognizer(); 1103 // only for RVP transmission 1104 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 ); 1105 1106 // Clipboard/Selection interfaces 1107 virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetClipboard(); 1108 virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetPrimarySelection(); 1109 1110 // Advisory Sizing - what is a good size for this widget ? 1111 virtual Size GetOptimalSize(WindowSizeType eType) const; 1112 1113 //------------------------------------- 1114 // Native Widget Rendering functions 1115 //------------------------------------- 1116 1117 // form controls must never use native widgets, this can be toggled here 1118 void EnableNativeWidget( sal_Bool bEnable = sal_True ); 1119 sal_Bool IsNativeWidgetEnabled() const; 1120 1121 // a helper method for a Control's Draw method 1122 void PaintToDevice( OutputDevice* pDevice, const Point& rPos, const Size& rSize ); 1123 1124 /* mark Window for deletion in top of event queue 1125 */ 1126 void doLazyDelete(); 1127 1128 // let the window intercept the KeyDown messages of the system children 1129 void InterceptChildWindowKeyDown( sal_Bool bIntercept ); 1130 1131 virtual XubString GetSurroundingText() const; 1132 virtual Selection GetSurroundingTextSelection() const; 1133 1134 // ExtImpl 1135 1136 // layouting 1137 boost::shared_ptr< vcl::WindowArranger > getLayout(); 1138 1139 /* add a child Window 1140 addWindow will do the following things 1141 - insert the passed window into the child list (equivalent to i_pWin->SetParent( this )) 1142 - mark the window as "owned", meaning that the added Window will be destroyed by 1143 the parent's desctructor. 1144 This means: do not pass in member windows or stack objects here. Do not cause 1145 the destructor of the added window to be called in any way. 1146 1147 to avoid ownership pass i_bTakeOwnership as "false" 1148 */ 1149 void addWindow( Window* i_pWin, bool i_bTakeOwnership = true ); 1150 1151 /* remove a child Window 1152 the remove window functions will 1153 - reparent the searched window (equivalent to i_pWin->SetParent( i_pNewParent )) 1154 - return a pointer to the removed window or NULL if i_pWin was not found 1155 caution: ownership passes to the new parent or the caller, if the new parent was NULL 1156 */ 1157 Window* removeWindow( Window* i_pWin, Window* i_pNewParent = NULL ); 1158 1159 /* return the identifier of this window 1160 */ 1161 const rtl::OUString& getIdentifier() const; 1162 /* set an identifier 1163 identifiers have only loosely defined rules per se 1164 in context of Window they must be unique over the window 1165 hierarchy you'd like to find them again using the findWindow method 1166 */ 1167 void setIdentifier( const rtl::OUString& ); 1168 1169 /* returns the first found descendant that matches 1170 the passed identifier or NULL 1171 */ 1172 Window* findWindow( const rtl::OUString& ) const; 1173 1174 /* get/set properties 1175 this will contain window properties (like visible, enabled) 1176 as well as properties of derived classes (e.g. text of Edit fields) 1177 */ 1178 virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getProperties() const; 1179 /* 1180 */ 1181 virtual void setProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& ); 1182 1183 1184 void EnableThemeSupport (void); 1185 void DisableThemeSupport (void); 1186 1187 virtual ImplBorderWindow* CreateBorderWindow ( 1188 Window* pParent, 1189 const WinBits nStyle, 1190 const sal_uInt16 nTypeStyle); 1191 }; 1192 1193 1194 #endif // _SV_WINDOW_HXX 1195