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  vcl::Window* GetFrameWindow() const;
531  SalFrame* ImplGetFrame() const;
532  SAL_DLLPRIVATE ImplFrameData* ImplGetFrameData();
533 
534  vcl::Window* ImplGetWindow() const;
535  SAL_DLLPRIVATE ImplWinData* ImplGetWinData() const;
536  SAL_DLLPRIVATE vcl::Window* ImplGetClientWindow() const;
537  SAL_DLLPRIVATE vcl::Window* ImplGetDlgWindow( sal_uInt16 n, GetDlgWindowType nType, sal_uInt16 nStart = 0, sal_uInt16 nEnd = 0xFFFF, sal_uInt16* pIndex = nullptr );
538  SAL_DLLPRIVATE vcl::Window* ImplGetParent() const;
539  SAL_DLLPRIVATE vcl::Window* ImplFindWindow( const Point& rFramePos );
540 
541  SAL_DLLPRIVATE void ImplInvalidateFrameRegion( const vcl::Region* pRegion, InvalidateFlags nFlags );
542  SAL_DLLPRIVATE void ImplInvalidateOverlapFrameRegion( const vcl::Region& rRegion );
543 
544  SAL_DLLPRIVATE bool ImplSetClipFlag( bool bSysObjOnlySmaller = false );
545 
546  SAL_DLLPRIVATE bool ImplIsWindowOrChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const;
547  SAL_DLLPRIVATE bool ImplIsChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const;
548  SAL_DLLPRIVATE bool ImplIsFloatingWindow() const;
549  SAL_DLLPRIVATE bool ImplIsPushButton() const;
550  SAL_DLLPRIVATE bool ImplIsSplitter() const;
551  SAL_DLLPRIVATE bool ImplIsOverlapWindow() const;
552 
553  SAL_DLLPRIVATE void ImplIsInTaskPaneList( bool mbIsInTaskList );
554 
555  SAL_DLLPRIVATE WindowImpl* ImplGetWindowImpl() const { return mpWindowImpl.get(); }
556 
557  SAL_DLLPRIVATE Point ImplFrameToOutput( const Point& rPos );
558 
559  SAL_DLLPRIVATE void ImplGrabFocus( GetFocusFlags nFlags );
560  SAL_DLLPRIVATE void ImplGrabFocusToDocument( GetFocusFlags nFlags );
561  SAL_DLLPRIVATE void ImplInvertFocus( const tools::Rectangle& rRect );
562 
563  SAL_DLLPRIVATE PointerStyle ImplGetMousePointer() const;
564  SAL_DLLPRIVATE void ImplCallMouseMove( sal_uInt16 nMouseCode, bool bModChanged = false );
565  SAL_DLLPRIVATE void ImplGenerateMouseMove();
566 
567  SAL_DLLPRIVATE void ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt );
568  SAL_DLLPRIVATE void ImplNotifyIconifiedState( bool bIconified );
569 
570  SAL_DLLPRIVATE void ImplUpdateAll();
571 
572  SAL_DLLPRIVATE void ImplControlFocus( GetFocusFlags nFlags = GetFocusFlags::NONE );
573 
574  SAL_DLLPRIVATE void ImplMirrorFramePos( Point &pt ) const;
575 
576  SAL_DLLPRIVATE void ImplPosSizeWindow( long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags );
577 
578  SAL_DLLPRIVATE void ImplCallResize();
579  SAL_DLLPRIVATE void ImplCallMove();
580 
581  void IncModalCount();
582  void DecModalCount();
583 
584  SAL_DLLPRIVATE static void ImplCalcSymbolRect( tools::Rectangle& rRect );
585 
586 protected:
587 
589  virtual void dispose() override;
590 
591  SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData );
592 
593  SAL_DLLPRIVATE Point ImplOutputToFrame( const Point& rPos );
594 
595  SAL_DLLPRIVATE void ImplInvalidateParentFrameRegion( vcl::Region& rRegion );
596  SAL_DLLPRIVATE void ImplValidateFrameRegion( const vcl::Region* rRegion, ValidateFlags nFlags );
597  SAL_DLLPRIVATE void ImplValidate();
598  SAL_DLLPRIVATE void ImplMoveInvalidateRegion( const tools::Rectangle& rRect, long nHorzScroll, long nVertScroll, bool bChildren );
599  SAL_DLLPRIVATE void ImplMoveAllInvalidateRegions( const tools::Rectangle& rRect, long nHorzScroll, long nVertScroll, bool bChildren );
600 
601  SAL_DLLPRIVATE vcl::Window* ImplGetBorderWindow() const;
602 
603  SAL_DLLPRIVATE void ImplInvalidate( const vcl::Region* rRegion, InvalidateFlags nFlags );
604 
605  virtual WindowHitTest ImplHitTest( const Point& rFramePos );
606 
607  SAL_DLLPRIVATE void ImplSetMouseTransparent( bool bTransparent );
608 
609  SAL_DLLPRIVATE void ImplScroll( const tools::Rectangle& rRect, long nHorzScroll, long nVertScroll, ScrollFlags nFlags );
610 
611  SAL_DLLPRIVATE bool ImplSetClipFlagChildren( bool bSysObjOnlySmaller );
612  SAL_DLLPRIVATE bool ImplSetClipFlagOverlapWindows( bool bSysObjOnlySmaller = false );
613 
614  SAL_DLLPRIVATE void PushPaintHelper(PaintHelper* pHelper, vcl::RenderContext& rRenderContext);
615  SAL_DLLPRIVATE void PopPaintHelper(PaintHelper const * pHelper);
616 
617 private:
618 
619  SAL_DLLPRIVATE void ImplSetFrameParent( const vcl::Window* pParent );
620 
621  SAL_DLLPRIVATE void ImplInsertWindow( vcl::Window* pParent );
622  SAL_DLLPRIVATE void ImplRemoveWindow( bool bRemoveFrameData );
623 
624  SAL_DLLPRIVATE SalGraphics* ImplGetFrameGraphics() const;
625 
626  SAL_DLLPRIVATE static void ImplCallFocusChangeActivate( vcl::Window* pNewOverlapWindow, vcl::Window* pOldOverlapWindow );
627  SAL_DLLPRIVATE vcl::Window* ImplGetFirstOverlapWindow();
628  SAL_DLLPRIVATE const vcl::Window* ImplGetFirstOverlapWindow() const;
629 
630  SAL_DLLPRIVATE bool ImplIsRealParentPath( const vcl::Window* pWindow ) const;
631 
632  SAL_DLLPRIVATE bool ImplTestMousePointerSet();
633 
634  SAL_DLLPRIVATE void ImplResetReallyVisible();
635  SAL_DLLPRIVATE void ImplSetReallyVisible();
636 
637  SAL_DLLPRIVATE void ImplCallInitShow();
638 
639  SAL_DLLPRIVATE void ImplInitResolutionSettings();
640 
641  SAL_DLLPRIVATE void ImplPointToLogic(vcl::RenderContext const & rRenderContext, vcl::Font& rFont) const;
642  SAL_DLLPRIVATE void ImplLogicToPoint(vcl::RenderContext const & rRenderContext, vcl::Font& rFont) const;
643 
644  SAL_DLLPRIVATE bool ImplSysObjClip( const vcl::Region* pOldRegion );
645  SAL_DLLPRIVATE void ImplUpdateSysObjChildrenClip();
646  SAL_DLLPRIVATE void ImplUpdateSysObjOverlapsClip();
647  SAL_DLLPRIVATE void ImplUpdateSysObjClip();
648 
649  SAL_DLLPRIVATE void ImplIntersectWindowClipRegion( vcl::Region& rRegion );
650  SAL_DLLPRIVATE void ImplIntersectWindowRegion( vcl::Region& rRegion );
651  SAL_DLLPRIVATE void ImplExcludeWindowRegion( vcl::Region& rRegion );
652  SAL_DLLPRIVATE void ImplExcludeOverlapWindows( vcl::Region& rRegion ) const;
653  SAL_DLLPRIVATE void ImplExcludeOverlapWindows2( vcl::Region& rRegion );
654 
655  SAL_DLLPRIVATE void ImplClipBoundaries( vcl::Region& rRegion, bool bThis, bool bOverlaps );
656  SAL_DLLPRIVATE bool ImplClipChildren( vcl::Region& rRegion ) const;
657  SAL_DLLPRIVATE void ImplClipAllChildren( vcl::Region& rRegion ) const;
658  SAL_DLLPRIVATE void ImplClipSiblings( vcl::Region& rRegion ) const;
659 
660  SAL_DLLPRIVATE void ImplInitWinClipRegion();
661  SAL_DLLPRIVATE void ImplInitWinChildClipRegion();
662  SAL_DLLPRIVATE vcl::Region* ImplGetWinChildClipRegion();
663 
664  SAL_DLLPRIVATE void ImplIntersectAndUnionOverlapWindows( const vcl::Region& rInterRegion, vcl::Region& rRegion ) const;
665  SAL_DLLPRIVATE void ImplIntersectAndUnionOverlapWindows2( const vcl::Region& rInterRegion, vcl::Region& rRegion );
666  SAL_DLLPRIVATE void ImplCalcOverlapRegionOverlaps( const vcl::Region& rInterRegion, vcl::Region& rRegion ) const;
667  SAL_DLLPRIVATE void ImplCalcOverlapRegion( const tools::Rectangle& rSourceRect, vcl::Region& rRegion,
668  bool bChildren, bool bSiblings );
669 
676  SAL_DLLPRIVATE void ImplCallPaint(const vcl::Region* pRegion, ImplPaintFlags nPaintFlags);
677 
678  SAL_DLLPRIVATE void ImplCallOverlapPaint();
679 
680  SAL_DLLPRIVATE void ImplUpdateWindowPtr( vcl::Window* pWindow );
681  SAL_DLLPRIVATE void ImplUpdateWindowPtr();
682  SAL_DLLPRIVATE void ImplUpdateOverlapWindowPtr( bool bNewFrame );
683 
684  SAL_DLLPRIVATE bool ImplUpdatePos();
685  SAL_DLLPRIVATE void ImplUpdateSysObjPos();
686 
687  SAL_DLLPRIVATE void ImplUpdateGlobalSettings( AllSettings& rSettings, bool bCallHdl = true ) const;
688 
689  SAL_DLLPRIVATE void ImplToBottomChild();
690 
691  SAL_DLLPRIVATE void ImplCalcToTop( ImplCalcToTopData* pPrevData );
692  SAL_DLLPRIVATE void ImplToTop( ToTopFlags nFlags );
693  SAL_DLLPRIVATE void ImplStartToTop( ToTopFlags nFlags );
694  SAL_DLLPRIVATE void ImplFocusToTop( ToTopFlags nFlags, bool bReallyVisible );
695 
696  SAL_DLLPRIVATE void ImplShowAllOverlaps();
697  SAL_DLLPRIVATE void ImplHideAllOverlaps();
698 
699  SAL_DLLPRIVATE bool ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput );
700  SAL_DLLPRIVATE bool ImplHasDlgCtrl() const;
701  SAL_DLLPRIVATE void ImplDlgCtrlNextWindow();
702  SAL_DLLPRIVATE void ImplDlgCtrlFocusChanged( vcl::Window* pWindow, bool bGetFocus );
703  SAL_DLLPRIVATE vcl::Window* ImplFindDlgCtrlWindow( vcl::Window* pWindow );
704 
705  SAL_DLLPRIVATE static void ImplNewInputContext();
706 
707  SAL_DLLPRIVATE void ImplCallActivateListeners(vcl::Window*);
708  SAL_DLLPRIVATE void ImplCallDeactivateListeners(vcl::Window*);
709 
710  SAL_DLLPRIVATE static void ImplHandleScroll(ScrollBar* pHScrl, double nX, ScrollBar* pVScrl, double nY);
711 
712  SAL_DLLPRIVATE tools::Rectangle ImplOutputToUnmirroredAbsoluteScreenPixel( const tools::Rectangle& rRect ) const;
713  SAL_DLLPRIVATE long ImplGetUnmirroredOutOffX();
714 
715  // retrieves the list of owner draw decorated windows for this window hierarchy
716  SAL_DLLPRIVATE ::std::vector<VclPtr<vcl::Window> >& ImplGetOwnerDrawList();
717 
718  SAL_DLLPRIVATE vcl::Window* ImplGetTopmostFrameWindow();
719 
720  SAL_DLLPRIVATE tools::Rectangle ImplGetWindowExtentsRelative( vcl::Window *pRelativeWindow, bool bClientOnly ) const;
721 
722  SAL_DLLPRIVATE bool ImplStopDnd();
723  SAL_DLLPRIVATE void ImplStartDnd();
724 
725  SAL_DLLPRIVATE void ImplPaintToDevice( ::OutputDevice* pTargetOutDev, const Point& rPos );
726 
727  SAL_DLLPRIVATE css::uno::Reference< css::rendering::XCanvas >
728  ImplGetCanvas( bool bSpriteCanvas ) const;
729 
730 public:
731  virtual vcl::Region GetActiveClipRegion() const override;
732 
733 protected:
734  // Single argument ctors shall be explicit.
735  explicit Window( WindowType nType );
736 
737  void SetCompoundControl( bool bCompound );
738 
739  void CallEventListeners( VclEventId nEvent, void* pData = nullptr );
740  static void FireVclEvent( VclSimpleEvent& rEvent );
741 
742  virtual bool AcquireGraphics() const override;
743  virtual void ReleaseGraphics( bool bRelease = true ) override;
744 
745  virtual void InitClipRegion() override;
746 
747  void ImplClearFontData(bool bNewFontLists) override;
748  void ImplRefreshFontData(bool bNewFontLists) override;
749  void ImplInitMapModeObjects() override;
750 
751  // FIXME: this is a hack to workaround missing layout functionality
752  virtual void ImplAdjustNWFSizes();
753 
754  virtual void CopyDeviceArea( SalTwoRect& aPosAry, bool bWindowInvalidate) override;
755  virtual void ClipToPaintRegion( tools::Rectangle& rDstRect ) override;
756  virtual bool UsePolyPolygonForComplexGradient() override;
757 
758  virtual void ApplySettings(vcl::RenderContext& rRenderContext);
759 public:
760  bool HasMirroredGraphics() const override;
761 
762 public:
763  // Single argument ctors shall be explicit.
764  explicit Window( vcl::Window* pParent, WinBits nStyle = 0 );
765 
766  virtual ~Window() override;
767 
768  ::OutputDevice const* GetOutDev() const;
769  ::OutputDevice* GetOutDev();
770 
771  Color GetBackgroundColor() const override;
772 
773  virtual void EnableRTL ( bool bEnable = true ) override;
774  virtual void MouseMove( const MouseEvent& rMEvt );
775  virtual void MouseButtonDown( const MouseEvent& rMEvt );
776  virtual void MouseButtonUp( const MouseEvent& rMEvt );
777  virtual void KeyInput( const KeyEvent& rKEvt );
778  virtual void KeyUp( const KeyEvent& rKEvt );
779  virtual void PrePaint(vcl::RenderContext& rRenderContext);
780  virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect);
781  virtual void PostPaint(vcl::RenderContext& rRenderContext);
782 
783  using OutputDevice::Erase;
784  void Erase(vcl::RenderContext& rRenderContext);
785 
786  virtual void Draw( ::OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags );
787  virtual void Move();
788  virtual void Resize();
789  virtual void Activate();
790  virtual void Deactivate();
791  virtual void GetFocus();
792  virtual void LoseFocus();
793  virtual void RequestHelp( const HelpEvent& rHEvt );
794  virtual void Command( const CommandEvent& rCEvt );
795  virtual void Tracking( const TrackingEvent& rTEvt );
796  virtual void StateChanged( StateChangedType nStateChange );
797  virtual void DataChanged( const DataChangedEvent& rDCEvt );
798  virtual bool PreNotify( NotifyEvent& rNEvt );
799  virtual bool EventNotify( NotifyEvent& rNEvt );
800 
801  // These methods call the relevant virtual method when not in/post dispose
802  void CompatGetFocus();
803  void CompatLoseFocus();
804  void CompatStateChanged( StateChangedType nStateChange );
805  void CompatDataChanged( const DataChangedEvent& rDCEvt );
806  bool CompatPreNotify( NotifyEvent& rNEvt );
807  bool CompatNotify( NotifyEvent& rNEvt );
808 
809  void AddEventListener( const Link<VclWindowEvent&,void>& rEventListener );
810  void RemoveEventListener( const Link<VclWindowEvent&,void>& rEventListener );
811  void AddChildEventListener( const Link<VclWindowEvent&,void>& rEventListener );
812  void RemoveChildEventListener( const Link<VclWindowEvent&,void>& rEventListener );
813 
814  ImplSVEvent * PostUserEvent( const Link<void*,void>& rLink, void* pCaller = nullptr, bool bReferenceLink = false );
815  void RemoveUserEvent( ImplSVEvent * nUserEvent );
816 
817  // returns the input language used for the last key stroke
818  // may be LANGUAGE_DONTKNOW if not supported by the OS
819  LanguageType GetInputLanguage() const;
820 
821  void SetStyle( WinBits nStyle );
822  WinBits GetStyle() const;
823  WinBits GetPrevStyle() const;
824  void SetExtendedStyle( WindowExtendedStyle nExtendedStyle );
825  WindowExtendedStyle GetExtendedStyle() const;
826  void SetType( WindowType nType );
827  WindowType GetType() const;
828  bool IsSystemWindow() const;
829  bool IsDockingWindow() const;
830  bool IsDialog() const;
831  bool IsMenuFloatingWindow() const;
832  bool IsToolbarFloatingWindow() const;
833  bool IsTopWindow() const;
834  bool IsDisposed() const;
835  SystemWindow* GetSystemWindow() const;
836 
838  bool SupportsDoubleBuffering() const;
840  void RequestDoubleBuffering(bool bRequest);
841 
842  void EnableAllResize();
843 
844  void SetBorderStyle( WindowBorderStyle nBorderStyle );
845  WindowBorderStyle GetBorderStyle() const;
846  void GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
847  sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
848  Size CalcWindowSize( const Size& rOutSz ) const;
849  Size CalcOutputSize( const Size& rWinSz ) const;
850  long CalcTitleWidth() const;
851 
852  void EnableClipSiblings( bool bClipSiblings = true );
853 
854  void EnableChildTransparentMode( bool bEnable = true );
855  bool IsChildTransparentModeEnabled() const;
856 
857  void SetMouseTransparent( bool bTransparent );
858  bool IsMouseTransparent() const;
859  void SetPaintTransparent( bool bTransparent );
860  bool IsPaintTransparent() const;
861  void SetDialogControlStart( bool bStart );
862  bool IsDialogControlStart() const;
863  void SetDialogControlFlags( DialogControlFlags nFlags );
864  DialogControlFlags GetDialogControlFlags() const;
865 
867  {
868  sal_uLong mnState; // the button state
869  Point maPos; // mouse position in output coordinates
870  };
871  PointerState GetPointerState();
872  bool IsMouseOver() const;
873 
874  void SetInputContext( const InputContext& rInputContext );
875  const InputContext& GetInputContext() const;
876  void PostExtTextInputEvent(VclEventId nType, const OUString& rText);
877  void EndExtTextInput();
878  void SetCursorRect( const tools::Rectangle* pRect = nullptr, long nExtTextInputWidth = 0 );
879  const tools::Rectangle* GetCursorRect() const;
880  long GetCursorExtTextInputWidth() const;
881 
882  void SetCompositionCharRect( const tools::Rectangle* pRect, long nCompositionLength, bool bVertical = false );
883 
884  using ::OutputDevice::SetSettings;
885  virtual void SetSettings( const AllSettings& rSettings ) override;
886  void SetSettings( const AllSettings& rSettings, bool bChild );
887  void UpdateSettings( const AllSettings& rSettings, bool bChild = false );
888  void NotifyAllChildren( DataChangedEvent& rDCEvt );
889 
890  void SetPointFont(vcl::RenderContext& rRenderContext, const vcl::Font& rFont);
891  vcl::Font GetPointFont(vcl::RenderContext const & rRenderContext) const;
892  void SetZoomedPointFont(vcl::RenderContext& rRenderContext, const vcl::Font& rFont);
893  long GetDrawPixel( ::OutputDevice const * pDev, long nPixels ) const;
894  vcl::Font GetDrawPixelFont( ::OutputDevice const * pDev ) const;
895 
896  void SetControlFont();
897  void SetControlFont( const vcl::Font& rFont );
898  vcl::Font GetControlFont() const;
899  bool IsControlFont() const;
900  void ApplyControlFont(vcl::RenderContext& rRenderContext, const vcl::Font& rDefaultFont);
901 
902  void SetControlForeground();
903  void SetControlForeground(const Color& rColor);
904  const Color& GetControlForeground() const;
905  bool IsControlForeground() const;
906  void ApplyControlForeground(vcl::RenderContext& rRenderContext, const Color& rDefaultColor);
907 
908  void SetControlBackground();
909  void SetControlBackground( const Color& rColor );
910  const Color& GetControlBackground() const;
911  bool IsControlBackground() const;
912  void ApplyControlBackground(vcl::RenderContext& rRenderContext, const Color& rDefaultColor);
913 
914  void SetParentClipMode( ParentClipMode nMode = ParentClipMode::NONE );
915  ParentClipMode GetParentClipMode() const;
916 
917  void SetWindowRegionPixel();
918  void SetWindowRegionPixel( const vcl::Region& rRegion );
919  vcl::Region GetWindowClipRegionPixel() const;
920  vcl::Region GetPaintRegion() const;
921  bool IsInPaint() const;
922  // while IsInPaint returns true ExpandPaintClipRegion adds the
923  // submitted region to the paint clip region so you can
924  // paint additional parts of your window if necessary
925  void ExpandPaintClipRegion( const vcl::Region& rRegion );
926 
927  void SetParent( vcl::Window* pNewParent );
928  vcl::Window* GetParent() const;
929  // return the dialog we are contained in or NULL if un-contained
930  Dialog* GetParentDialog() const;
931  bool IsAncestorOf( const vcl::Window& rWindow ) const;
932 
933  void Show( bool bVisible = true, ShowFlags nFlags = ShowFlags::NONE );
934  void Hide() { Show( false ); }
935  bool IsVisible() const;
936  bool IsReallyVisible() const;
937  bool IsReallyShown() const;
938  bool IsInInitShow() const;
939 
940  void Enable( bool bEnable = true, bool bChild = true );
941  void Disable( bool bChild = true ) { Enable( false, bChild ); }
942  bool IsEnabled() const;
943 
944  void EnableInput( bool bEnable = true, bool bChild = true );
945  void EnableInput( bool bEnable, const vcl::Window* pExcludeWindow );
946  bool IsInputEnabled() const;
947 
960  void AlwaysEnableInput( bool bAlways, bool bChild = true );
965  bool IsAlwaysEnableInput() const;
980  void AlwaysDisableInput( bool bAlways, bool bChild = true );
981 
998  void SetCallHandlersOnInputDisabled( bool bCall );
1003  bool IsCallHandlersOnInputDisabled() const;
1009  bool IsInModalMode() const;
1010 
1011  void SetActivateMode( ActivateModeFlags nMode );
1012  ActivateModeFlags GetActivateMode() const;
1013 
1014  void ToTop( ToTopFlags nFlags = ToTopFlags::NONE );
1015  void SetZOrder( vcl::Window* pRefWindow, ZOrderFlags nFlags );
1016  void EnableAlwaysOnTop( bool bEnable = true );
1017  bool IsAlwaysOnTopEnabled() const;
1018 
1019  virtual void setPosSizePixel( long nX, long nY,
1020  long nWidth, long nHeight,
1021  PosSizeFlags nFlags = PosSizeFlags::All );
1022  virtual void SetPosPixel( const Point& rNewPos );
1023  virtual Point GetPosPixel() const;
1024  virtual void SetSizePixel( const Size& rNewSize );
1025  virtual Size GetSizePixel() const;
1026  virtual void SetPosSizePixel( const Point& rNewPos,
1027  const Size& rNewSize );
1028  virtual void SetOutputSizePixel( const Size& rNewSize );
1029  bool IsDefaultPos() const;
1030  bool IsDefaultSize() const;
1031  Point GetOffsetPixelFrom(const vcl::Window& rWindow) const;
1032 
1033  // those conversion routines might deliver different results during UI mirroring
1034  Point OutputToScreenPixel( const Point& rPos ) const;
1035  Point ScreenToOutputPixel( const Point& rPos ) const;
1036  // the normalized screen methods work independent from UI mirroring
1037  Point OutputToNormalizedScreenPixel( const Point& rPos ) const;
1038  Point NormalizedScreenToOutputPixel( const Point& rPos ) const;
1039  Point OutputToAbsoluteScreenPixel( const Point& rPos ) const;
1040  Point AbsoluteScreenToOutputPixel( const Point& rPos ) const;
1041  tools::Rectangle GetDesktopRectPixel() const;
1042  // window extents including border and decoration
1043  tools::Rectangle GetWindowExtentsRelative( vcl::Window *pRelativeWindow ) const;
1044  // window extents of the client window, coordinates to be used in SetPosPixel
1045  tools::Rectangle GetClientWindowExtentsRelative() const;
1046 
1047  bool IsScrollable() const;
1048  virtual void Scroll( long nHorzScroll, long nVertScroll,
1049  ScrollFlags nFlags = ScrollFlags::NONE );
1050  void Scroll( long nHorzScroll, long nVertScroll,
1051  const tools::Rectangle& rRect, ScrollFlags nFlags = ScrollFlags::NONE );
1052  virtual void Invalidate( InvalidateFlags nFlags = InvalidateFlags::NONE );
1053  virtual void Invalidate( const tools::Rectangle& rRect, InvalidateFlags nFlags = InvalidateFlags::NONE );
1054  virtual void Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags = InvalidateFlags::NONE );
1061  virtual void LogicInvalidate(const tools::Rectangle* pRectangle);
1062 
1069  virtual void PixelInvalidate(const tools::Rectangle* pRectangle);
1070  void Validate();
1071  bool HasPaintEvent() const;
1072  void Update();
1073  void Flush() override;
1074 
1075  // toggles new docking support, enabled via toolkit
1076  void EnableDocking( bool bEnable = true );
1077  // retrieves the single dockingmanager instance
1078  static DockingManager* GetDockingManager();
1079 
1080  void EnablePaint( bool bEnable );
1081  bool IsPaintEnabled() const;
1082  void SetUpdateMode( bool bUpdate );
1083  bool IsUpdateMode() const;
1084  void SetParentUpdateMode( bool bUpdate );
1085 
1086  void GrabFocus();
1087  bool HasFocus() const;
1088  bool HasChildPathFocus( bool bSystemWindow = false ) const;
1089  bool IsActive() const;
1090  bool HasActiveChildFrame() const;
1091  GetFocusFlags GetGetFocusFlags() const;
1092  void GrabFocusToDocument();
1093  VclPtr<vcl::Window> GetFocusedWindow() const;
1094 
1100  void SetFakeFocus( bool bFocus );
1101 
1102  bool IsCompoundControl() const;
1103 
1104  static VclPtr<vcl::Window> SaveFocus();
1105  static void EndSaveFocus(const VclPtr<vcl::Window>& xFocusWin);
1106 
1107  void CaptureMouse();
1108  void ReleaseMouse();
1109  bool IsMouseCaptured() const;
1110 
1111  void SetPointer( PointerStyle );
1112  PointerStyle GetPointer() const;
1113  void EnableChildPointerOverwrite( bool bOverwrite );
1114  void SetPointerPosPixel( const Point& rPos );
1115  Point GetPointerPosPixel();
1116  Point GetLastPointerPosPixel();
1118  void SetLastMousePos(const Point& rPos);
1119  void ShowPointer( bool bVisible );
1120  void EnterWait();
1121  void LeaveWait();
1122  bool IsWait() const;
1123 
1124  void SetCursor( vcl::Cursor* pCursor );
1125  vcl::Cursor* GetCursor() const;
1126 
1127  void SetZoom( const Fraction& rZoom );
1128  const Fraction& GetZoom() const;
1129  bool IsZoom() const;
1130  long CalcZoom( long n ) const;
1131 
1132  virtual void SetText( const OUString& rStr );
1133  virtual OUString GetText() const;
1134  // return the actual text displayed
1135  // this may have e.g. accelerators removed or portions
1136  // replaced by ellipses
1137  virtual OUString GetDisplayText() const;
1138  // gets the visible background color. for transparent windows
1139  // this may be the parent's background color; for controls
1140  // this may be a child's background color (e.g. ListBox)
1141  virtual const Wallpaper& GetDisplayBackground() const;
1142 
1143  void SetHelpText( const OUString& rHelpText );
1144  const OUString& GetHelpText() const;
1145 
1146  void SetQuickHelpText( const OUString& rHelpText );
1147  const OUString& GetQuickHelpText() const;
1148 
1149  void SetHelpId( const OString& );
1150  const OString& GetHelpId() const;
1151 
1152  vcl::Window* FindWindow( const Point& rPos ) const;
1153 
1154  sal_uInt16 GetChildCount() const;
1155  vcl::Window* GetChild( sal_uInt16 nChild ) const;
1156  vcl::Window* GetWindow( GetWindowType nType ) const;
1157  bool IsChild( const vcl::Window* pWindow ) const;
1158  bool IsWindowOrChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const;
1159 
1161  SAL_DLLPRIVATE void CollectChildren(::std::vector<vcl::Window *>& rAllChildren );
1162 
1163  virtual void ShowFocus(const tools::Rectangle& rRect);
1164  void HideFocus();
1165 
1166  // transparent background for selected or checked items in toolboxes etc.
1167  void DrawSelectionBackground( const tools::Rectangle& rRect, sal_uInt16 highlight, bool bChecked, bool bDrawBorder );
1168 
1169  void ShowTracking( const tools::Rectangle& rRect,
1171  void HideTracking();
1172  void InvertTracking( const tools::Rectangle& rRect, ShowTrackFlags nFlags );
1173 
1174  void StartTracking( StartTrackingFlags nFlags = StartTrackingFlags::NONE );
1175  void EndTracking( TrackingEventFlags nFlags = TrackingEventFlags::NONE );
1176  bool IsTracking() const;
1177 
1178  void StartAutoScroll( StartAutoScrollFlags nFlags );
1179  void EndAutoScroll();
1180 
1181  bool HandleScrollCommand( const CommandEvent& rCmd,
1182  ScrollBar* pHScrl,
1183  ScrollBar* pVScrl );
1184 
1185  void SaveBackground(VirtualDevice& rSaveDevice,
1186  const Point& rPos, const Size& rSize, const Size&) const override;
1187 
1188  virtual const SystemEnvData* GetSystemData() const;
1189 
1190  // API to set/query the component interfaces
1191  virtual css::uno::Reference< css::awt::XWindowPeer >
1192  GetComponentInterface( bool bCreate = true );
1193 
1194  void SetComponentInterface( css::uno::Reference< css::awt::XWindowPeer > const & xIFace );
1195 
1197  void SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier, bool bParent = false);
1198  const vcl::ILibreOfficeKitNotifier* GetLOKNotifier() const;
1199  vcl::LOKWindowId GetLOKWindowId() const;
1200 
1202  VclPtr<vcl::Window> GetParentWithLOKNotifier();
1203 
1205  void ReleaseLOKNotifier();
1206 
1208  static VclPtr<vcl::Window> FindLOKWindow(vcl::LOKWindowId nWindowId);
1209 
1211  static bool IsLOKWindowsEmpty();
1212 
1214  virtual boost::property_tree::ptree DumpAsPropertyTree();
1215 
1217  virtual void LogicMouseButtonDown(const MouseEvent&) {};
1219  virtual void LogicMouseButtonUp(const MouseEvent&) {};
1221  virtual void LogicMouseMove(const MouseEvent&) {};
1222 
1225 public:
1227 
1228  css::uno::Reference< css::accessibility::XAccessible >
1229  GetAccessible( bool bCreate = true );
1230 
1231  virtual css::uno::Reference< css::accessibility::XAccessible >
1232  CreateAccessible();
1233 
1234  void SetAccessible( const css::uno::Reference< css::accessibility::XAccessible >& );
1235 
1236  vcl::Window* GetAccessibleParentWindow() const;
1237  sal_uInt16 GetAccessibleChildWindowCount();
1238  vcl::Window* GetAccessibleChildWindow( sal_uInt16 n );
1239 
1240  void SetAccessibleRole( sal_uInt16 nRole );
1241  sal_uInt16 GetAccessibleRole() const;
1242 
1243  void SetAccessibleName( const OUString& rName );
1244  OUString GetAccessibleName() const;
1245 
1246  void SetAccessibleDescription( const OUString& rDescr );
1247  OUString GetAccessibleDescription() const;
1248 
1249  void SetAccessibleRelationLabeledBy( vcl::Window* pLabeledBy );
1250  vcl::Window* GetAccessibleRelationLabeledBy() const;
1251 
1252  void SetAccessibleRelationLabelFor( vcl::Window* pLabelFor );
1253  vcl::Window* GetAccessibleRelationLabelFor() const;
1254 
1255  void SetAccessibleRelationMemberOf( vcl::Window* pMemberOf );
1256  vcl::Window* GetAccessibleRelationMemberOf() const;
1257 
1258  void AddExtraAccessibleRelation(const css::accessibility::AccessibleRelation &rRelation);
1259  const std::vector<css::accessibility::AccessibleRelation>& GetExtraAccessibleRelations() const;
1260  void ClearExtraAccessibleRelations();
1261 
1262  // to avoid sending accessibility events in cases like closing dialogs
1263  // by default checks complete parent path
1264  bool IsAccessibilityEventsSuppressed( bool bTraverseParentPath = true );
1265  void SetAccessibilityEventsSuppressed(bool bSuppressed);
1266 
1267  KeyEvent GetActivationKey() const;
1268 
1269 protected:
1270 
1271  // These eventually are supposed to go when everything is converted to .ui
1272  SAL_DLLPRIVATE vcl::Window* getLegacyNonLayoutAccessibleRelationMemberOf() const;
1273  SAL_DLLPRIVATE vcl::Window* getLegacyNonLayoutAccessibleRelationLabeledBy() const;
1274  SAL_DLLPRIVATE vcl::Window* getLegacyNonLayoutAccessibleRelationLabelFor() const;
1275 
1276  // Let Label override the code part of GetAccessibleRelationLabelFor
1277  virtual vcl::Window* getAccessibleRelationLabelFor() const;
1278  virtual sal_uInt16 getDefaultAccessibleRole() const;
1279  virtual OUString getDefaultAccessibleName() const;
1280 
1281  /*
1282  * Advisory Sizing - what is a good size for this widget
1283  *
1284  * Retrieves the preferred size of a widget ignoring
1285  * "width-request" and "height-request" properties.
1286  *
1287  * Implement this in sub-classes to tell layout
1288  * the preferred widget size.
1289  *
1290  * Use get_preferred_size to retrieve this value
1291  * cached and mediated via height and width requests
1292  */
1293  virtual Size GetOptimalSize() const;
1295  void InvalidateSizeCache();
1296 private:
1297 
1298  SAL_DLLPRIVATE bool ImplIsAccessibleCandidate() const;
1299  SAL_DLLPRIVATE bool ImplIsAccessibleNativeFrame() const;
1301 
1302  /*
1303  * Retrieves the preferred size of a widget taking
1304  * into account the "width-request" and "height-request" properties.
1305  *
1306  * Overrides the result of GetOptimalSize to honor the
1307  * width-request and height-request properties.
1308  *
1309  * So the same as get_ungrouped_preferred_size except
1310  * it ignores groups. A building block of get_preferred_size
1311  * that access the size cache
1312  *
1313  * @see get_preferred_size
1314  */
1315  Size get_ungrouped_preferred_size() const;
1316 public:
1318  css::uno::Reference< css::rendering::XCanvas >
1319  GetCanvas() const;
1321  css::uno::Reference< css::rendering::XSpriteCanvas >
1322  GetSpriteCanvas() const;
1323 
1324  /* records all DrawText operations within the passed rectangle;
1325  * a synchronous paint is sent to achieve this
1326  */
1327  void RecordLayoutData( vcl::ControlLayoutData* pLayout, const tools::Rectangle& rRect );
1328 
1329  // set and retrieve for Toolkit
1330  VCLXWindow* GetWindowPeer() const;
1331  void SetWindowPeer( css::uno::Reference< css::awt::XWindowPeer > const & xPeer, VCLXWindow* pVCLXWindow );
1332 
1333  // remember if it was generated by Toolkit
1334  bool IsCreatedWithToolkit() const;
1335  void SetCreatedWithToolkit( bool b );
1336 
1337  // Drag and Drop interfaces
1338  css::uno::Reference< css::datatransfer::dnd::XDropTarget > GetDropTarget();
1339  css::uno::Reference< css::datatransfer::dnd::XDragSource > GetDragSource();
1340  css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > GetDragGestureRecognizer();
1341 
1342  // Clipboard/Selection interfaces
1343  css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard();
1345  void SetClipboard(css::uno::Reference<css::datatransfer::clipboard::XClipboard> const & xClipboard);
1346  css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetPrimarySelection();
1347 
1348  /*
1349  * Widgets call this to inform their owner container that the widget wants
1350  * to renegotiate its size. Should be called when a widget has a new size
1351  * request. e.g. a FixedText Control gets a new label.
1352  *
1353  * akin to gtk_widget_queue_resize
1354  */
1355  virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout);
1356 
1357  /*
1358  * Sets the "height-request" property
1359  *
1360  * Override for height request of the widget, or -1 if natural request
1361  * should be used.
1362  *
1363  * @see get_preferred_size, set_width_request
1364  */
1365  void set_height_request(sal_Int32 nHeightRequest);
1366  sal_Int32 get_height_request() const;
1367 
1368  /*
1369  * Sets the "width-request" property
1370  *
1371  * Override for width request of the widget, or -1 if natural request
1372  * should be used.
1373  *
1374  * @see get_preferred_size, set_height_request
1375  */
1376  void set_width_request(sal_Int32 nWidthRequest);
1377  sal_Int32 get_width_request() const;
1378 
1379  /*
1380  * Retrieves the preferred size of a widget taking
1381  * into account the "width-request" and "height-request" properties.
1382  *
1383  * Overrides the result of GetOptimalSize to honor the
1384  * width-request and height-request properties.
1385  *
1386  * @see GetOptimalSize
1387  *
1388  * akin to gtk_widget_get_preferred_size
1389  */
1390  Size get_preferred_size() const;
1391 
1392  /*
1393  * How to horizontally align this widget
1394  */
1395  VclAlign get_halign() const;
1396  void set_halign(VclAlign eAlign);
1397 
1398  /*
1399  * How to vertically align this widget
1400  */
1401  VclAlign get_valign() const;
1402  void set_valign(VclAlign eAlign);
1403 
1404  /*
1405  * Whether the widget would like to use any available extra horizontal
1406  * space.
1407  */
1408  bool get_hexpand() const;
1409  void set_hexpand(bool bExpand);
1410 
1411  /*
1412  * Whether the widget would like to use any available extra vertical
1413  * space.
1414  */
1415  bool get_vexpand() const;
1416  void set_vexpand(bool bExpand);
1417 
1418  /*
1419  * Whether the widget would like to use any available extra space.
1420  */
1421  bool get_expand() const;
1422  void set_expand(bool bExpand);
1423 
1424  /*
1425  * Whether the widget should receive extra space when the parent grows
1426  */
1427  bool get_fill() const;
1428  void set_fill(bool bFill);
1429 
1430  void set_border_width(sal_Int32 nBorderWidth);
1431  sal_Int32 get_border_width() const;
1432 
1433  void set_margin_left(sal_Int32 nWidth);
1434  sal_Int32 get_margin_left() const;
1435 
1436  void set_margin_right(sal_Int32 nWidth);
1437  sal_Int32 get_margin_right() const;
1438 
1439  void set_margin_top(sal_Int32 nWidth);
1440  sal_Int32 get_margin_top() const;
1441 
1442  void set_margin_bottom(sal_Int32 nWidth);
1443  sal_Int32 get_margin_bottom() const;
1444 
1445  /*
1446  * How the widget is packed with reference to the start or end of the parent
1447  */
1448  VclPackType get_pack_type() const;
1449  void set_pack_type(VclPackType ePackType);
1450 
1451  /*
1452  * The extra space to put between the widget and its neighbors
1453  */
1454  sal_Int32 get_padding() const;
1455  void set_padding(sal_Int32 nPadding);
1456 
1457  /*
1458  * The number of columns that the widget spans
1459  */
1460  sal_Int32 get_grid_width() const;
1461  void set_grid_width(sal_Int32 nCols);
1462 
1463  /*
1464  * The column number to attach the left side of the widget to
1465  */
1466  sal_Int32 get_grid_left_attach() const;
1467  void set_grid_left_attach(sal_Int32 nAttach);
1468 
1469  /*
1470  * The number of row that the widget spans
1471  */
1472  sal_Int32 get_grid_height() const;
1473  void set_grid_height(sal_Int32 nRows);
1474 
1475  /*
1476  * The row number to attach the top side of the widget to
1477  */
1478  sal_Int32 get_grid_top_attach() const;
1479  void set_grid_top_attach(sal_Int32 nAttach);
1480 
1481  /*
1482  * If true this child appears in a secondary layout group of children
1483  * e.g. help buttons in a buttonbox
1484  */
1485  bool get_secondary() const;
1486  void set_secondary(bool bSecondary);
1487 
1488  /*
1489  * If true this child is exempted from homogeneous sizing
1490  * e.g. special button in a buttonbox
1491  */
1492  bool get_non_homogeneous() const;
1493  void set_non_homogeneous(bool bNonHomogeneous);
1494 
1495  /*
1496  * Sets a widget property
1497  *
1498  * @return false if property is unknown
1499  */
1500  virtual bool set_property(const OString &rKey, const OUString &rValue);
1501 
1502  /*
1503  * Sets a font attribute
1504  *
1505  * @return false if attribute is unknown
1506  */
1507  bool set_font_attribute(const OString &rKey, const OUString &rValue);
1508 
1509  /*
1510  * Adds this widget to the xGroup VclSizeGroup
1511  *
1512  */
1513  void add_to_size_group(const std::shared_ptr<VclSizeGroup>& xGroup);
1514  void remove_from_all_size_groups();
1515 
1516  /*
1517  * add/remove mnemonic label
1518  */
1519  void add_mnemonic_label(FixedText *pLabel);
1520  void remove_mnemonic_label(FixedText *pLabel);
1521  const std::vector<VclPtr<FixedText> >& list_mnemonic_labels() const;
1522 
1523  /*
1524  * Move this widget to be the nNewPosition'd child of its parent
1525  */
1526  void reorderWithinParent(sal_uInt16 nNewPosition);
1527 
1531  void set_id(const OUString& rID);
1532 
1536  const OUString& get_id() const;
1537 
1538 
1539  // Native Widget Rendering functions
1540 
1541 
1542  // form controls must never use native widgets, this can be toggled here
1543  void EnableNativeWidget( bool bEnable = true );
1544  bool IsNativeWidgetEnabled() const;
1545 
1546  // a helper method for a Control's Draw method
1547  void PaintToDevice( ::OutputDevice* pDevice, const Point& rPos, const Size& rSize );
1548 
1549  /* tdf#119390 set parent to default window. Typically for use in advance of destroying
1550  * a floating windows which has the current focus so focus will revert to the main
1551  * document window and not the first widget in the current parent of the floating
1552  * window.
1553  */
1554  void SetParentToDefaultWindow();
1555 
1556 
1557  // Keyboard access functions
1558 
1567  KeyIndicatorState GetIndicatorState() const;
1568 
1569  void SimulateKeyPress( sal_uInt16 nKeyCode ) const;
1570 
1571  virtual OUString GetSurroundingText() const;
1572  virtual Selection GetSurroundingTextSelection() const;
1573 
1574  virtual FactoryFunction GetUITestFactory() const;
1575 
1576  virtual bool IsChart() const { return false; }
1577 
1578  void SetHelpHdl(const Link<vcl::Window&, bool>& rLink);
1579  void SetMnemonicActivateHdl(const Link<vcl::Window&, bool>& rLink);
1580  void SetModalHierarchyHdl(const Link<bool, void>& rLink);
1581 };
1582 
1583 }
1584 
1585 #endif // INCLUDED_VCL_WINDOW_HXX
1586 
1587 /* 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:555
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:2530
void Hide()
Definition: window.hxx:934
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:237
virtual bool IsChart() const
Definition: window.hxx:1576
void Disable(bool bChild=true)
Definition: window.hxx:941
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:1219
WindowType
State
PointerStyle
Definition: ptrstyle.hxx:25
virtual void LogicMouseButtonDown(const MouseEvent &)
Same as MouseButtonDown(), but coordinates are in logic unit. used for LOK.
Definition: window.hxx:1217
VclAlign
Definition: vclenum.hxx: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:1221
void dispose()
weld::Window * GetFrameWeld(const SfxFrame *pFrame)