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