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