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