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, 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( long nX, long nY, long nWidth, 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, long nHorzScroll, long nVertScroll, bool bChildren );
607  SAL_DLLPRIVATE void ImplMoveAllInvalidateRegions( const tools::Rectangle& rRect, long nHorzScroll, 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, long nHorzScroll, 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 long ImplGetUnmirroredOutOffX();
722 
723  // retrieves the list of owner draw decorated windows for this window hierarchy
724  SAL_DLLPRIVATE ::std::vector<VclPtr<vcl::Window> >& ImplGetOwnerDrawList();
725 
726  SAL_DLLPRIVATE vcl::Window* ImplGetTopmostFrameWindow();
727 
728  SAL_DLLPRIVATE tools::Rectangle ImplGetWindowExtentsRelative(const vcl::Window *pRelativeWindow) const;
729 
730  SAL_DLLPRIVATE bool ImplStopDnd();
731  SAL_DLLPRIVATE void ImplStartDnd();
732 
733  virtual void ImplPaintToDevice( ::OutputDevice* pTargetOutDev, const Point& rPos );
734 
735  SAL_DLLPRIVATE css::uno::Reference< css::rendering::XCanvas >
736  ImplGetCanvas( bool bSpriteCanvas ) const;
737 
738 public:
739  virtual vcl::Region GetActiveClipRegion() const override;
740  virtual vcl::Region GetOutputBoundsClipRegion() const override;
741 
742 protected:
743  // Single argument ctors shall be explicit.
744  explicit Window( WindowType nType );
745 
746  void SetCompoundControl( bool bCompound );
747 
748  void CallEventListeners( VclEventId nEvent, void* pData = nullptr );
749 
750  virtual bool AcquireGraphics() const override;
751  virtual void ReleaseGraphics( bool bRelease = true ) override;
752 
753  virtual void InitClipRegion() override;
754 
755  void ImplClearFontData(bool bNewFontLists) override;
756  void ImplRefreshFontData(bool bNewFontLists) override;
757  void ImplInitMapModeObjects() override;
758 
759  // FIXME: this is a hack to workaround missing layout functionality
760  virtual void ImplAdjustNWFSizes();
761 
762  virtual void CopyDeviceArea( SalTwoRect& aPosAry, bool bWindowInvalidate) override;
763  virtual const OutputDevice* DrawOutDevDirectCheck(const OutputDevice* pSrcDev) const override;
764  virtual void DrawOutDevDirectProcess( const OutputDevice* pSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) override;
765  virtual void ClipToPaintRegion( tools::Rectangle& rDstRect ) override;
766  virtual bool UsePolyPolygonForComplexGradient() override;
767 
768  virtual void ApplySettings(vcl::RenderContext& rRenderContext);
769 public:
770  bool HasMirroredGraphics() const override;
771 
772 public:
773  // Single argument ctors shall be explicit.
774  explicit Window( vcl::Window* pParent, WinBits nStyle = 0 );
775 
776  virtual ~Window() override;
777 
778  ::OutputDevice const* GetOutDev() const;
779  ::OutputDevice* GetOutDev();
780 
781  Color GetBackgroundColor() const override;
782 
783  size_t GetSyncCount() const override { return 0x000000ff; }
784  virtual void EnableRTL ( bool bEnable = true ) override;
785  virtual void MouseMove( const MouseEvent& rMEvt );
786  virtual void MouseButtonDown( const MouseEvent& rMEvt );
787  virtual void MouseButtonUp( const MouseEvent& rMEvt );
788  virtual void KeyInput( const KeyEvent& rKEvt );
789  virtual void KeyUp( const KeyEvent& rKEvt );
790  virtual void PrePaint(vcl::RenderContext& rRenderContext);
791  virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect);
792  virtual void PostPaint(vcl::RenderContext& rRenderContext);
793 
794  using OutputDevice::Erase;
795  void Erase(vcl::RenderContext& rRenderContext);
796 
797  virtual void Draw( ::OutputDevice* pDev, const Point& rPos, DrawFlags nFlags );
798  virtual void Move();
799  virtual void Resize();
800  virtual void Activate();
801  virtual void Deactivate();
802  virtual void GetFocus();
803  virtual void LoseFocus();
804  virtual void RequestHelp( const HelpEvent& rHEvt );
805  virtual void Command( const CommandEvent& rCEvt );
806  virtual void Tracking( const TrackingEvent& rTEvt );
807  virtual void StateChanged( StateChangedType nStateChange );
808  virtual void DataChanged( const DataChangedEvent& rDCEvt );
809  virtual bool PreNotify( NotifyEvent& rNEvt );
810  virtual bool EventNotify( NotifyEvent& rNEvt );
811 
812  // These methods call the relevant virtual method when not in/post dispose
813  void CompatGetFocus();
814  void CompatLoseFocus();
815  void CompatStateChanged( StateChangedType nStateChange );
816  void CompatDataChanged( const DataChangedEvent& rDCEvt );
817  bool CompatPreNotify( NotifyEvent& rNEvt );
818  bool CompatNotify( NotifyEvent& rNEvt );
819 
820  void AddEventListener( const Link<VclWindowEvent&,void>& rEventListener );
821  void RemoveEventListener( const Link<VclWindowEvent&,void>& rEventListener );
822  void AddChildEventListener( const Link<VclWindowEvent&,void>& rEventListener );
823  void RemoveChildEventListener( const Link<VclWindowEvent&,void>& rEventListener );
824 
825  ImplSVEvent * PostUserEvent( const Link<void*,void>& rLink, void* pCaller = nullptr, bool bReferenceLink = false );
826  void RemoveUserEvent( ImplSVEvent * nUserEvent );
827 
828  // returns the input language used for the last key stroke
829  // may be LANGUAGE_DONTKNOW if not supported by the OS
830  LanguageType GetInputLanguage() const;
831 
832  void SetStyle( WinBits nStyle );
833  WinBits GetStyle() const;
834  WinBits GetPrevStyle() const;
835  void SetExtendedStyle( WindowExtendedStyle nExtendedStyle );
836  WindowExtendedStyle GetExtendedStyle() const;
837  void SetType( WindowType nType );
838  WindowType GetType() const;
839  bool IsSystemWindow() const;
840  bool IsDockingWindow() const;
841  bool IsDialog() const;
842  bool IsMenuFloatingWindow() const;
843  bool IsToolbarFloatingWindow() const;
844  bool IsTopWindow() const;
845  bool IsDisposed() const;
846  SystemWindow* GetSystemWindow() const;
847 
849  bool SupportsDoubleBuffering() const;
851  void RequestDoubleBuffering(bool bRequest);
852 
853  void EnableAllResize();
854 
855  void SetBorderStyle( WindowBorderStyle nBorderStyle );
856  WindowBorderStyle GetBorderStyle() const;
857  void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
858  sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
859  Size CalcWindowSize( const Size& rOutSz ) const;
860  Size CalcOutputSize( const Size& rWinSz ) const;
861  long CalcTitleWidth() const;
862 
863  void EnableClipSiblings( bool bClipSiblings = true );
864 
865  void EnableChildTransparentMode( bool bEnable = true );
866  bool IsChildTransparentModeEnabled() const;
867 
868  void SetMouseTransparent( bool bTransparent );
869  bool IsMouseTransparent() const;
870  void SetPaintTransparent( bool bTransparent );
871  bool IsPaintTransparent() const;
872  void SetDialogControlStart( bool bStart );
873  bool IsDialogControlStart() const;
874  void SetDialogControlFlags( DialogControlFlags nFlags );
875  DialogControlFlags GetDialogControlFlags() const;
876 
878  {
879  sal_uLong mnState; // the button state
880  Point maPos; // mouse position in output coordinates
881  };
882  PointerState GetPointerState();
883  bool IsMouseOver() const;
884 
885  void SetInputContext( const InputContext& rInputContext );
886  const InputContext& GetInputContext() const;
887  void PostExtTextInputEvent(VclEventId nType, const OUString& rText);
888  void EndExtTextInput();
889  void SetCursorRect( const tools::Rectangle* pRect = nullptr, long nExtTextInputWidth = 0 );
890  const tools::Rectangle* GetCursorRect() const;
891  long GetCursorExtTextInputWidth() const;
892 
893  void SetCompositionCharRect( const tools::Rectangle* pRect, long nCompositionLength, bool bVertical = false );
894 
895  using ::OutputDevice::SetSettings;
896  virtual void SetSettings( const AllSettings& rSettings ) override;
897  void SetSettings( const AllSettings& rSettings, bool bChild );
898  void UpdateSettings( const AllSettings& rSettings, bool bChild = false );
899  void NotifyAllChildren( DataChangedEvent& rDCEvt );
900 
901  void SetPointFont(vcl::RenderContext& rRenderContext, const vcl::Font& rFont);
902  vcl::Font GetPointFont(vcl::RenderContext const & rRenderContext) const;
903  void SetZoomedPointFont(vcl::RenderContext& rRenderContext, const vcl::Font& rFont);
904  long GetDrawPixel( ::OutputDevice const * pDev, long nPixels ) const;
905  vcl::Font GetDrawPixelFont( ::OutputDevice const * pDev ) const;
906 
907  void SetControlFont();
908  void SetControlFont( const vcl::Font& rFont );
909  vcl::Font GetControlFont() const;
910  bool IsControlFont() const;
911  void ApplyControlFont(vcl::RenderContext& rRenderContext, const vcl::Font& rDefaultFont);
912 
913  void SetControlForeground();
914  void SetControlForeground(const Color& rColor);
915  const Color& GetControlForeground() const;
916  bool IsControlForeground() const;
917  void ApplyControlForeground(vcl::RenderContext& rRenderContext, const Color& rDefaultColor);
918 
919  void SetControlBackground();
920  void SetControlBackground( const Color& rColor );
921  const Color& GetControlBackground() const;
922  bool IsControlBackground() const;
923  void ApplyControlBackground(vcl::RenderContext& rRenderContext, const Color& rDefaultColor);
924 
925  void SetParentClipMode( ParentClipMode nMode = ParentClipMode::NONE );
926  ParentClipMode GetParentClipMode() const;
927 
928  void SetWindowRegionPixel();
929  void SetWindowRegionPixel( const vcl::Region& rRegion );
930  vcl::Region GetWindowClipRegionPixel() const;
931  vcl::Region GetPaintRegion() const;
932  bool IsInPaint() const;
933  // while IsInPaint returns true ExpandPaintClipRegion adds the
934  // submitted region to the paint clip region so you can
935  // paint additional parts of your window if necessary
936  void ExpandPaintClipRegion( const vcl::Region& rRegion );
937 
938  void SetParent( vcl::Window* pNewParent );
939  vcl::Window* GetParent() const;
940  // return the dialog we are contained in or NULL if un-contained
941  Dialog* GetParentDialog() const;
942  bool IsAncestorOf( const vcl::Window& rWindow ) const;
943 
944  void Show( bool bVisible = true, ShowFlags nFlags = ShowFlags::NONE );
945  void Hide() { Show( false ); }
946  bool IsVisible() const;
947  bool IsReallyVisible() const;
948  bool IsReallyShown() const;
949  bool IsInInitShow() const;
950 
951  void Enable( bool bEnable = true, bool bChild = true );
952  void Disable( bool bChild = true ) { Enable( false, bChild ); }
953  bool IsEnabled() const;
954 
955  void EnableInput( bool bEnable = true, bool bChild = true );
956  void EnableInput( bool bEnable, const vcl::Window* pExcludeWindow );
957  bool IsInputEnabled() const;
958 
968  void AlwaysEnableInput( bool bAlways, bool bChild = true );
969 
974  bool IsAlwaysEnableInput() const;
975 
981  bool IsInModalMode() const;
982 
983  void SetActivateMode( ActivateModeFlags nMode );
984  ActivateModeFlags GetActivateMode() const;
985 
986  void ToTop( ToTopFlags nFlags = ToTopFlags::NONE );
987  void SetZOrder( vcl::Window* pRefWindow, ZOrderFlags nFlags );
988  void EnableAlwaysOnTop( bool bEnable = true );
989  bool IsAlwaysOnTopEnabled() const;
990 
991  virtual void setPosSizePixel( long nX, long nY,
992  long nWidth, long nHeight,
993  PosSizeFlags nFlags = PosSizeFlags::All );
994  virtual void SetPosPixel( const Point& rNewPos );
995  virtual Point GetPosPixel() const;
996  virtual void SetSizePixel( const Size& rNewSize );
997  virtual Size GetSizePixel() const;
998  virtual void SetPosSizePixel( const Point& rNewPos,
999  const Size& rNewSize );
1000  virtual void SetOutputSizePixel( const Size& rNewSize );
1001  bool IsDefaultPos() const;
1002  bool IsDefaultSize() const;
1003  Point GetOffsetPixelFrom(const vcl::Window& rWindow) const;
1004 
1005  // those conversion routines might deliver different results during UI mirroring
1006  Point OutputToScreenPixel( const Point& rPos ) const;
1007  Point ScreenToOutputPixel( const Point& rPos ) const;
1008  // the normalized screen methods work independent from UI mirroring
1009  Point OutputToNormalizedScreenPixel( const Point& rPos ) const;
1010  Point NormalizedScreenToOutputPixel( const Point& rPos ) const;
1011  Point OutputToAbsoluteScreenPixel( const Point& rPos ) const;
1012  Point AbsoluteScreenToOutputPixel( const Point& rPos ) const;
1013  tools::Rectangle GetDesktopRectPixel() const;
1014  // window extents including border and decoration
1015  tools::Rectangle GetWindowExtentsRelative(const vcl::Window *pRelativeWindow) const;
1016 
1017  bool IsScrollable() const;
1018  virtual void Scroll( long nHorzScroll, long nVertScroll,
1019  ScrollFlags nFlags = ScrollFlags::NONE );
1020  void Scroll( long nHorzScroll, long nVertScroll,
1021  const tools::Rectangle& rRect, ScrollFlags nFlags = ScrollFlags::NONE );
1022  virtual void Invalidate( InvalidateFlags nFlags = InvalidateFlags::NONE );
1023  virtual void Invalidate( const tools::Rectangle& rRect, InvalidateFlags nFlags = InvalidateFlags::NONE );
1024  virtual void Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags = InvalidateFlags::NONE );
1031  virtual void LogicInvalidate(const tools::Rectangle* pRectangle);
1032 
1039  virtual void PixelInvalidate(const tools::Rectangle* pRectangle);
1040  void Validate();
1041  bool HasPaintEvent() const;
1042  void PaintImmediately();
1043  void Flush() override;
1044 
1045  // toggles new docking support, enabled via toolkit
1046  void EnableDocking( bool bEnable = true );
1047  // retrieves the single dockingmanager instance
1048  static DockingManager* GetDockingManager();
1049 
1050  void EnablePaint( bool bEnable );
1051  bool IsPaintEnabled() const;
1052  void SetUpdateMode( bool bUpdate );
1053  bool IsUpdateMode() const;
1054  void SetParentUpdateMode( bool bUpdate );
1055 
1056  void GrabFocus();
1057  bool HasFocus() const;
1058  bool HasChildPathFocus( bool bSystemWindow = false ) const;
1059  bool IsActive() const;
1060  bool HasActiveChildFrame() const;
1061  GetFocusFlags GetGetFocusFlags() const;
1062  void GrabFocusToDocument();
1063  VclPtr<vcl::Window> GetFocusedWindow() const;
1064 
1070  void SetFakeFocus( bool bFocus );
1071 
1072  bool IsCompoundControl() const;
1073 
1074  static VclPtr<vcl::Window> SaveFocus();
1075  static void EndSaveFocus(const VclPtr<vcl::Window>& xFocusWin);
1076 
1077  void CaptureMouse();
1078  void ReleaseMouse();
1079  bool IsMouseCaptured() const;
1080 
1081  void SetPointer( PointerStyle );
1082  PointerStyle GetPointer() const;
1083  void EnableChildPointerOverwrite( bool bOverwrite );
1084  void SetPointerPosPixel( const Point& rPos );
1085  Point GetPointerPosPixel();
1086  Point GetLastPointerPosPixel();
1088  void SetLastMousePos(const Point& rPos);
1089  void ShowPointer( bool bVisible );
1090  void EnterWait();
1091  void LeaveWait();
1092  bool IsWait() const;
1093 
1094  void SetCursor( vcl::Cursor* pCursor );
1095  vcl::Cursor* GetCursor() const;
1096 
1097  void SetZoom( const Fraction& rZoom );
1098  const Fraction& GetZoom() const;
1099  bool IsZoom() const;
1100  long CalcZoom( long n ) const;
1101 
1102  virtual void SetText( const OUString& rStr );
1103  virtual OUString GetText() const;
1104  // return the actual text displayed
1105  // this may have e.g. accelerators removed or portions
1106  // replaced by ellipses
1107  virtual OUString GetDisplayText() const;
1108  // gets the visible background color. for transparent windows
1109  // this may be the parent's background color; for controls
1110  // this may be a child's background color (e.g. ListBox)
1111  virtual const Wallpaper& GetDisplayBackground() const;
1112 
1113  void SetHelpText( const OUString& rHelpText );
1114  const OUString& GetHelpText() const;
1115 
1116  void SetQuickHelpText( const OUString& rHelpText );
1117  const OUString& GetQuickHelpText() const;
1118 
1119  void SetHelpId( const OString& );
1120  const OString& GetHelpId() const;
1121 
1122  sal_uInt16 GetChildCount() const;
1123  vcl::Window* GetChild( sal_uInt16 nChild ) const;
1124  vcl::Window* GetWindow( GetWindowType nType ) const;
1125  bool IsChild( const vcl::Window* pWindow ) const;
1126  bool IsWindowOrChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const;
1127 
1129  SAL_DLLPRIVATE void CollectChildren(::std::vector<vcl::Window *>& rAllChildren );
1130 
1131  virtual void ShowFocus(const tools::Rectangle& rRect);
1132  void HideFocus();
1133 
1134  // transparent background for selected or checked items in toolboxes etc.
1135  void DrawSelectionBackground( const tools::Rectangle& rRect, sal_uInt16 highlight, bool bChecked, bool bDrawBorder );
1136 
1137  void ShowTracking( const tools::Rectangle& rRect,
1139  void HideTracking();
1140  void InvertTracking( const tools::Rectangle& rRect, ShowTrackFlags nFlags );
1141 
1142  void StartTracking( StartTrackingFlags nFlags = StartTrackingFlags::NONE );
1143  void EndTracking( TrackingEventFlags nFlags = TrackingEventFlags::NONE );
1144  bool IsTracking() const;
1145 
1146  void StartAutoScroll( StartAutoScrollFlags nFlags );
1147  void EndAutoScroll();
1148 
1149  bool HandleScrollCommand( const CommandEvent& rCmd,
1150  ScrollBar* pHScrl,
1151  ScrollBar* pVScrl );
1152 
1153  void SaveBackground(VirtualDevice& rSaveDevice,
1154  const Point& rPos, const Size& rSize, const Size&) const override;
1155 
1156  virtual const SystemEnvData* GetSystemData() const;
1157 
1158  // API to set/query the component interfaces
1159  virtual css::uno::Reference< css::awt::XWindowPeer >
1160  GetComponentInterface( bool bCreate = true );
1161 
1162  void SetComponentInterface( css::uno::Reference< css::awt::XWindowPeer > const & xIFace );
1163 
1165  void SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier, bool bParent = false);
1166  const vcl::ILibreOfficeKitNotifier* GetLOKNotifier() const;
1167  vcl::LOKWindowId GetLOKWindowId() const;
1168 
1170  VclPtr<vcl::Window> GetParentWithLOKNotifier();
1171 
1173  void ReleaseLOKNotifier();
1174 
1176  static VclPtr<vcl::Window> FindLOKWindow(vcl::LOKWindowId nWindowId);
1177 
1179  static bool IsLOKWindowsEmpty();
1180 
1182  virtual void DumpAsPropertyTree(tools::JsonWriter&);
1183 
1185  virtual void LogicMouseButtonDown(const MouseEvent&) {};
1187  virtual void LogicMouseButtonUp(const MouseEvent&) {};
1189  virtual void LogicMouseMove(const MouseEvent&) {};
1190 
1193 public:
1195 
1196  css::uno::Reference< css::accessibility::XAccessible >
1197  GetAccessible( bool bCreate = true );
1198 
1199  virtual css::uno::Reference< css::accessibility::XAccessible >
1200  CreateAccessible();
1201 
1202  void SetAccessible( const css::uno::Reference< css::accessibility::XAccessible >& );
1203 
1204  vcl::Window* GetAccessibleParentWindow() const;
1205  sal_uInt16 GetAccessibleChildWindowCount();
1206  vcl::Window* GetAccessibleChildWindow( sal_uInt16 n );
1207 
1208  void SetAccessibleRole( sal_uInt16 nRole );
1209  sal_uInt16 GetAccessibleRole() const;
1210 
1211  void SetAccessibleName( const OUString& rName );
1212  OUString GetAccessibleName() const;
1213 
1214  void SetAccessibleDescription( const OUString& rDescr );
1215  OUString GetAccessibleDescription() const;
1216 
1217  void SetAccessibleRelationLabeledBy( vcl::Window* pLabeledBy );
1218  vcl::Window* GetAccessibleRelationLabeledBy() const;
1219 
1220  void SetAccessibleRelationLabelFor( vcl::Window* pLabelFor );
1221  vcl::Window* GetAccessibleRelationLabelFor() const;
1222 
1223  void SetAccessibleRelationMemberOf( vcl::Window* pMemberOf );
1224  vcl::Window* GetAccessibleRelationMemberOf() const;
1225 
1226  // to avoid sending accessibility events in cases like closing dialogs
1227  // by default checks complete parent path
1228  bool IsAccessibilityEventsSuppressed( bool bTraverseParentPath = true );
1229  void SetAccessibilityEventsSuppressed(bool bSuppressed);
1230 
1231  KeyEvent GetActivationKey() const;
1232 
1233 protected:
1234 
1235  // These eventually are supposed to go when everything is converted to .ui
1236  SAL_DLLPRIVATE vcl::Window* getLegacyNonLayoutAccessibleRelationMemberOf() const;
1237  SAL_DLLPRIVATE vcl::Window* getLegacyNonLayoutAccessibleRelationLabeledBy() const;
1238  SAL_DLLPRIVATE vcl::Window* getLegacyNonLayoutAccessibleRelationLabelFor() const;
1239 
1240  // Let Label override the code part of GetAccessibleRelationLabelFor
1241  virtual vcl::Window* getAccessibleRelationLabelFor() const;
1242  virtual sal_uInt16 getDefaultAccessibleRole() const;
1243  virtual OUString getDefaultAccessibleName() const;
1244 
1245  /*
1246  * Advisory Sizing - what is a good size for this widget
1247  *
1248  * Retrieves the preferred size of a widget ignoring
1249  * "width-request" and "height-request" properties.
1250  *
1251  * Implement this in sub-classes to tell layout
1252  * the preferred widget size.
1253  *
1254  * Use get_preferred_size to retrieve this value
1255  * cached and mediated via height and width requests
1256  */
1257  virtual Size GetOptimalSize() const;
1259  void InvalidateSizeCache();
1260 private:
1261 
1262  SAL_DLLPRIVATE bool ImplIsAccessibleCandidate() const;
1263  SAL_DLLPRIVATE bool ImplIsAccessibleNativeFrame() const;
1265 
1266  /*
1267  * Retrieves the preferred size of a widget taking
1268  * into account the "width-request" and "height-request" properties.
1269  *
1270  * Overrides the result of GetOptimalSize to honor the
1271  * width-request and height-request properties.
1272  *
1273  * So the same as get_ungrouped_preferred_size except
1274  * it ignores groups. A building block of get_preferred_size
1275  * that access the size cache
1276  *
1277  * @see get_preferred_size
1278  */
1279  Size get_ungrouped_preferred_size() const;
1280 public:
1282  css::uno::Reference< css::rendering::XCanvas >
1283  GetCanvas() const;
1285  css::uno::Reference< css::rendering::XSpriteCanvas >
1286  GetSpriteCanvas() const;
1287 
1288  /* records all DrawText operations within the passed rectangle;
1289  * a synchronous paint is sent to achieve this
1290  */
1291  void RecordLayoutData( vcl::ControlLayoutData* pLayout, const tools::Rectangle& rRect );
1292 
1293  // set and retrieve for Toolkit
1294  VCLXWindow* GetWindowPeer() const;
1295  void SetWindowPeer( css::uno::Reference< css::awt::XWindowPeer > const & xPeer, VCLXWindow* pVCLXWindow );
1296 
1297  // remember if it was generated by Toolkit
1298  bool IsCreatedWithToolkit() const;
1299  void SetCreatedWithToolkit( bool b );
1300 
1301  // Drag and Drop interfaces
1302  css::uno::Reference< css::datatransfer::dnd::XDropTarget > GetDropTarget();
1303  css::uno::Reference< css::datatransfer::dnd::XDragSource > GetDragSource();
1304  css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > GetDragGestureRecognizer();
1305 
1306  // Clipboard/Selection interfaces
1307  css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard();
1309  void SetClipboard(css::uno::Reference<css::datatransfer::clipboard::XClipboard> const & xClipboard);
1310  css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetPrimarySelection();
1311 
1312  /*
1313  * Widgets call this to inform their owner container that the widget wants
1314  * to renegotiate its size. Should be called when a widget has a new size
1315  * request. e.g. a FixedText Control gets a new label.
1316  *
1317  * akin to gtk_widget_queue_resize
1318  */
1319  virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout);
1320 
1321  /*
1322  * Sets the "height-request" property
1323  *
1324  * Override for height request of the widget, or -1 if natural request
1325  * should be used.
1326  *
1327  * @see get_preferred_size, set_width_request
1328  */
1329  void set_height_request(sal_Int32 nHeightRequest);
1330  sal_Int32 get_height_request() const;
1331 
1332  /*
1333  * Sets the "width-request" property
1334  *
1335  * Override for width request of the widget, or -1 if natural request
1336  * should be used.
1337  *
1338  * @see get_preferred_size, set_height_request
1339  */
1340  void set_width_request(sal_Int32 nWidthRequest);
1341  sal_Int32 get_width_request() const;
1342 
1343  /*
1344  * Retrieves the preferred size of a widget taking
1345  * into account the "width-request" and "height-request" properties.
1346  *
1347  * Overrides the result of GetOptimalSize to honor the
1348  * width-request and height-request properties.
1349  *
1350  * @see GetOptimalSize
1351  *
1352  * akin to gtk_widget_get_preferred_size
1353  */
1354  Size get_preferred_size() const;
1355 
1356  /*
1357  * How to horizontally align this widget
1358  */
1359  VclAlign get_halign() const;
1360  void set_halign(VclAlign eAlign);
1361 
1362  /*
1363  * How to vertically align this widget
1364  */
1365  VclAlign get_valign() const;
1366  void set_valign(VclAlign eAlign);
1367 
1368  /*
1369  * Whether the widget would like to use any available extra horizontal
1370  * space.
1371  */
1372  bool get_hexpand() const;
1373  void set_hexpand(bool bExpand);
1374 
1375  /*
1376  * Whether the widget would like to use any available extra vertical
1377  * space.
1378  */
1379  bool get_vexpand() const;
1380  void set_vexpand(bool bExpand);
1381 
1382  /*
1383  * Whether the widget would like to use any available extra space.
1384  */
1385  bool get_expand() const;
1386  void set_expand(bool bExpand);
1387 
1388  /*
1389  * Whether the widget should receive extra space when the parent grows
1390  */
1391  bool get_fill() const;
1392  void set_fill(bool bFill);
1393 
1394  void set_border_width(sal_Int32 nBorderWidth);
1395  sal_Int32 get_border_width() const;
1396 
1397  void set_margin_left(sal_Int32 nWidth);
1398  sal_Int32 get_margin_left() const;
1399 
1400  void set_margin_right(sal_Int32 nWidth);
1401  sal_Int32 get_margin_right() const;
1402 
1403  void set_margin_top(sal_Int32 nWidth);
1404  sal_Int32 get_margin_top() const;
1405 
1406  void set_margin_bottom(sal_Int32 nWidth);
1407  sal_Int32 get_margin_bottom() const;
1408 
1409  /*
1410  * How the widget is packed with reference to the start or end of the parent
1411  */
1412  VclPackType get_pack_type() const;
1413  void set_pack_type(VclPackType ePackType);
1414 
1415  /*
1416  * The extra space to put between the widget and its neighbors
1417  */
1418  sal_Int32 get_padding() const;
1419  void set_padding(sal_Int32 nPadding);
1420 
1421  /*
1422  * The number of columns that the widget spans
1423  */
1424  sal_Int32 get_grid_width() const;
1425  void set_grid_width(sal_Int32 nCols);
1426 
1427  /*
1428  * The column number to attach the left side of the widget to
1429  */
1430  sal_Int32 get_grid_left_attach() const;
1431  void set_grid_left_attach(sal_Int32 nAttach);
1432 
1433  /*
1434  * The number of row that the widget spans
1435  */
1436  sal_Int32 get_grid_height() const;
1437  void set_grid_height(sal_Int32 nRows);
1438 
1439  /*
1440  * The row number to attach the top side of the widget to
1441  */
1442  sal_Int32 get_grid_top_attach() const;
1443  void set_grid_top_attach(sal_Int32 nAttach);
1444 
1445  /*
1446  * If true this child appears in a secondary layout group of children
1447  * e.g. help buttons in a buttonbox
1448  */
1449  bool get_secondary() const;
1450  void set_secondary(bool bSecondary);
1451 
1452  /*
1453  * If true this child is exempted from homogeneous sizing
1454  * e.g. special button in a buttonbox
1455  */
1456  bool get_non_homogeneous() const;
1457  void set_non_homogeneous(bool bNonHomogeneous);
1458 
1459  /*
1460  * Sets a widget property
1461  *
1462  * @return false if property is unknown
1463  */
1464  virtual bool set_property(const OString &rKey, const OUString &rValue);
1465 
1466  /*
1467  * Sets a font attribute
1468  *
1469  * @return false if attribute is unknown
1470  */
1471  bool set_font_attribute(const OString &rKey, const OUString &rValue);
1472 
1473  /*
1474  * Adds this widget to the xGroup VclSizeGroup
1475  *
1476  */
1477  void add_to_size_group(const std::shared_ptr<VclSizeGroup>& xGroup);
1478  void remove_from_all_size_groups();
1479 
1480  /*
1481  * add/remove mnemonic label
1482  */
1483  void add_mnemonic_label(FixedText *pLabel);
1484  void remove_mnemonic_label(FixedText *pLabel);
1485  const std::vector<VclPtr<FixedText> >& list_mnemonic_labels() const;
1486 
1487  /*
1488  * Move this widget to be the nNewPosition'd child of its parent
1489  */
1490  void reorderWithinParent(sal_uInt16 nNewPosition);
1491 
1495  void set_id(const OUString& rID);
1496 
1500  const OUString& get_id() const;
1501 
1502 
1503  // Native Widget Rendering functions
1504 
1505 
1506  // form controls must never use native widgets, this can be toggled here
1507  void EnableNativeWidget( bool bEnable = true );
1508  bool IsNativeWidgetEnabled() const;
1509 
1510  // a helper method for a Control's Draw method
1511  void PaintToDevice( ::OutputDevice* pDevice, const Point& rPos );
1512 
1513  /* tdf#119390 set parent to default window. Typically for use in advance of destroying
1514  * a floating windows which has the current focus so focus will revert to the main
1515  * document window and not the first widget in the current parent of the floating
1516  * window.
1517  */
1518  void SetParentToDefaultWindow();
1519 
1520 
1521  // Keyboard access functions
1522 
1531  KeyIndicatorState GetIndicatorState() const;
1532 
1533  void SimulateKeyPress( sal_uInt16 nKeyCode ) const;
1534 
1535  virtual OUString GetSurroundingText() const;
1536  virtual Selection GetSurroundingTextSelection() const;
1537 
1538  virtual FactoryFunction GetUITestFactory() const;
1539 
1540  virtual bool IsChart() const { return false; }
1541 
1542  void SetHelpHdl(const Link<vcl::Window&, bool>& rLink);
1543  void SetMnemonicActivateHdl(const Link<vcl::Window&, bool>& rLink);
1544  void SetModalHierarchyHdl(const Link<bool, void>& rLink);
1545  void SetDumpAsPropertyTreeHdl(const Link<tools::JsonWriter&, void>& rLink);
1546 };
1547 
1548 }
1549 
1550 #endif // INCLUDED_VCL_WINDOW_HXX
1551 
1552 /* 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
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:783
Class that implements the actual window of the floating menu.
void reorderWithinParent(vcl::Window &rWindow, sal_uInt16 nNewPosition)
Definition: builder.cxx:2357
void Hide()
Definition: window.hxx:945
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:180
ShowTrackFlags
Definition: window.hxx:275
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:519
EndExtTextInputFlags
Definition: window.hxx:385
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:230
virtual bool IsChart() const
Definition: window.hxx:1540
void Disable(bool bChild=true)
Definition: window.hxx:952
sal_uInt32 LOKWindowId
static bool EnableNativeWidget(const OutputDevice &i_rDevice)
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:1187
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:1185
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:1189
void dispose()
The parent window is not invalidated.
The child windows are not invalidated.
weld::Window * GetFrameWeld(const SfxFrame *pFrame)