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