LibreOffice Module vcl (master)  1
window.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_VCL_WINDOW_HXX
21 #define INCLUDED_VCL_WINDOW_HXX
22 
23 #include <tools/solar.h>
24 #include <vcl/dllapi.h>
25 #include <vcl/outdev.hxx>
26 #include <tools/link.hxx>
27 #include <tools/wintypes.hxx>
28 #include <vcl/vclenum.hxx>
29 #include <vcl/keycodes.hxx>
30 #include <vcl/region.hxx>
31 #include <vcl/uitest/factory.hxx>
33 #include <rtl/ustring.hxx>
34 #include <com/sun/star/uno/Reference.hxx>
35 #include <memory>
36 
37 class VirtualDevice;
38 struct ImplSVEvent;
39 struct ImplWinData;
40 struct ImplFrameData;
41 struct ImplCalcToTopData;
42 struct SystemEnvData;
43 struct SystemParentData;
44 class ImplBorderWindow;
45 class Timer;
46 class DockingManager;
47 class ScrollBar;
48 class FixedText;
49 class MouseEvent;
50 class KeyEvent;
51 class CommandEvent;
52 class TrackingEvent;
53 class HelpEvent;
54 class DataChangedEvent;
55 class VclSimpleEvent;
56 class NotifyEvent;
57 class SystemWindow;
58 class SalFrame;
59 class MenuFloatingWindow;
60 class VCLXWindow;
61 class VclWindowEvent;
62 class AllSettings;
63 class InputContext;
64 enum class ImplPaintFlags;
65 enum class VclEventId;
66 enum class PointerStyle;
67 
68 namespace com::sun::star {
69  namespace accessibility {
70  struct AccessibleRelation;
71  class XAccessible;
72  }
73  namespace rendering {
74  class XCanvas;
75  class XSpriteCanvas;
76  }
77  namespace awt {
78  class XWindowPeer;
79  }
80  namespace uno {
81  class Any;
82  }
83  namespace datatransfer::clipboard {
84  class XClipboard;
85  }
86  namespace datatransfer::dnd {
87  class XDragGestureRecognizer;
88  class XDragSource;
89  class XDropTarget;
90  }
91 }
92 
93 namespace vcl {
94  struct ControlLayoutData;
95 }
96 
97 namespace svt { class PopupWindowControllerImpl; }
98 
99 namespace weld { class Window; }
100 
101 template<class T> class VclPtr;
102 namespace tools { class JsonWriter; }
103 
105 {
106  NONE = 0x0000,
107  Cancel = 0x0001,
108  Key = 0x0002,
109  Focus = 0x0004,
110  Repeat = 0x0100,
111  End = 0x1000,
112 };
113 namespace o3tl
114 {
115  template<> struct typed_flags<TrackingEventFlags> : is_typed_flags<TrackingEventFlags, 0x1107> {};
116 }
117 
118 
119 // Type for GetWindow()
120 enum class GetWindowType
121 {
122  Parent = 0,
123  FirstChild = 1,
124  LastChild = 2,
125  Prev = 3,
126  Next = 4,
127  FirstOverlap = 5,
128  Overlap = 7,
129  ParentOverlap = 8,
130  Client = 9,
131  RealParent = 10,
132  Frame = 11,
133  Border = 12,
134  FirstTopWindowChild = 13,
136 };
137 
138 // Flags for setPosSizePixel()
139 // These must match the definitions in css::awt::PosSize
140 enum class PosSizeFlags
141 {
142  NONE = 0x0000,
143  X = 0x0001,
144  Y = 0x0002,
145  Width = 0x0004,
146  Height = 0x0008,
147  Pos = X | Y,
148  Size = Width | Height,
149  PosSize = Pos | Size,
150  All = PosSize,
151 };
152 
153 namespace o3tl
154 {
155  template<> struct typed_flags<PosSizeFlags> : is_typed_flags<PosSizeFlags, 0x000f> {};
156 }
157 
158 // Flags for Show()
159 enum class ShowFlags
160 {
161  NONE = 0x0000,
162  NoFocusChange = 0x0002,
163  NoActivate = 0x0004,
164  ForegroundTask = 0x0008,
165 };
166 namespace o3tl
167 {
168  template<> struct typed_flags<ShowFlags> : is_typed_flags<ShowFlags, 0x000e> {};
169 }
170 
171 // Flags for SetZOrder()
172 enum class ZOrderFlags
173 {
174  NONE = 0x0000,
175  Before = 0x0001,
176  Behind = 0x0002,
177  First = 0x0004,
178  Last = 0x0008,
179 };
180 namespace o3tl
181 {
182  template<> struct typed_flags<ZOrderFlags> : is_typed_flags<ZOrderFlags, 0x000f> {};
183 }
184 
185 // Activate-Flags
187 {
188  NONE = 0,
189  GrabFocus = 0x0001,
190 };
191 namespace o3tl
192 {
193  template<> struct typed_flags<ActivateModeFlags> : is_typed_flags<ActivateModeFlags, 0x0001> {};
194 }
195 
196 // ToTop-Flags
197 enum class ToTopFlags
198 {
199  NONE = 0x0000,
200  RestoreWhenMin = 0x0001,
201  ForegroundTask = 0x0002,
202  NoGrabFocus = 0x0004,
203  GrabFocusOnly = 0x0008,
204 };
205 namespace o3tl
206 {
207  template<> struct typed_flags<ToTopFlags> : is_typed_flags<ToTopFlags, 0x000f> {};
208 }
209 
210 // Flags for Invalidate
211 // must match css::awt::InvalidateStyle
212 enum class InvalidateFlags
213 {
214  NONE = 0x0000,
216  Children = 0x0001,
218  NoChildren = 0x0002,
220  NoErase = 0x0004,
222  Update = 0x0008,
224  Transparent = 0x0010,
226  NoTransparent = 0x0020,
228  NoClipChildren = 0x4000,
229 };
230 namespace o3tl
231 {
232  template<> struct typed_flags<InvalidateFlags> : is_typed_flags<InvalidateFlags, 0x403f> {};
233 }
234 
235 // Flags for Validate
236 enum class ValidateFlags
237 {
238  NONE = 0x0000,
239  Children = 0x0001,
240  NoChildren = 0x0002
241 };
242 namespace o3tl
243 {
244  template<> struct typed_flags<ValidateFlags> : is_typed_flags<ValidateFlags, 0x0003> {};
245 }
246 
247 // Flags for Scroll
248 enum class ScrollFlags
249 {
250  NONE = 0x0000,
251  Clip = 0x0001,
252  Children = 0x0002,
253  NoChildren = 0x0004,
254  UseClipRegion = 0x0008,
255  Update = 0x0010,
256 };
257 namespace o3tl
258 {
259  template<> struct typed_flags<ScrollFlags> : is_typed_flags<ScrollFlags, 0x001f> {};
260 }
261 
262 // Flags for ParentClipMode
263 enum class ParentClipMode
264 {
265  NONE = 0x0000,
266  Clip = 0x0001,
267  NoClip = 0x0002,
268 };
269 namespace o3tl
270 {
271  template<> struct typed_flags<ParentClipMode> : is_typed_flags<ParentClipMode, 0x0003> {};
272 }
273 
274 // Flags for ShowTracking()
275 enum class ShowTrackFlags {
276  NONE = 0x0000,
277  Small = 0x0001,
278  Big = 0x0002,
279  Split = 0x0003,
280  Object = 0x0004,
281  StyleMask = 0x000F,
282  TrackWindow = 0x1000,
283  Clip = 0x2000,
284 };
285 namespace o3tl
286 {
287  template<> struct typed_flags<ShowTrackFlags> : is_typed_flags<ShowTrackFlags, 0x300f> {};
288 }
289 
290 // Flags for StartTracking()
292 {
293  NONE = 0x0001,
294  KeyMod = 0x0002,
295  ScrollRepeat = 0x0004,
296  ButtonRepeat = 0x0008,
297 };
298 
299 namespace o3tl
300 {
301  template<> struct typed_flags<StartTrackingFlags> : is_typed_flags<StartTrackingFlags, 0x000f> {};
302 }
303 
304 // Flags for StartAutoScroll()
306 {
307  NONE = 0x0000,
308  Vert = 0x0001,
309  Horz = 0x0002,
310 };
311 namespace o3tl
312 {
313  template<> struct typed_flags<StartAutoScrollFlags> : is_typed_flags<StartAutoScrollFlags, 0x0003> {};
314 }
315 
316 // Flags for StateChanged()
317 enum class StateChangedType : sal_uInt16
318 {
319  InitShow = 1,
320  Visible = 2,
321  UpdateMode = 3,
322  Enable = 4,
323  Text = 5,
324  Data = 7,
325  State = 8,
326  Style = 9,
327  Zoom = 10,
328  ControlFont = 13,
329  ControlForeground = 14,
330  ControlBackground = 15,
331  ReadOnly = 16,
332  Mirroring = 18,
333  Layout = 19,
334  ControlFocus = 20
335 };
336 
337 // GetFocusFlags
338 // must match constants in css:awt::FocusChangeReason
339 enum class GetFocusFlags
340 {
341  NONE = 0x0000,
342  Tab = 0x0001,
343  CURSOR = 0x0002, // avoid name-clash with X11 #define
344  Mnemonic = 0x0004,
345  F6 = 0x0008,
346  Forward = 0x0010,
347  Backward = 0x0020,
348  Around = 0x0040,
349  UniqueMnemonic = 0x0100,
350  Init = 0x0200,
352 };
353 namespace o3tl
354 {
355  template<> struct typed_flags<GetFocusFlags> : is_typed_flags<GetFocusFlags, 0x077f> {};
356 }
357 
358 
359 // Flags for Draw()
360 enum class DrawFlags
361 {
362  NONE = 0x0000,
363  Mono = 0x0001,
364  NoControls = 0x0004,
365 };
366 namespace o3tl
367 {
368  template<> struct typed_flags<DrawFlags> : is_typed_flags<DrawFlags, 0x0005> {};
369 }
370 
371 // DialogControl-Flags
373 {
374  NONE = 0x0000,
375  Return = 0x0001,
376  WantFocus = 0x0002,
378 };
379 namespace o3tl
380 {
381  template<> struct typed_flags<DialogControlFlags> : is_typed_flags<DialogControlFlags, 0x0007> {};
382 }
383 
384 // EndExtTextInput() Flags
386 {
387  NONE = 0x0000,
388  Complete = 0x0001
389 };
390 namespace o3tl
391 {
392  template<> struct typed_flags<EndExtTextInputFlags> : is_typed_flags<EndExtTextInputFlags, 0x0001> {};
393 }
394 
395 #define IMPL_MINSIZE_BUTTON_WIDTH 70
396 #define IMPL_MINSIZE_BUTTON_HEIGHT 22
397 #define IMPL_EXTRA_BUTTON_WIDTH 18
398 #define IMPL_EXTRA_BUTTON_HEIGHT 10
399 #define IMPL_SEP_BUTTON_X 5
400 #define IMPL_SEP_BUTTON_Y 5
401 #define IMPL_MINSIZE_MSGBOX_WIDTH 150
402 #define IMPL_DIALOG_OFFSET 5
403 #define IMPL_DIALOG_BAR_OFFSET 3
404 #define IMPL_MSGBOX_OFFSET_EXTRA_X 0
405 #define IMPL_MSGBOX_OFFSET_EXTRA_Y 2
406 #define IMPL_SEP_MSGBOX_IMAGE 8
407 
408 // ImplGetDlgWindow()
410 {
411  Prev, Next, First
412 };
413 
414 
415 #ifdef DBG_UTIL
416 const char* ImplDbgCheckWindow( const void* pObj );
417 #endif
418 
419 namespace vcl { class Window; }
420 namespace vcl { class Cursor; }
421 class Dialog;
422 class Edit;
423 class WindowImpl;
424 class PaintHelper;
425 class VclSizeGroup;
426 class Application;
427 class WorkWindow;
428 class MessBox;
429 class MessageDialog;
430 class DockingWindow;
431 class FloatingWindow;
432 class GroupBox;
433 class PushButton;
434 class RadioButton;
435 class SystemChildWindow;
437 class ImplPopupFloatWin;
438 class LifecycleTest;
439 
440 
441 enum class WindowHitTest {
442  NONE = 0x0000,
443  Inside = 0x0001,
444  Transparent = 0x0002
445 };
446 namespace o3tl {
447  template<> struct typed_flags<WindowHitTest> : is_typed_flags<WindowHitTest, 0x0003> {};
448 };
449 
450 
452  NONE = 0x0000,
453  Document = 0x0001,
454  DocModified = 0x0002,
459  DocHidden = 0x0004,
460 };
461 namespace o3tl {
462  template<> struct typed_flags<WindowExtendedStyle> : is_typed_flags<WindowExtendedStyle, 0x0007> {};
463 };
464 
465 namespace vcl {
466 
468 {
469 public:
470  // transparent background for selected or checked items in toolboxes etc.
471  // + selection Color with a text color complementing the selection background
472  // + rounded edge
473  static void DrawSelectionBackground(vcl::RenderContext& rRenderContext, vcl::Window const & rWindow,
474  const tools::Rectangle& rRect, sal_uInt16 nHighlight,
475  bool bChecked, bool bDrawBorder, bool bDrawExtBorderOnly,
476  Color* pSelectionTextColor = nullptr, tools::Long nCornerRadius = 0,
477  Color const * pPaintColor = nullptr);
478 };
479 
481 {
482  friend class ::vcl::Cursor;
483  friend class ::OutputDevice;
484  friend class ::Application;
485  friend class ::SystemWindow;
486  friend class ::WorkWindow;
487  friend class ::Dialog;
488  friend class ::Edit;
489  friend class ::MessBox;
490  friend class ::MessageDialog;
491  friend class ::DockingWindow;
492  friend class ::FloatingWindow;
493  friend class ::GroupBox;
494  friend class ::PushButton;
495  friend class ::RadioButton;
496  friend class ::SystemChildWindow;
497  friend class ::ImplBorderWindow;
498  friend class ::PaintHelper;
499  friend class ::LifecycleTest;
500 
501  // TODO: improve missing functionality
502  // only required because of SetFloatingMode()
503  friend class ::ImplDockingWindowWrapper;
504  friend class ::ImplPopupFloatWin;
505  friend class ::MenuFloatingWindow;
506 
507  friend class ::svt::PopupWindowControllerImpl;
508 
509 private:
510  // NOTE: to remove many dependencies of other modules
511  // to this central file, all members are now hidden
512  // in the WindowImpl class and all inline functions
513  // were removed.
514  // (WindowImpl is a pImpl pattern)
515 
516  // Please do *not* add new members or inline functions to class Window,
517  // but use class WindowImpl instead
518 
519  std::unique_ptr<WindowImpl> mpWindowImpl;
520 
521 #ifdef DBG_UTIL
522  friend const char* ::ImplDbgCheckWindow( const void* pObj );
523 #endif
524 
525 public:
526 
527  DECL_DLLPRIVATE_LINK( ImplHandlePaintHdl, Timer*, void );
528  DECL_DLLPRIVATE_LINK( ImplGenerateMouseMoveHdl, void*, void );
529  DECL_DLLPRIVATE_LINK( ImplTrackTimerHdl, Timer*, void );
530  DECL_DLLPRIVATE_LINK( ImplAsyncFocusHdl, void*, void );
531  DECL_DLLPRIVATE_LINK( ImplHandleResizeTimerHdl, Timer*, void );
532 
533 
534  SAL_DLLPRIVATE static void ImplInitAppFontData( vcl::Window const * pWindow );
535 
536  SAL_DLLPRIVATE vcl::Window* ImplGetFrameWindow() const;
537  weld::Window* GetFrameWeld() const;
538  vcl::Window* GetFrameWindow() const;
539  SalFrame* ImplGetFrame() const;
540  SAL_DLLPRIVATE ImplFrameData* ImplGetFrameData();
541 
542  vcl::Window* ImplGetWindow() const;
543  SAL_DLLPRIVATE ImplWinData* ImplGetWinData() const;
544  SAL_DLLPRIVATE vcl::Window* ImplGetClientWindow() const;
545  SAL_DLLPRIVATE vcl::Window* ImplGetDlgWindow( sal_uInt16 n, GetDlgWindowType nType, sal_uInt16 nStart = 0, sal_uInt16 nEnd = 0xFFFF, sal_uInt16* pIndex = nullptr );
546  SAL_DLLPRIVATE vcl::Window* ImplGetParent() const;
547  SAL_DLLPRIVATE vcl::Window* ImplFindWindow( const Point& rFramePos );
548 
549  SAL_DLLPRIVATE void ImplInvalidateFrameRegion( const vcl::Region* pRegion, InvalidateFlags nFlags );
550  SAL_DLLPRIVATE void ImplInvalidateOverlapFrameRegion( const vcl::Region& rRegion );
551 
552  SAL_DLLPRIVATE bool ImplSetClipFlag( bool bSysObjOnlySmaller = false );
553 
554  SAL_DLLPRIVATE bool ImplIsWindowOrChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const;
555  SAL_DLLPRIVATE bool ImplIsChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const;
556  SAL_DLLPRIVATE bool ImplIsFloatingWindow() const;
557  SAL_DLLPRIVATE bool ImplIsPushButton() const;
558  SAL_DLLPRIVATE bool ImplIsSplitter() const;
559  SAL_DLLPRIVATE bool ImplIsOverlapWindow() const;
560 
561  SAL_DLLPRIVATE void ImplIsInTaskPaneList( bool mbIsInTaskList );
562 
563  SAL_DLLPRIVATE WindowImpl* ImplGetWindowImpl() const { return mpWindowImpl.get(); }
564 
565  SAL_DLLPRIVATE Point ImplFrameToOutput( const Point& rPos );
566 
567  SAL_DLLPRIVATE void ImplGrabFocus( GetFocusFlags nFlags );
568  SAL_DLLPRIVATE void ImplGrabFocusToDocument( GetFocusFlags nFlags );
569  SAL_DLLPRIVATE void ImplInvertFocus( const tools::Rectangle& rRect );
570 
571  SAL_DLLPRIVATE PointerStyle ImplGetMousePointer() const;
572  SAL_DLLPRIVATE void ImplCallMouseMove( sal_uInt16 nMouseCode, bool bModChanged = false );
573  SAL_DLLPRIVATE void ImplGenerateMouseMove();
574 
575  SAL_DLLPRIVATE void ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt );
576  SAL_DLLPRIVATE void ImplNotifyIconifiedState( bool bIconified );
577 
578  SAL_DLLPRIVATE void ImplUpdateAll();
579 
580  SAL_DLLPRIVATE void ImplControlFocus( GetFocusFlags nFlags = GetFocusFlags::NONE );
581 
582  SAL_DLLPRIVATE void ImplMirrorFramePos( Point &pt ) const;
583 
584  SAL_DLLPRIVATE void ImplPosSizeWindow( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags );
585 
586  SAL_DLLPRIVATE void ImplCallResize();
587  SAL_DLLPRIVATE void ImplCallMove();
588 
589  void IncModalCount();
590  void DecModalCount();
591 
592  SAL_DLLPRIVATE static void ImplCalcSymbolRect( tools::Rectangle& rRect );
593 
594 protected:
595 
597  virtual void dispose() override;
598 
599  SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData );
600 
601  SAL_DLLPRIVATE Point ImplOutputToFrame( const Point& rPos );
602 
603  SAL_DLLPRIVATE void ImplInvalidateParentFrameRegion( vcl::Region& rRegion );
604  SAL_DLLPRIVATE void ImplValidateFrameRegion( const vcl::Region* rRegion, ValidateFlags nFlags );
605  SAL_DLLPRIVATE void ImplValidate();
606  SAL_DLLPRIVATE void ImplMoveInvalidateRegion( const tools::Rectangle& rRect, tools::Long nHorzScroll, tools::Long nVertScroll, bool bChildren );
607  SAL_DLLPRIVATE void ImplMoveAllInvalidateRegions( const tools::Rectangle& rRect, tools::Long nHorzScroll, tools::Long nVertScroll, bool bChildren );
608 
609  SAL_DLLPRIVATE vcl::Window* ImplGetBorderWindow() const;
610 
611  SAL_DLLPRIVATE void ImplInvalidate( const vcl::Region* rRegion, InvalidateFlags nFlags );
612 
613  virtual WindowHitTest ImplHitTest( const Point& rFramePos );
614 
615  SAL_DLLPRIVATE void ImplSetMouseTransparent( bool bTransparent );
616 
617  SAL_DLLPRIVATE void ImplScroll( const tools::Rectangle& rRect, tools::Long nHorzScroll, tools::Long nVertScroll, ScrollFlags nFlags );
618 
619  SAL_DLLPRIVATE bool ImplSetClipFlagChildren( bool bSysObjOnlySmaller );
620  SAL_DLLPRIVATE bool ImplSetClipFlagOverlapWindows( bool bSysObjOnlySmaller = false );
621 
622  SAL_DLLPRIVATE void PushPaintHelper(PaintHelper* pHelper, vcl::RenderContext& rRenderContext);
623  SAL_DLLPRIVATE void PopPaintHelper(PaintHelper const * pHelper);
624 
625 private:
626 
627  SAL_DLLPRIVATE void ImplSetFrameParent( const vcl::Window* pParent );
628 
629  SAL_DLLPRIVATE void ImplInsertWindow( vcl::Window* pParent );
630  SAL_DLLPRIVATE void ImplRemoveWindow( bool bRemoveFrameData );
631 
632  SAL_DLLPRIVATE SalGraphics* ImplGetFrameGraphics() const;
633 
634  SAL_DLLPRIVATE static void ImplCallFocusChangeActivate( vcl::Window* pNewOverlapWindow, vcl::Window* pOldOverlapWindow );
635  SAL_DLLPRIVATE vcl::Window* ImplGetFirstOverlapWindow();
636  SAL_DLLPRIVATE const vcl::Window* ImplGetFirstOverlapWindow() const;
637 
638  SAL_DLLPRIVATE bool ImplIsRealParentPath( const vcl::Window* pWindow ) const;
639 
640  SAL_DLLPRIVATE bool ImplTestMousePointerSet();
641 
642  SAL_DLLPRIVATE void ImplResetReallyVisible();
643  SAL_DLLPRIVATE void ImplSetReallyVisible();
644 
645  SAL_DLLPRIVATE void ImplCallInitShow();
646 
647  SAL_DLLPRIVATE void ImplInitResolutionSettings();
648 
649  SAL_DLLPRIVATE void ImplPointToLogic(vcl::RenderContext const & rRenderContext, vcl::Font& rFont) const;
650  SAL_DLLPRIVATE void ImplLogicToPoint(vcl::RenderContext const & rRenderContext, vcl::Font& rFont) const;
651 
652  SAL_DLLPRIVATE bool ImplSysObjClip( const vcl::Region* pOldRegion );
653  SAL_DLLPRIVATE void ImplUpdateSysObjChildrenClip();
654  SAL_DLLPRIVATE void ImplUpdateSysObjOverlapsClip();
655  SAL_DLLPRIVATE void ImplUpdateSysObjClip();
656 
657  SAL_DLLPRIVATE void ImplIntersectWindowClipRegion( vcl::Region& rRegion );
658  SAL_DLLPRIVATE void ImplIntersectWindowRegion( vcl::Region& rRegion );
659  SAL_DLLPRIVATE void ImplExcludeWindowRegion( vcl::Region& rRegion );
660  SAL_DLLPRIVATE void ImplExcludeOverlapWindows( vcl::Region& rRegion ) const;
661  SAL_DLLPRIVATE void ImplExcludeOverlapWindows2( vcl::Region& rRegion );
662 
663  SAL_DLLPRIVATE void ImplClipBoundaries( vcl::Region& rRegion, bool bThis, bool bOverlaps );
664  SAL_DLLPRIVATE bool ImplClipChildren( vcl::Region& rRegion ) const;
665  SAL_DLLPRIVATE void ImplClipAllChildren( vcl::Region& rRegion ) const;
666  SAL_DLLPRIVATE void ImplClipSiblings( vcl::Region& rRegion ) const;
667 
668  SAL_DLLPRIVATE void ImplInitWinClipRegion();
669  SAL_DLLPRIVATE void ImplInitWinChildClipRegion();
670  SAL_DLLPRIVATE vcl::Region* ImplGetWinChildClipRegion();
671 
672  SAL_DLLPRIVATE void ImplIntersectAndUnionOverlapWindows( const vcl::Region& rInterRegion, vcl::Region& rRegion ) const;
673  SAL_DLLPRIVATE void ImplIntersectAndUnionOverlapWindows2( const vcl::Region& rInterRegion, vcl::Region& rRegion );
674  SAL_DLLPRIVATE void ImplCalcOverlapRegionOverlaps( const vcl::Region& rInterRegion, vcl::Region& rRegion ) const;
675  SAL_DLLPRIVATE void ImplCalcOverlapRegion( const tools::Rectangle& rSourceRect, vcl::Region& rRegion,
676  bool bChildren, bool bSiblings );
677 
684  SAL_DLLPRIVATE void ImplCallPaint(const vcl::Region* pRegion, ImplPaintFlags nPaintFlags);
685 
686  SAL_DLLPRIVATE void ImplCallOverlapPaint();
687 
688  SAL_DLLPRIVATE void ImplUpdateWindowPtr( vcl::Window* pWindow );
689  SAL_DLLPRIVATE void ImplUpdateWindowPtr();
690  SAL_DLLPRIVATE void ImplUpdateOverlapWindowPtr( bool bNewFrame );
691 
692  SAL_DLLPRIVATE bool ImplUpdatePos();
693  SAL_DLLPRIVATE void ImplUpdateSysObjPos();
694 
695  SAL_DLLPRIVATE void ImplUpdateGlobalSettings( AllSettings& rSettings, bool bCallHdl = true ) const;
696 
697  SAL_DLLPRIVATE void ImplToBottomChild();
698 
699  SAL_DLLPRIVATE void ImplCalcToTop( ImplCalcToTopData* pPrevData );
700  SAL_DLLPRIVATE void ImplToTop( ToTopFlags nFlags );
701  SAL_DLLPRIVATE void ImplStartToTop( ToTopFlags nFlags );
702  SAL_DLLPRIVATE void ImplFocusToTop( ToTopFlags nFlags, bool bReallyVisible );
703 
704  SAL_DLLPRIVATE void ImplShowAllOverlaps();
705  SAL_DLLPRIVATE void ImplHideAllOverlaps();
706 
707  SAL_DLLPRIVATE bool ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput );
708  SAL_DLLPRIVATE bool ImplHasDlgCtrl() const;
709  SAL_DLLPRIVATE void ImplDlgCtrlNextWindow();
710  SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged( vcl::Window* pWindow, bool bGetFocus );
711  SAL_DLLPRIVATE vcl::Window* ImplFindDlgCtrlWindow( vcl::Window* pWindow );
712 
713  SAL_DLLPRIVATE static void ImplNewInputContext();
714 
715  SAL_DLLPRIVATE void ImplCallActivateListeners(vcl::Window*);
716  SAL_DLLPRIVATE void ImplCallDeactivateListeners(vcl::Window*);
717 
718  SAL_DLLPRIVATE static void ImplHandleScroll(ScrollBar* pHScrl, double nX, ScrollBar* pVScrl, double nY);
719 
720  SAL_DLLPRIVATE tools::Rectangle ImplOutputToUnmirroredAbsoluteScreenPixel( const tools::Rectangle& rRect ) const;
721  SAL_DLLPRIVATE tools::Rectangle ImplUnmirroredAbsoluteScreenToOutputPixel( const tools::Rectangle& rRect ) const;
722  SAL_DLLPRIVATE tools::Long ImplGetUnmirroredOutOffX();
723 
724  // retrieves the list of owner draw decorated windows for this window hierarchy
725  SAL_DLLPRIVATE ::std::vector<VclPtr<vcl::Window> >& ImplGetOwnerDrawList();
726 
727  SAL_DLLPRIVATE vcl::Window* ImplGetTopmostFrameWindow();
728 
729  SAL_DLLPRIVATE tools::Rectangle ImplGetWindowExtentsRelative(const vcl::Window *pRelativeWindow) const;
730 
731  SAL_DLLPRIVATE bool ImplStopDnd();
732  SAL_DLLPRIVATE void ImplStartDnd();
733 
734  virtual void ImplPaintToDevice( ::OutputDevice* pTargetOutDev, const Point& rPos );
735 
736  SAL_DLLPRIVATE css::uno::Reference< css::rendering::XCanvas >
737  ImplGetCanvas( bool bSpriteCanvas ) const;
738 
739 public:
740  virtual vcl::Region GetActiveClipRegion() const override;
741  virtual vcl::Region GetOutputBoundsClipRegion() const override;
742 
743 protected:
744  // Single argument ctors shall be explicit.
745  explicit Window( WindowType nType );
746 
747  void SetCompoundControl( bool bCompound );
748 
749  void CallEventListeners( VclEventId nEvent, void* pData = nullptr );
750 
751  virtual bool AcquireGraphics() const override;
752  virtual void ReleaseGraphics( bool bRelease = true ) override;
753 
754  virtual void InitClipRegion() override;
755 
756  void ImplClearFontData(bool bNewFontLists) override;
757  void ImplRefreshFontData(bool bNewFontLists) override;
758  void ImplInitMapModeObjects() override;
759 
760  // FIXME: this is a hack to workaround missing layout functionality
761  virtual void ImplAdjustNWFSizes();
762 
763  virtual void CopyDeviceArea( SalTwoRect& aPosAry, bool bWindowInvalidate) override;
764  virtual const OutputDevice* DrawOutDevDirectCheck(const OutputDevice& rSrcDev) const override;
765  virtual void DrawOutDevDirectProcess(const OutputDevice& rSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics) override;
766  virtual void ClipToPaintRegion( tools::Rectangle& rDstRect ) override;
767  virtual bool UsePolyPolygonForComplexGradient() override;
768 
769  virtual void ApplySettings(vcl::RenderContext& rRenderContext);
770 public:
771  bool HasMirroredGraphics() const override;
772 
773 public:
774  // Single argument ctors shall be explicit.
775  explicit Window( vcl::Window* pParent, WinBits nStyle = 0 );
776 
777  virtual ~Window() override;
778 
779  ::OutputDevice const* GetOutDev() const;
780  ::OutputDevice* GetOutDev();
781 
782  bool CanEnableNativeWidget() const override { return IsNativeWidgetEnabled(); }
783 
784  Color GetBackgroundColor() const override;
785 
786  size_t GetSyncCount() const override { return 0x000000ff; }
787  virtual void EnableRTL ( bool bEnable = true ) override;
788  virtual void MouseMove( const MouseEvent& rMEvt );
789  virtual void MouseButtonDown( const MouseEvent& rMEvt );
790  virtual void MouseButtonUp( const MouseEvent& rMEvt );
791  virtual void KeyInput( const KeyEvent& rKEvt );
792  virtual void KeyUp( const KeyEvent& rKEvt );
793  virtual void PrePaint(vcl::RenderContext& rRenderContext);
794  virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect);
795  virtual void PostPaint(vcl::RenderContext& rRenderContext);
796 
797  using OutputDevice::Erase;
798  void Erase(vcl::RenderContext& rRenderContext);
799 
800  virtual void Draw( ::OutputDevice* pDev, const Point& rPos, DrawFlags nFlags );
801  virtual void Move();
802  virtual void Resize();
803  virtual void Activate();
804  virtual void Deactivate();
805  virtual void GetFocus();
806  virtual void LoseFocus();
807  virtual void RequestHelp( const HelpEvent& rHEvt );
808  virtual void Command( const CommandEvent& rCEvt );
809  virtual void Tracking( const TrackingEvent& rTEvt );
810  virtual void StateChanged( StateChangedType nStateChange );
811  virtual void DataChanged( const DataChangedEvent& rDCEvt );
812  virtual bool PreNotify( NotifyEvent& rNEvt );
813  virtual bool EventNotify( NotifyEvent& rNEvt );
814 
815  // These methods call the relevant virtual method when not in/post dispose
816  void CompatGetFocus();
817  void CompatLoseFocus();
818  void CompatStateChanged( StateChangedType nStateChange );
819  void CompatDataChanged( const DataChangedEvent& rDCEvt );
820  bool CompatPreNotify( NotifyEvent& rNEvt );
821  bool CompatNotify( NotifyEvent& rNEvt );
822 
823  void AddEventListener( const Link<VclWindowEvent&,void>& rEventListener );
824  void RemoveEventListener( const Link<VclWindowEvent&,void>& rEventListener );
825  void AddChildEventListener( const Link<VclWindowEvent&,void>& rEventListener );
826  void RemoveChildEventListener( const Link<VclWindowEvent&,void>& rEventListener );
827 
828  ImplSVEvent * PostUserEvent( const Link<void*,void>& rLink, void* pCaller = nullptr, bool bReferenceLink = false );
829  void RemoveUserEvent( ImplSVEvent * nUserEvent );
830 
831  // returns the input language used for the last key stroke
832  // may be LANGUAGE_DONTKNOW if not supported by the OS
833  LanguageType GetInputLanguage() const;
834 
835  void SetStyle( WinBits nStyle );
836  WinBits GetStyle() const;
837  WinBits GetPrevStyle() const;
838  void SetExtendedStyle( WindowExtendedStyle nExtendedStyle );
839  WindowExtendedStyle GetExtendedStyle() const;
840  void SetType( WindowType nType );
841  WindowType GetType() const;
842  bool IsSystemWindow() const;
843  bool IsDockingWindow() const;
844  bool IsDialog() const;
845  bool IsMenuFloatingWindow() const;
846  bool IsToolbarFloatingWindow() const;
847  bool IsTopWindow() const;
848  bool IsDisposed() const;
849  SystemWindow* GetSystemWindow() const;
850 
852  bool SupportsDoubleBuffering() const;
854  void RequestDoubleBuffering(bool bRequest);
855 
856  void EnableAllResize();
857 
858  void SetBorderStyle( WindowBorderStyle nBorderStyle );
859  WindowBorderStyle GetBorderStyle() const;
860  void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
861  sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
862  Size CalcWindowSize( const Size& rOutSz ) const;
863  Size CalcOutputSize( const Size& rWinSz ) const;
864  tools::Long CalcTitleWidth() const;
865 
866  void EnableClipSiblings( bool bClipSiblings = true );
867 
868  void EnableChildTransparentMode( bool bEnable = true );
869  bool IsChildTransparentModeEnabled() const;
870 
871  void SetMouseTransparent( bool bTransparent );
872  bool IsMouseTransparent() const;
873  void SetPaintTransparent( bool bTransparent );
874  bool IsPaintTransparent() const;
875  void SetDialogControlStart( bool bStart );
876  bool IsDialogControlStart() const;
877  void SetDialogControlFlags( DialogControlFlags nFlags );
878  DialogControlFlags GetDialogControlFlags() const;
879 
881  {
882  sal_uLong mnState; // the button state
883  Point maPos; // mouse position in output coordinates
884  };
885  PointerState GetPointerState();
886  bool IsMouseOver() const;
887 
888  void SetInputContext( const InputContext& rInputContext );
889  const InputContext& GetInputContext() const;
890  void PostExtTextInputEvent(VclEventId nType, const OUString& rText);
891  void EndExtTextInput();
892  void SetCursorRect( const tools::Rectangle* pRect = nullptr, tools::Long nExtTextInputWidth = 0 );
893  const tools::Rectangle* GetCursorRect() const;
894  tools::Long GetCursorExtTextInputWidth() const;
895 
896  void SetCompositionCharRect( const tools::Rectangle* pRect, tools::Long nCompositionLength, bool bVertical = false );
897 
898  using ::OutputDevice::SetSettings;
899  virtual void SetSettings( const AllSettings& rSettings ) override;
900  void SetSettings( const AllSettings& rSettings, bool bChild );
901  void UpdateSettings( const AllSettings& rSettings, bool bChild = false );
902  void NotifyAllChildren( DataChangedEvent& rDCEvt );
903 
904  void SetPointFont(vcl::RenderContext& rRenderContext, const vcl::Font& rFont);
905  vcl::Font GetPointFont(vcl::RenderContext const & rRenderContext) const;
906  void SetZoomedPointFont(vcl::RenderContext& rRenderContext, const vcl::Font& rFont);
907  tools::Long GetDrawPixel( ::OutputDevice const * pDev, tools::Long nPixels ) const;
908  vcl::Font GetDrawPixelFont( ::OutputDevice const * pDev ) const;
909 
910  void SetControlFont();
911  void SetControlFont( const vcl::Font& rFont );
912  vcl::Font GetControlFont() const;
913  bool IsControlFont() const;
914  void ApplyControlFont(vcl::RenderContext& rRenderContext, const vcl::Font& rDefaultFont);
915 
916  void SetControlForeground();
917  void SetControlForeground(const Color& rColor);
918  const Color& GetControlForeground() const;
919  bool IsControlForeground() const;
920  void ApplyControlForeground(vcl::RenderContext& rRenderContext, const Color& rDefaultColor);
921 
922  void SetControlBackground();
923  void SetControlBackground( const Color& rColor );
924  const Color& GetControlBackground() const;
925  bool IsControlBackground() const;
926  void ApplyControlBackground(vcl::RenderContext& rRenderContext, const Color& rDefaultColor);
927 
928  void SetParentClipMode( ParentClipMode nMode = ParentClipMode::NONE );
929  ParentClipMode GetParentClipMode() const;
930 
931  void SetWindowRegionPixel();
932  void SetWindowRegionPixel( const vcl::Region& rRegion );
933  vcl::Region GetWindowClipRegionPixel() const;
934  vcl::Region GetPaintRegion() const;
935  bool IsInPaint() const;
936  // while IsInPaint returns true ExpandPaintClipRegion adds the
937  // submitted region to the paint clip region so you can
938  // paint additional parts of your window if necessary
939  void ExpandPaintClipRegion( const vcl::Region& rRegion );
940 
941  void SetParent( vcl::Window* pNewParent );
942  vcl::Window* GetParent() const;
943  // return the dialog we are contained in or NULL if un-contained
944  Dialog* GetParentDialog() const;
945  bool IsAncestorOf( const vcl::Window& rWindow ) const;
946 
947  void Show( bool bVisible = true, ShowFlags nFlags = ShowFlags::NONE );
948  void Hide() { Show( false ); }
949  bool IsVisible() const;
950  bool IsReallyVisible() const;
951  bool IsReallyShown() const;
952  bool IsInInitShow() const;
953 
954  void Enable( bool bEnable = true, bool bChild = true );
955  void Disable( bool bChild = true ) { Enable( false, bChild ); }
956  bool IsEnabled() const;
957 
958  void EnableInput( bool bEnable = true, bool bChild = true );
959  void EnableInput( bool bEnable, const vcl::Window* pExcludeWindow );
960  bool IsInputEnabled() const;
961 
971  void AlwaysEnableInput( bool bAlways, bool bChild = true );
972 
977  bool IsAlwaysEnableInput() const;
978 
984  bool IsInModalMode() const;
985 
986  void SetActivateMode( ActivateModeFlags nMode );
987  ActivateModeFlags GetActivateMode() const;
988 
989  void ToTop( ToTopFlags nFlags = ToTopFlags::NONE );
990  void SetZOrder( vcl::Window* pRefWindow, ZOrderFlags nFlags );
991  void EnableAlwaysOnTop( bool bEnable = true );
992  bool IsAlwaysOnTopEnabled() const;
993 
994  virtual void setPosSizePixel( tools::Long nX, tools::Long nY,
995  tools::Long nWidth, tools::Long nHeight,
996  PosSizeFlags nFlags = PosSizeFlags::All );
997  virtual void SetPosPixel( const Point& rNewPos );
998  virtual Point GetPosPixel() const;
999  virtual void SetSizePixel( const Size& rNewSize );
1000  virtual Size GetSizePixel() const;
1001  virtual void SetPosSizePixel( const Point& rNewPos,
1002  const Size& rNewSize );
1003  virtual void SetOutputSizePixel( const Size& rNewSize );
1004  bool IsDefaultPos() const;
1005  bool IsDefaultSize() const;
1006  Point GetOffsetPixelFrom(const vcl::Window& rWindow) const;
1007 
1008  // those conversion routines might deliver different results during UI mirroring
1009  Point OutputToScreenPixel( const Point& rPos ) const;
1010  Point ScreenToOutputPixel( const Point& rPos ) const;
1011  // the normalized screen methods work independent from UI mirroring
1012  Point OutputToNormalizedScreenPixel( const Point& rPos ) const;
1013  Point NormalizedScreenToOutputPixel( const Point& rPos ) const;
1014  Point OutputToAbsoluteScreenPixel( const Point& rPos ) const;
1015  Point AbsoluteScreenToOutputPixel( const Point& rPos ) const;
1016  tools::Rectangle GetDesktopRectPixel() const;
1017  // window extents including border and decoration
1018  tools::Rectangle GetWindowExtentsRelative(const vcl::Window *pRelativeWindow) const;
1019 
1020  bool IsScrollable() const;
1021  virtual void Scroll( tools::Long nHorzScroll, tools::Long nVertScroll,
1022  ScrollFlags nFlags = ScrollFlags::NONE );
1023  void Scroll( tools::Long nHorzScroll, tools::Long nVertScroll,
1024  const tools::Rectangle& rRect, ScrollFlags nFlags = ScrollFlags::NONE );
1025  virtual void Invalidate( InvalidateFlags nFlags = InvalidateFlags::NONE );
1026  virtual void Invalidate( const tools::Rectangle& rRect, InvalidateFlags nFlags = InvalidateFlags::NONE );
1027  virtual void Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags = InvalidateFlags::NONE );
1034  virtual void LogicInvalidate(const tools::Rectangle* pRectangle);
1035 
1042  virtual void PixelInvalidate(const tools::Rectangle* pRectangle);
1043  void Validate();
1044  bool HasPaintEvent() const;
1045  void PaintImmediately();
1046  void Flush() override;
1047 
1048  // toggles new docking support, enabled via toolkit
1049  void EnableDocking( bool bEnable = true );
1050  // retrieves the single dockingmanager instance
1051  static DockingManager* GetDockingManager();
1052 
1053  void EnablePaint( bool bEnable );
1054  bool IsPaintEnabled() const;
1055  void SetUpdateMode( bool bUpdate );
1056  bool IsUpdateMode() const;
1057  void SetParentUpdateMode( bool bUpdate );
1058 
1059  void GrabFocus();
1060  bool HasFocus() const;
1061  bool HasChildPathFocus( bool bSystemWindow = false ) const;
1062  bool IsActive() const;
1063  bool HasActiveChildFrame() const;
1064  GetFocusFlags GetGetFocusFlags() const;
1065  void GrabFocusToDocument();
1066  VclPtr<vcl::Window> GetFocusedWindow() const;
1067 
1073  void SetFakeFocus( bool bFocus );
1074 
1075  bool IsCompoundControl() const;
1076 
1077  static VclPtr<vcl::Window> SaveFocus();
1078  static void EndSaveFocus(const VclPtr<vcl::Window>& xFocusWin);
1079 
1080  void CaptureMouse();
1081  void ReleaseMouse();
1082  bool IsMouseCaptured() const;
1083 
1084  void SetPointer( PointerStyle );
1085  PointerStyle GetPointer() const;
1086  void EnableChildPointerOverwrite( bool bOverwrite );
1087  void SetPointerPosPixel( const Point& rPos );
1088  Point GetPointerPosPixel();
1089  Point GetLastPointerPosPixel();
1091  void SetLastMousePos(const Point& rPos);
1092  void ShowPointer( bool bVisible );
1093  void EnterWait();
1094  void LeaveWait();
1095  bool IsWait() const;
1096 
1097  void SetCursor( vcl::Cursor* pCursor );
1098  vcl::Cursor* GetCursor() const;
1099 
1100  void SetZoom( const Fraction& rZoom );
1101  const Fraction& GetZoom() const;
1102  bool IsZoom() const;
1103  tools::Long CalcZoom( tools::Long n ) const;
1104 
1105  virtual void SetText( const OUString& rStr );
1106  virtual OUString GetText() const;
1107  // return the actual text displayed
1108  // this may have e.g. accelerators removed or portions
1109  // replaced by ellipses
1110  virtual OUString GetDisplayText() const;
1111  // gets the visible background color. for transparent windows
1112  // this may be the parent's background color; for controls
1113  // this may be a child's background color (e.g. ListBox)
1114  virtual const Wallpaper& GetDisplayBackground() const;
1115 
1116  void SetHelpText( const OUString& rHelpText );
1117  const OUString& GetHelpText() const;
1118 
1119  void SetQuickHelpText( const OUString& rHelpText );
1120  const OUString& GetQuickHelpText() const;
1121 
1122  void SetHelpId( const OString& );
1123  const OString& GetHelpId() const;
1124 
1125  sal_uInt16 GetChildCount() const;
1126  vcl::Window* GetChild( sal_uInt16 nChild ) const;
1127  vcl::Window* GetWindow( GetWindowType nType ) const;
1128  bool IsChild( const vcl::Window* pWindow ) const;
1129  bool IsWindowOrChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const;
1130 
1132  SAL_DLLPRIVATE void CollectChildren(::std::vector<vcl::Window *>& rAllChildren );
1133 
1134  virtual void ShowFocus(const tools::Rectangle& rRect);
1135  void HideFocus();
1136 
1137  // transparent background for selected or checked items in toolboxes etc.
1138  void DrawSelectionBackground( const tools::Rectangle& rRect, sal_uInt16 highlight, bool bChecked, bool bDrawBorder );
1139 
1140  void ShowTracking( const tools::Rectangle& rRect,
1142  void HideTracking();
1143  void InvertTracking( const tools::Rectangle& rRect, ShowTrackFlags nFlags );
1144 
1145  void StartTracking( StartTrackingFlags nFlags = StartTrackingFlags::NONE );
1146  void EndTracking( TrackingEventFlags nFlags = TrackingEventFlags::NONE );
1147  bool IsTracking() const;
1148 
1149  void StartAutoScroll( StartAutoScrollFlags nFlags );
1150  void EndAutoScroll();
1151 
1152  bool HandleScrollCommand( const CommandEvent& rCmd,
1153  ScrollBar* pHScrl,
1154  ScrollBar* pVScrl );
1155 
1156  void SaveBackground(VirtualDevice& rSaveDevice,
1157  const Point& rPos, const Size& rSize, const Size&) const override;
1158 
1159  virtual const SystemEnvData* GetSystemData() const;
1160 
1161  // API to set/query the component interfaces
1162  virtual css::uno::Reference< css::awt::XWindowPeer >
1163  GetComponentInterface( bool bCreate = true );
1164 
1165  void SetComponentInterface( css::uno::Reference< css::awt::XWindowPeer > const & xIFace );
1166 
1168  void SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier, bool bParent = false);
1169  const vcl::ILibreOfficeKitNotifier* GetLOKNotifier() const;
1170  vcl::LOKWindowId GetLOKWindowId() const;
1171 
1173  VclPtr<vcl::Window> GetParentWithLOKNotifier();
1174 
1176  void ReleaseLOKNotifier();
1177 
1179  static VclPtr<vcl::Window> FindLOKWindow(vcl::LOKWindowId nWindowId);
1180 
1182  static bool IsLOKWindowsEmpty();
1183 
1185  virtual void DumpAsPropertyTree(tools::JsonWriter&);
1186 
1188  virtual void LogicMouseButtonDown(const MouseEvent&) {};
1190  virtual void LogicMouseButtonUp(const MouseEvent&) {};
1192  virtual void LogicMouseMove(const MouseEvent&) {};
1193 
1196 public:
1198 
1199  css::uno::Reference< css::accessibility::XAccessible >
1200  GetAccessible( bool bCreate = true );
1201 
1202  virtual css::uno::Reference< css::accessibility::XAccessible >
1203  CreateAccessible();
1204 
1205  void SetAccessible( const css::uno::Reference< css::accessibility::XAccessible >& );
1206 
1207  vcl::Window* GetAccessibleParentWindow() const;
1208  sal_uInt16 GetAccessibleChildWindowCount();
1209  vcl::Window* GetAccessibleChildWindow( sal_uInt16 n );
1210 
1211  void SetAccessibleRole( sal_uInt16 nRole );
1212  sal_uInt16 GetAccessibleRole() const;
1213 
1214  void SetAccessibleName( const OUString& rName );
1215  OUString GetAccessibleName() const;
1216 
1217  void SetAccessibleDescription( const OUString& rDescr );
1218  OUString GetAccessibleDescription() const;
1219 
1220  void SetAccessibleRelationLabeledBy( vcl::Window* pLabeledBy );
1221  vcl::Window* GetAccessibleRelationLabeledBy() const;
1222 
1223  void SetAccessibleRelationLabelFor( vcl::Window* pLabelFor );
1224  vcl::Window* GetAccessibleRelationLabelFor() const;
1225 
1226  void SetAccessibleRelationMemberOf( vcl::Window* pMemberOf );
1227  vcl::Window* GetAccessibleRelationMemberOf() const;
1228 
1229  // to avoid sending accessibility events in cases like closing dialogs
1230  // by default checks complete parent path
1231  bool IsAccessibilityEventsSuppressed( bool bTraverseParentPath = true );
1232  void SetAccessibilityEventsSuppressed(bool bSuppressed);
1233 
1234  KeyEvent GetActivationKey() const;
1235 
1236 protected:
1237 
1238  // These eventually are supposed to go when everything is converted to .ui
1239  SAL_DLLPRIVATE vcl::Window* getLegacyNonLayoutAccessibleRelationMemberOf() const;
1240  SAL_DLLPRIVATE vcl::Window* getLegacyNonLayoutAccessibleRelationLabeledBy() const;
1241  SAL_DLLPRIVATE vcl::Window* getLegacyNonLayoutAccessibleRelationLabelFor() const;
1242 
1243  // Let Label override the code part of GetAccessibleRelationLabelFor
1244  virtual vcl::Window* getAccessibleRelationLabelFor() const;
1245  virtual sal_uInt16 getDefaultAccessibleRole() const;
1246  virtual OUString getDefaultAccessibleName() const;
1247 
1248  /*
1249  * Advisory Sizing - what is a good size for this widget
1250  *
1251  * Retrieves the preferred size of a widget ignoring
1252  * "width-request" and "height-request" properties.
1253  *
1254  * Implement this in sub-classes to tell layout
1255  * the preferred widget size.
1256  *
1257  * Use get_preferred_size to retrieve this value
1258  * cached and mediated via height and width requests
1259  */
1260  virtual Size GetOptimalSize() const;
1262  void InvalidateSizeCache();
1263 private:
1264 
1265  SAL_DLLPRIVATE bool ImplIsAccessibleCandidate() const;
1266  SAL_DLLPRIVATE bool ImplIsAccessibleNativeFrame() const;
1268 
1269  /*
1270  * Retrieves the preferred size of a widget taking
1271  * into account the "width-request" and "height-request" properties.
1272  *
1273  * Overrides the result of GetOptimalSize to honor the
1274  * width-request and height-request properties.
1275  *
1276  * So the same as get_ungrouped_preferred_size except
1277  * it ignores groups. A building block of get_preferred_size
1278  * that access the size cache
1279  *
1280  * @see get_preferred_size
1281  */
1282  Size get_ungrouped_preferred_size() const;
1283 public:
1285  css::uno::Reference< css::rendering::XCanvas >
1286  GetCanvas() const;
1288  css::uno::Reference< css::rendering::XSpriteCanvas >
1289  GetSpriteCanvas() const;
1290 
1291  /* records all DrawText operations within the passed rectangle;
1292  * a synchronous paint is sent to achieve this
1293  */
1294  void RecordLayoutData( vcl::ControlLayoutData* pLayout, const tools::Rectangle& rRect );
1295 
1296  // set and retrieve for Toolkit
1297  VCLXWindow* GetWindowPeer() const;
1298  void SetWindowPeer( css::uno::Reference< css::awt::XWindowPeer > const & xPeer, VCLXWindow* pVCLXWindow );
1299 
1300  // remember if it was generated by Toolkit
1301  bool IsCreatedWithToolkit() const;
1302  void SetCreatedWithToolkit( bool b );
1303 
1304  // Drag and Drop interfaces
1305  css::uno::Reference< css::datatransfer::dnd::XDropTarget > GetDropTarget();
1306  css::uno::Reference< css::datatransfer::dnd::XDragSource > GetDragSource();
1307  css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > GetDragGestureRecognizer();
1308 
1309  // Clipboard/Selection interfaces
1310  css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard();
1312  void SetClipboard(css::uno::Reference<css::datatransfer::clipboard::XClipboard> const & xClipboard);
1313  css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetPrimarySelection();
1314 
1315  /*
1316  * Widgets call this to inform their owner container that the widget wants
1317  * to renegotiate its size. Should be called when a widget has a new size
1318  * request. e.g. a FixedText Control gets a new label.
1319  *
1320  * akin to gtk_widget_queue_resize
1321  */
1322  virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout);
1323 
1324  /*
1325  * Sets the "height-request" property
1326  *
1327  * Override for height request of the widget, or -1 if natural request
1328  * should be used.
1329  *
1330  * @see get_preferred_size, set_width_request
1331  */
1332  void set_height_request(sal_Int32 nHeightRequest);
1333  sal_Int32 get_height_request() const;
1334 
1335  /*
1336  * Sets the "width-request" property
1337  *
1338  * Override for width request of the widget, or -1 if natural request
1339  * should be used.
1340  *
1341  * @see get_preferred_size, set_height_request
1342  */
1343  void set_width_request(sal_Int32 nWidthRequest);
1344  sal_Int32 get_width_request() const;
1345 
1346  /*
1347  * Retrieves the preferred size of a widget taking
1348  * into account the "width-request" and "height-request" properties.
1349  *
1350  * Overrides the result of GetOptimalSize to honor the
1351  * width-request and height-request properties.
1352  *
1353  * @see GetOptimalSize
1354  *
1355  * akin to gtk_widget_get_preferred_size
1356  */
1357  Size get_preferred_size() const;
1358 
1359  /*
1360  * How to horizontally align this widget
1361  */
1362  VclAlign get_halign() const;
1363  void set_halign(VclAlign eAlign);
1364 
1365  /*
1366  * How to vertically align this widget
1367  */
1368  VclAlign get_valign() const;
1369  void set_valign(VclAlign eAlign);
1370 
1371  /*
1372  * Whether the widget would like to use any available extra horizontal
1373  * space.
1374  */
1375  bool get_hexpand() const;
1376  void set_hexpand(bool bExpand);
1377 
1378  /*
1379  * Whether the widget would like to use any available extra vertical
1380  * space.
1381  */
1382  bool get_vexpand() const;
1383  void set_vexpand(bool bExpand);
1384 
1385  /*
1386  * Whether the widget would like to use any available extra space.
1387  */
1388  bool get_expand() const;
1389  void set_expand(bool bExpand);
1390 
1391  /*
1392  * Whether the widget should receive extra space when the parent grows
1393  */
1394  bool get_fill() const;
1395  void set_fill(bool bFill);
1396 
1397  void set_border_width(sal_Int32 nBorderWidth);
1398  sal_Int32 get_border_width() const;
1399 
1400  void set_margin_start(sal_Int32 nWidth);
1401  sal_Int32 get_margin_start() const;
1402 
1403  void set_margin_end(sal_Int32 nWidth);
1404  sal_Int32 get_margin_end() const;
1405 
1406  void set_margin_top(sal_Int32 nWidth);
1407  sal_Int32 get_margin_top() const;
1408 
1409  void set_margin_bottom(sal_Int32 nWidth);
1410  sal_Int32 get_margin_bottom() const;
1411 
1412  /*
1413  * How the widget is packed with reference to the start or end of the parent
1414  */
1415  VclPackType get_pack_type() const;
1416  void set_pack_type(VclPackType ePackType);
1417 
1418  /*
1419  * The extra space to put between the widget and its neighbors
1420  */
1421  sal_Int32 get_padding() const;
1422  void set_padding(sal_Int32 nPadding);
1423 
1424  /*
1425  * The number of columns that the widget spans
1426  */
1427  sal_Int32 get_grid_width() const;
1428  void set_grid_width(sal_Int32 nCols);
1429 
1430  /*
1431  * The column number to attach the left side of the widget to
1432  */
1433  sal_Int32 get_grid_left_attach() const;
1434  void set_grid_left_attach(sal_Int32 nAttach);
1435 
1436  /*
1437  * The number of row that the widget spans
1438  */
1439  sal_Int32 get_grid_height() const;
1440  void set_grid_height(sal_Int32 nRows);
1441 
1442  /*
1443  * The row number to attach the top side of the widget to
1444  */
1445  sal_Int32 get_grid_top_attach() const;
1446  void set_grid_top_attach(sal_Int32 nAttach);
1447 
1448  /*
1449  * If true this child appears in a secondary layout group of children
1450  * e.g. help buttons in a buttonbox
1451  */
1452  bool get_secondary() const;
1453  void set_secondary(bool bSecondary);
1454 
1455  /*
1456  * If true this child is exempted from homogeneous sizing
1457  * e.g. special button in a buttonbox
1458  */
1459  bool get_non_homogeneous() const;
1460  void set_non_homogeneous(bool bNonHomogeneous);
1461 
1462  /*
1463  * Sets a widget property
1464  *
1465  * @return false if property is unknown
1466  */
1467  virtual bool set_property(const OString &rKey, const OUString &rValue);
1468 
1469  /*
1470  * Sets a font attribute
1471  *
1472  * @return false if attribute is unknown
1473  */
1474  bool set_font_attribute(const OString &rKey, const OUString &rValue);
1475 
1476  /*
1477  * Adds this widget to the xGroup VclSizeGroup
1478  *
1479  */
1480  void add_to_size_group(const std::shared_ptr<VclSizeGroup>& xGroup);
1481  void remove_from_all_size_groups();
1482 
1483  /*
1484  * add/remove mnemonic label
1485  */
1486  void add_mnemonic_label(FixedText *pLabel);
1487  void remove_mnemonic_label(FixedText *pLabel);
1488  const std::vector<VclPtr<FixedText> >& list_mnemonic_labels() const;
1489 
1490  /*
1491  * Move this widget to be the nNewPosition'd child of its parent
1492  */
1493  void reorderWithinParent(sal_uInt16 nNewPosition);
1494 
1498  void set_id(const OUString& rID);
1499 
1503  const OUString& get_id() const;
1504 
1505 
1506  // Native Widget Rendering functions
1507 
1508 
1509  // form controls must never use native widgets, this can be toggled here
1510  void EnableNativeWidget( bool bEnable = true );
1511  bool IsNativeWidgetEnabled() const;
1512 
1513  // a helper method for a Control's Draw method
1514  void PaintToDevice( ::OutputDevice* pDevice, const Point& rPos );
1515 
1516  /* tdf#119390 set parent to default window. Typically for use in advance of destroying
1517  * a floating windows which has the current focus so focus will revert to the main
1518  * document window and not the first widget in the current parent of the floating
1519  * window.
1520  */
1521  void SetParentToDefaultWindow();
1522 
1523 
1524  // Keyboard access functions
1525 
1534  KeyIndicatorState GetIndicatorState() const;
1535 
1536  void SimulateKeyPress( sal_uInt16 nKeyCode ) const;
1537 
1538  virtual OUString GetSurroundingText() const;
1539  virtual Selection GetSurroundingTextSelection() const;
1540  virtual bool DeleteSurroundingText(const Selection& rSelection);
1541 
1542  virtual FactoryFunction GetUITestFactory() const;
1543 
1544  virtual bool IsChart() const { return false; }
1545 
1546  void SetHelpHdl(const Link<vcl::Window&, bool>& rLink);
1547  void SetMnemonicActivateHdl(const Link<vcl::Window&, bool>& rLink);
1548  void SetModalHierarchyHdl(const Link<bool, void>& rLink);
1549  void SetDumpAsPropertyTreeHdl(const Link<tools::JsonWriter&, void>& rLink);
1550 
1551  css::awt::DeviceInfo GetDeviceInfo() const override;
1552 };
1553 
1554 }
1555 
1556 #endif // INCLUDED_VCL_WINDOW_HXX
1557 
1558 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
The child windows are invalidated, too.
WindowHitTest
Definition: window.hxx:441
StartAutoScrollFlags
Definition: window.hxx:305
StartTrackingFlags
Definition: window.hxx:291
A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for refer...
Definition: button.hxx:32
InvalidateFlags
Definition: window.hxx:212
WindowExtendedStyle
Definition: window.hxx:451
Visible
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
ValidateFlags
Definition: window.hxx:236
sal_uIntPtr sal_uLong
long Long
ZOrderFlags
Definition: window.hxx:172
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
exports com.sun.star. awt
SAL_DLLPRIVATE WindowImpl * ImplGetWindowImpl() const
Definition: window.hxx:563
PosSizeFlags
Definition: window.hxx:140
The invalidated area is updated immediately.
ShowFlags
Definition: window.hxx:159
The area is invalidated regardless of overlapping child windows.
GetDlgWindowType
Definition: window.hxx:409
const char * ImplDbgCheckWindow(const void *pObj)
Definition: debug.cxx:26
GetWindowType
Definition: window.hxx:120
exports com.sun.star. rendering
The invalidated area is painted with the background color/pattern.
StateChangedType
Definition: window.hxx:317
sal_Int64 WinBits
ScrollFlags
Definition: window.hxx:248
size_t GetSyncCount() const override
Definition: window.hxx:786
Class that implements the actual window of the floating menu.
void reorderWithinParent(vcl::Window &rWindow, sal_uInt16 nNewPosition)
Definition: builder.cxx:2449
void Hide()
Definition: window.hxx:948
TrackingEventFlags
Definition: window.hxx:104
VclEventId
Definition: vclevent.hxx:37
Definition: edit.hxx:55
GetFocusFlags
Definition: window.hxx:339
This is a frame window that is requested to be hidden (not just "not yet shown"). ...
ImplPaintFlags
Definition: window.h:201
DialogControlFlags
Definition: window.hxx:372
VclPackType
Definition: vclenum.hxx:224
DrawFlags
Definition: window.hxx:360
ImplDockingWindowWrapper.
Definition: dockwin.hxx:70
KeyIndicatorState
Definition: keycodes.hxx:184
ShowTrackFlags
Definition: window.hxx:275
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:303
ActivateModeFlags
Definition: window.hxx:186
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:519
EndExtTextInputFlags
Definition: window.hxx:385
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:232
bool CanEnableNativeWidget() const override
Determine if native widgets can be enabled.
Definition: window.hxx:782
virtual bool IsChart() const
Definition: window.hxx:1544
void Disable(bool bChild=true)
Definition: window.hxx:955
sal_uInt32 LOKWindowId
ParentClipMode
Definition: window.hxx:263
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
void Erase()
Definition: wallpaper.cxx:103
vcl::Window * ImplFindDlgCtrlWindow(vcl::Window *pParent, vcl::Window *pWindow, sal_uInt16 &rIndex, sal_uInt16 &rFormStart, sal_uInt16 &rFormEnd)
Definition: dlgctrl.cxx:327
virtual void LogicMouseButtonUp(const MouseEvent &)
Same as MouseButtonUp(), but coordinates are in logic unit. used for LOK.
Definition: window.hxx:1190
WindowType
State
PointerStyle
Definition: ptrstyle.hxx:25
virtual void LogicMouseButtonDown(const MouseEvent &)
Same as MouseButtonDown(), but coordinates are in logic unit. used for LOK.
Definition: window.hxx:1188
VclAlign
Definition: vclenum.hxx:216
Definition: timer.hxx:26
struct _ADOKey Key
ToTopFlags
Definition: window.hxx:197
WindowBorderStyle
Definition: vclenum.hxx:108
virtual void LogicMouseMove(const MouseEvent &)
Same as MouseMove(), but coordinates are in logic unit. used for LOK.
Definition: window.hxx:1192
void dispose()
The parent window is not invalidated.
The child windows are not invalidated.
weld::Window * GetFrameWeld(const SfxFrame *pFrame)