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