xref: /AOO41X/main/vcl/inc/vcl/window.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SV_WINDOW_HXX
29 #define _SV_WINDOW_HXX
30 
31 #include <vcl/sv.h>
32 #include <vcl/dllapi.h>
33 #include <vcl/outdev.hxx>
34 #include <tools/resid.hxx>
35 #ifndef _SV_POINTR_HXX
36 #include <vcl/pointr.hxx>
37 #endif
38 #include <tools/wintypes.hxx>
39 #ifndef _SV_APPTYPES_HXX
40 #include <vcl/apptypes.hxx>
41 #endif
42 #include <vcl/inputctx.hxx>
43 #include <vcl/vclevent.hxx>
44 // Only for compatibility - because many people outside haven't included event.hxx
45 #ifndef _VCL_EVENT_HXX
46 #include <vcl/event.hxx>
47 #endif
48 #include <vcl/region.hxx>
49 #include <vcl/salnativewidgets.hxx>
50 #include <rtl/ustring.hxx>
51 #include <cppuhelper/weakref.hxx>
52 #include <com/sun/star/uno/Reference.hxx>
53 #include <boost/shared_ptr.hpp>
54 
55 class VirtualDevice;
56 struct ImplDelData;
57 struct ImplWinData;
58 struct ImplOverlapData;
59 struct ImplFrameData;
60 struct ImplCalcToTopData;
61 struct SystemEnvData;
62 struct SystemParentData;
63 class ImplBorderWindow;
64 class VirtualDevice;
65 class Timer;
66 class Cursor;
67 class DockingManager;
68 class ScrollBar;
69 class Bitmap;
70 class Image;
71 class MouseEvent;
72 class KeyEvent;
73 class CommandEvent;
74 class TrackingEvent;
75 class HelpEvent;
76 class DataChangedEvent;
77 class NotifyEvent;
78 class SystemWindow;
79 class SalFrame;
80 class SalObject;
81 class MenuFloatingWindow;
82 class UNOWindowData;
83 // Nur fuer ExecuteDrag:
84 struct IDataObject;
85 class VCLXWindow;
86 struct ImplAccessibleInfos;
87 
88 namespace com {
89 namespace sun {
90 namespace star {
91 namespace accessibility {
92     class XAccessible;
93 }}}}
94 
95 namespace com {
96 namespace sun {
97 namespace star {
98 namespace beans {
99     struct PropertyValue;
100 }}}}
101 
102 namespace com {
103 namespace sun {
104 namespace star {
105 namespace rendering {
106     class XCanvas;
107     class XSpriteCanvas;
108 }}}}
109 
110 namespace com {
111 namespace sun {
112 namespace star {
113 namespace awt {
114     class XWindowPeer;
115     class XWindow;
116 }
117 namespace uno {
118     class Any;
119     class XInterface;
120 }
121 namespace datatransfer {
122 namespace clipboard {
123     class XClipboard;
124 }
125 
126 namespace dnd {
127     class XDragGestureRecognizer;
128     class XDragSource;
129     class XDropTarget;
130 } } } } }
131 
132 namespace vcl {
133     struct ControlLayoutData;
134     class WindowArranger;
135     struct ExtWindowImpl;
136 }
137 
138 namespace svt { class PopupWindowControllerImpl; }
139 
140 // ---------------
141 // - WindowTypes -
142 // ---------------
143 
144 // Type fuer GetWindow()
145 #define WINDOW_PARENT                   ((sal_uInt16)0)
146 #define WINDOW_FIRSTCHILD               ((sal_uInt16)1)
147 #define WINDOW_LASTCHILD                ((sal_uInt16)2)
148 #define WINDOW_PREV                     ((sal_uInt16)3)
149 #define WINDOW_NEXT                     ((sal_uInt16)4)
150 #define WINDOW_FIRSTOVERLAP             ((sal_uInt16)5)
151 #define WINDOW_LASTOVERLAP              ((sal_uInt16)6)
152 #define WINDOW_OVERLAP                  ((sal_uInt16)7)
153 #define WINDOW_PARENTOVERLAP            ((sal_uInt16)8)
154 #define WINDOW_CLIENT                   ((sal_uInt16)9)
155 #define WINDOW_REALPARENT               ((sal_uInt16)10)
156 #define WINDOW_FRAME                    ((sal_uInt16)11)
157 #define WINDOW_BORDER                   ((sal_uInt16)12)
158 #define WINDOW_FIRSTTOPWINDOWCHILD      ((sal_uInt16)13)
159 #define WINDOW_LASTTOPWINDOWCHILD       ((sal_uInt16)14)
160 #define WINDOW_PREVTOPWINDOWSIBLING     ((sal_uInt16)15)
161 #define WINDOW_NEXTTOPWINDOWSIBLING     ((sal_uInt16)16)
162 
163 // Flags for SetPosSizePixel()
164 #define WINDOW_POSSIZE_X                ((sal_uInt16)0x0001)
165 #define WINDOW_POSSIZE_Y                ((sal_uInt16)0x0002)
166 #define WINDOW_POSSIZE_WIDTH            ((sal_uInt16)0x0004)
167 #define WINDOW_POSSIZE_HEIGHT           ((sal_uInt16)0x0008)
168 #define WINDOW_POSSIZE_POS              (WINDOW_POSSIZE_X | WINDOW_POSSIZE_Y)
169 #define WINDOW_POSSIZE_SIZE             (WINDOW_POSSIZE_WIDTH | WINDOW_POSSIZE_HEIGHT)
170 #define WINDOW_POSSIZE_POSSIZE          (WINDOW_POSSIZE_POS | WINDOW_POSSIZE_SIZE)
171 #define WINDOW_POSSIZE_ALL              (WINDOW_POSSIZE_POSSIZE)
172 #define WINDOW_POSSIZE_DROPDOWN         ((sal_uInt16)0x0010)
173 
174 // Flags for Show()
175 #define SHOW_NOPARENTUPDATE             ((sal_uInt16)0x0001)
176 #define SHOW_NOFOCUSCHANGE              ((sal_uInt16)0x0002)
177 #define SHOW_NOACTIVATE                 ((sal_uInt16)0x0004)
178 #define SHOW_FOREGROUNDTASK             ((sal_uInt16)0x0008)
179 
180 // Flags for SetZOrder()
181 #define WINDOW_ZORDER_BEFOR             ((sal_uInt16)0x0001)
182 #define WINDOW_ZORDER_BEHIND            ((sal_uInt16)0x0002)
183 #define WINDOW_ZORDER_FIRST             ((sal_uInt16)0x0004)
184 #define WINDOW_ZORDER_LAST              ((sal_uInt16)0x0008)
185 
186 // Activate-Flags
187 #define ACTIVATE_MODE_GRABFOCUS         ((sal_uInt16)0x0001)
188 
189 // ToTop-Flags
190 #define TOTOP_RESTOREWHENMIN            ((sal_uInt16)0x0001)
191 #define TOTOP_FOREGROUNDTASK            ((sal_uInt16)0x0002)
192 #define TOTOP_NOGRABFOCUS               ((sal_uInt16)0x0004)
193 //#if 0 // _SOLAR__PRIVATE // vcl internal only
194 #define TOTOP_GRABFOCUSONLY             ((sal_uInt16)0x0008)
195 //#endif
196 
197 // Flags for Invalidate
198 #define INVALIDATE_CHILDREN             ((sal_uInt16)0x0001)
199 #define INVALIDATE_NOCHILDREN           ((sal_uInt16)0x0002)
200 #define INVALIDATE_NOERASE              ((sal_uInt16)0x0004)
201 #define INVALIDATE_UPDATE               ((sal_uInt16)0x0008)
202 #define INVALIDATE_TRANSPARENT          ((sal_uInt16)0x0010)
203 #define INVALIDATE_NOTRANSPARENT        ((sal_uInt16)0x0020)
204 #define INVALIDATE_NOCLIPCHILDREN       ((sal_uInt16)0x4000)
205 // Temporaer fuer Kompatibilitaet
206 #define INVALIDATE_BACKGROUND           INVALIDATE_TRANSPARENT
207 
208 // Flags for Validate
209 #define VALIDATE_CHILDREN               ((sal_uInt16)0x0001)
210 #define VALIDATE_NOCHILDREN             ((sal_uInt16)0x0002)
211 
212 // Flags for Scroll
213 #define SCROLL_CLIP                     ((sal_uInt16)0x0001)
214 #define SCROLL_CHILDREN                 ((sal_uInt16)0x0002)
215 #define SCROLL_NOCHILDREN               ((sal_uInt16)0x0004)
216 #define SCROLL_NOERASE                  ((sal_uInt16)0x0008)
217 #define SCROLL_NOINVALIDATE             ((sal_uInt16)0x0010)
218 #define SCROLL_NOWINDOWINVALIDATE       ((sal_uInt16)0x0020)
219 #define SCROLL_USECLIPREGION            ((sal_uInt16)0x0040)
220 #define SCROLL_UPDATE                   ((sal_uInt16)0x0080)
221 
222 // Flags for ParentClipMode
223 #define PARENTCLIPMODE_CLIP             ((sal_uInt16)0x0001)
224 #define PARENTCLIPMODE_NOCLIP           ((sal_uInt16)0x0002)
225 
226 // Flags for Invert()
227 #define INVERT_HIGHLIGHT                ((sal_uInt16)0x0001)
228 #define INVERT_50                       ((sal_uInt16)0x0002)
229 
230 // Flags for ShowTracking()
231 #define SHOWTRACK_SMALL                 ((sal_uInt16)0x0001)
232 #define SHOWTRACK_BIG                   ((sal_uInt16)0x0002)
233 #define SHOWTRACK_SPLIT                 ((sal_uInt16)0x0003)
234 #define SHOWTRACK_OBJECT                ((sal_uInt16)0x0004)
235 #define SHOWTRACK_WINDOW                ((sal_uInt16)0x1000)
236 #define SHOWTRACK_CLIP                  ((sal_uInt16)0x2000)
237 #define SHOWTRACK_STYLE                 ((sal_uInt16)0x000F)
238 
239 // Flags for StartTracking()
240 #define STARTTRACK_KEYINPUT             ((sal_uInt16)0x0001)
241 #define STARTTRACK_KEYMOD               ((sal_uInt16)0x0002)
242 #define STARTTRACK_NOKEYCANCEL          ((sal_uInt16)0x0004)
243 #define STARTTRACK_SCROLLREPEAT         ((sal_uInt16)0x0008)
244 #define STARTTRACK_BUTTONREPEAT         ((sal_uInt16)0x0010)
245 #define STARTTRACK_MOUSEBUTTONDOWN      ((sal_uInt16)0x0020)
246 #define STARTTRACK_FOCUSCANCEL          ((sal_uInt16)0x0040)
247 
248 // Flags for StartAutoScroll()
249 #define AUTOSCROLL_VERT                 ((sal_uInt16)0x0001)
250 #define AUTOSCROLL_HORZ                 ((sal_uInt16)0x0002)
251 
252 // Flags for StateChanged()
253 typedef sal_uInt16 StateChangedType;
254 #define STATE_CHANGE_INITSHOW           ((StateChangedType)1)
255 #define STATE_CHANGE_VISIBLE            ((StateChangedType)2)
256 #define STATE_CHANGE_UPDATEMODE         ((StateChangedType)3)
257 #define STATE_CHANGE_ENABLE             ((StateChangedType)4)
258 #define STATE_CHANGE_TEXT               ((StateChangedType)5)
259 #define STATE_CHANGE_IMAGE              ((StateChangedType)6)
260 #define STATE_CHANGE_DATA               ((StateChangedType)7)
261 #define STATE_CHANGE_STATE              ((StateChangedType)8)
262 #define STATE_CHANGE_STYLE              ((StateChangedType)9)
263 #define STATE_CHANGE_ZOOM               ((StateChangedType)10)
264 #define STATE_CHANGE_BORDER             ((StateChangedType)11)
265 #define STATE_CHANGE_TRANSPARENT        ((StateChangedType)12)
266 #define STATE_CHANGE_CONTROLFONT        ((StateChangedType)13)
267 #define STATE_CHANGE_CONTROLFOREGROUND  ((StateChangedType)14)
268 #define STATE_CHANGE_CONTROLBACKGROUND  ((StateChangedType)15)
269 #define STATE_CHANGE_READONLY           ((StateChangedType)16)
270 #define STATE_CHANGE_FORMAT             ((StateChangedType)17)
271 #define STATE_CHANGE_EXTENDEDSTYLE      ((StateChangedType)18)
272 #define STATE_CHANGE_MIRRORING          ((StateChangedType)19)
273 #define STATE_CHANGE_CONTROL_FOCUS      ((StateChangedType)20)
274 #define STATE_CHANGE_USER               ((StateChangedType)10000)
275 
276 // GetFocusFlags
277 #define GETFOCUS_TAB                    ((sal_uInt16)0x0001)
278 #define GETFOCUS_CURSOR                 ((sal_uInt16)0x0002)
279 #define GETFOCUS_MNEMONIC               ((sal_uInt16)0x0004)
280 #define GETFOCUS_FORWARD                ((sal_uInt16)0x0010)
281 #define GETFOCUS_BACKWARD               ((sal_uInt16)0x0020)
282 #define GETFOCUS_AROUND                 ((sal_uInt16)0x0040)
283 #define GETFOCUS_UNIQUEMNEMONIC         ((sal_uInt16)0x0100)
284 #define GETFOCUS_INIT                   ((sal_uInt16)0x0200)
285 #define GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0400)
286 
287 // Draw-Flags fuer Draw()
288 #define WINDOW_DRAW_MONO                ((sal_uLong)0x00000001)
289 #define WINDOW_DRAW_NOBORDER            ((sal_uLong)0x00000002)
290 #define WINDOW_DRAW_NOCONTROLS          ((sal_uLong)0x00000004)
291 #define WINDOW_DRAW_NODISABLE           ((sal_uLong)0x00000008)
292 #define WINDOW_DRAW_NOMNEMONIC          ((sal_uLong)0x00000010)
293 #define WINDOW_DRAW_NOSELECTION         ((sal_uLong)0x00000020)
294 #define WINDOW_DRAW_NOFOCUS             ((sal_uLong)0x00000040)
295 #define WINDOW_DRAW_NOBACKGROUND        ((sal_uLong)0x00000080)
296 #define WINDOW_DRAW_ROLLOVER            ((sal_uLong)0x00000100)
297 
298 // Border-Styles fuer SetBorder()
299 #define WINDOW_BORDER_NORMAL            ((sal_uInt16)0x0001)
300 #define WINDOW_BORDER_MONO              ((sal_uInt16)0x0002)
301 #define WINDOW_BORDER_ACTIVE            ((sal_uInt16)0x0004)
302 #define WINDOW_BORDER_DOUBLEOUT         ((sal_uInt16)0x0008)
303 #define WINDOW_BORDER_MENU              ((sal_uInt16)0x0010)
304 #define WINDOW_BORDER_NOBORDER          ((sal_uInt16)0x1000)
305 #define WINDOW_BORDER_REMOVEBORDER      ((sal_uInt16)0x2000)
306 
307 // DialogControl-Flags
308 #define WINDOW_DLGCTRL_RETURN           ((sal_uInt16)0x0001)
309 #define WINDOW_DLGCTRL_WANTFOCUS        ((sal_uInt16)0x0002)
310 #define WINDOW_DLGCTRL_MOD1TAB          ((sal_uInt16)0x0004)
311 #define WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0008)
312 
313 // GetWindowClipRegionPixel-Flags
314 #define WINDOW_GETCLIPREGION_NULL       ((sal_uInt16)0x0001)
315 #define WINDOW_GETCLIPREGION_NOCHILDREN ((sal_uInt16)0x0002)
316 
317 // EndExtTextInput-Flags
318 #define EXTTEXTINPUT_END_COMPLETE       ((sal_uInt16)0x0001)
319 #define EXTTEXTINPUT_END_CANCEL         ((sal_uInt16)0x0002)
320 
321 //#if 0 // _SOLAR__PRIVATE
322 #define IMPL_MINSIZE_BUTTON_WIDTH       70
323 #define IMPL_MINSIZE_BUTTON_HEIGHT      22
324 #define IMPL_EXTRA_BUTTON_WIDTH         18
325 #define IMPL_EXTRA_BUTTON_HEIGHT        10
326 #define IMPL_SEP_BUTTON_X               5
327 #define IMPL_SEP_BUTTON_Y               5
328 #define IMPL_MINSIZE_MSGBOX_WIDTH       150
329 #define IMPL_MINSIZE_MSGBOX_HEIGHT      80
330 #define IMPL_DIALOG_OFFSET              5
331 #define IMPL_DIALOG_BAR_OFFSET          3
332 #define IMPL_MSGBOX_OFFSET_EXTRA_X      0
333 #define IMPL_MSGBOX_OFFSET_EXTRA_Y      2
334 #define IMPL_SEP_MSGBOX_IMAGE           8
335 
336 #define DLGWINDOW_PREV                  0
337 #define DLGWINDOW_NEXT                  1
338 #define DLGWINDOW_FIRST                 2
339 //#endif
340 
341 enum WindowSizeType {
342     WINDOWSIZE_MINIMUM,
343     WINDOWSIZE_PREFERRED,
344     WINDOWSIZE_MAXIMUM
345 };
346 
347 // ----------
348 // - Window -
349 // ----------
350 
351 #ifdef DBG_UTIL
352 const char* ImplDbgCheckWindow( const void* pObj );
353 #endif
354 
355 class   WindowImpl;
356 class VCL_DLLPUBLIC Window : public OutputDevice
357 {
358     friend class Cursor;
359     friend class OutputDevice;
360     friend class Application;
361     friend class SystemWindow;
362     friend class WorkWindow;
363     friend class Dialog;
364     friend class MessBox;
365     friend class DockingWindow;
366     friend class FloatingWindow;
367     friend class GroupBox;
368     friend class PushButton;
369     friend class RadioButton;
370     friend class SystemChildWindow;
371     friend class ImplBorderWindow;
372 
373     // TODO: improve missing functionality
374     // only required because of SetFloatingMode()
375     friend class ImplDockingWindowWrapper;
376     friend class ImplPopupFloatWin;
377     friend class MenuFloatingWindow;
378 
379 	friend class svt::PopupWindowControllerImpl;
380 
381 private:
382     // NOTE: to remove many dependencies of other modules
383     //       to this central file, all members are now hidden
384     //       in the WindowImpl class and all inline functions
385     //       were removed
386     //
387     //       Please do *not* add new members or inline functions to class Window,
388     //       but use class WindowImpl instead
389     //
390     WindowImpl* mpWindowImpl;
391 
392     SAL_DLLPRIVATE void ImplInitWindowData( WindowType nType );
393 
394 #ifdef DBG_UTIL
395     friend const char* ImplDbgCheckWindow( const void* pObj );
396 #endif
397     friend Window* ImplFindWindow( const SalFrame* pFrame, Point& rSalFramePos );
398 public:
399     SAL_DLLPRIVATE void                ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData );
400     SAL_DLLPRIVATE void                ImplInit( Window* pParent, WinBits nStyle, const ::com::sun::star::uno::Any& aSystemWorkWindowToken );
401     SAL_DLLPRIVATE WinBits             ImplInitRes( const ResId& rResId );
402     SAL_DLLPRIVATE void                ImplLoadRes( const ResId& rResId );
403     SAL_DLLPRIVATE void                ImplWindowRes( const ResId& rResId );
404     SAL_DLLPRIVATE void				   ImplSetFrameParent( const Window* pParent );
405     SAL_DLLPRIVATE void                ImplInsertWindow( Window* pParent );
406     SAL_DLLPRIVATE void                ImplRemoveWindow( sal_Bool bRemoveFrameData );
407     SAL_DLLPRIVATE Window*             ImplGetWindow();
408     SAL_DLLPRIVATE ImplFrameData*      ImplGetFrameData();
409     SAL_DLLPRIVATE SalFrame*           ImplGetFrame() const;
410     SAL_DLLPRIVATE ImplWinData*        ImplGetWinData() const;
411     SAL_DLLPRIVATE SalGraphics*        ImplGetFrameGraphics() const;
412     SAL_DLLPRIVATE void                ImplCallFocusChangeActivate( Window* pNewOverlapWindow, Window* pOldOverlapWindow );
413     SAL_DLLPRIVATE Window*             ImplFindWindow( const Point& rFramePos );
414     SAL_DLLPRIVATE sal_uInt16              ImplHitTest( const Point& rFramePos );
415     SAL_DLLPRIVATE Window*             ImplGetParent() const;
416     SAL_DLLPRIVATE Window*             ImplGetClientWindow() const;
417     SAL_DLLPRIVATE Window*             ImplGetBorderWindow() const;
418     SAL_DLLPRIVATE Window*             ImplGetFirstOverlapWindow();
419     SAL_DLLPRIVATE const Window*       ImplGetFirstOverlapWindow() const;
420     SAL_DLLPRIVATE Window*             ImplGetFrameWindow() const;
421     SAL_DLLPRIVATE sal_Bool                ImplIsRealParentPath( const Window* pWindow ) const;
422     SAL_DLLPRIVATE sal_Bool                ImplIsChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
423     SAL_DLLPRIVATE sal_Bool                ImplIsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
424     SAL_DLLPRIVATE Window*             ImplGetSameParent( const Window* pWindow ) const;
425     SAL_DLLPRIVATE sal_Bool                ImplIsDockingWindow() const;
426     SAL_DLLPRIVATE sal_Bool                ImplIsFloatingWindow() const;
427     SAL_DLLPRIVATE sal_Bool                ImplIsToolbox() const;
428     SAL_DLLPRIVATE sal_Bool                ImplIsSplitter() const;
429     SAL_DLLPRIVATE sal_Bool                ImplIsPushButton() const;
430     SAL_DLLPRIVATE sal_Bool                ImplIsOverlapWindow() const;
431     SAL_DLLPRIVATE void                ImplSetActive( sal_Bool bActive );
432     SAL_DLLPRIVATE sal_Bool                ImplIsMouseTransparent() const;
433     SAL_DLLPRIVATE void                ImplSetMouseTransparent( sal_Bool bTransparent );
434     SAL_DLLPRIVATE int                 ImplTestMousePointerSet();
435     SAL_DLLPRIVATE PointerStyle        ImplGetMousePointer() const;
436     SAL_DLLPRIVATE void                ImplResetReallyVisible();
437     SAL_DLLPRIVATE void                ImplSetReallyVisible();
438     SAL_DLLPRIVATE void                ImplCallInitShow();
439     SAL_DLLPRIVATE void                ImplAddDel( ImplDelData* pDel );
440     SAL_DLLPRIVATE void                ImplRemoveDel( ImplDelData* pDel );
441     SAL_DLLPRIVATE void                ImplInitResolutionSettings();
442     SAL_DLLPRIVATE void                ImplPointToLogic( Font& rFont ) const;
443     SAL_DLLPRIVATE void                ImplLogicToPoint( Font& rFont ) const;
444     SAL_DLLPRIVATE Point               ImplOutputToFrame( const Point& rPos );
445     SAL_DLLPRIVATE Point               ImplFrameToOutput( const Point& rPos );
446     SAL_DLLPRIVATE void                ImplOutputToFrame( Rectangle& rRect );
447     SAL_DLLPRIVATE void                ImplFrameToOutput( Rectangle& rRect );
448     SAL_DLLPRIVATE sal_Bool                ImplSysObjClip( const Region* pOldRegion );
449     SAL_DLLPRIVATE void                ImplUpdateSysObjChildsClip();
450     SAL_DLLPRIVATE void                ImplUpdateSysObjOverlapsClip();
451     SAL_DLLPRIVATE void                ImplUpdateSysObjClip();
452     SAL_DLLPRIVATE sal_Bool                ImplSetClipFlagChilds( sal_Bool bSysObjOnlySmaller = sal_False );
453     SAL_DLLPRIVATE sal_Bool                ImplSetClipFlagOverlapWindows( sal_Bool bSysObjOnlySmaller = sal_False );
454     SAL_DLLPRIVATE sal_Bool                ImplSetClipFlag( sal_Bool bSysObjOnlySmaller = sal_False );
455     SAL_DLLPRIVATE void                ImplIntersectWindowClipRegion( Region& rRegion );
456     SAL_DLLPRIVATE void                ImplIntersectWindowRegion( Region& rRegion );
457     SAL_DLLPRIVATE void                ImplExcludeWindowRegion( Region& rRegion );
458     SAL_DLLPRIVATE void                ImplExcludeOverlapWindows( Region& rRegion );
459     SAL_DLLPRIVATE void                ImplExcludeOverlapWindows2( Region& rRegion );
460     SAL_DLLPRIVATE void                ImplClipBoundaries( Region& rRegion, sal_Bool bThis, sal_Bool bOverlaps );
461     SAL_DLLPRIVATE sal_Bool                ImplClipChilds( Region& rRegion );
462     SAL_DLLPRIVATE void                ImplClipAllChilds( Region& rRegion );
463     SAL_DLLPRIVATE void                ImplClipSiblings( Region& rRegion );
464     SAL_DLLPRIVATE void                ImplInitWinClipRegion();
465     SAL_DLLPRIVATE void                ImplInitWinChildClipRegion();
466     SAL_DLLPRIVATE Region*             ImplGetWinChildClipRegion();
467     SAL_DLLPRIVATE void                ImplIntersectAndUnionOverlapWindows( const Region& rInterRegion, Region& rRegion );
468     SAL_DLLPRIVATE void                ImplIntersectAndUnionOverlapWindows2( const Region& rInterRegion, Region& rRegion );
469     SAL_DLLPRIVATE void                ImplCalcOverlapRegionOverlaps( const Region& rInterRegion, Region& rRegion );
470     SAL_DLLPRIVATE void                ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegion,
471                                                sal_Bool bChilds, sal_Bool bParent, sal_Bool bSiblings );
472     SAL_DLLPRIVATE void                ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags );
473     SAL_DLLPRIVATE void                ImplCallOverlapPaint();
474     SAL_DLLPRIVATE void                ImplPostPaint();
475     SAL_DLLPRIVATE void                ImplInvalidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags );
476     SAL_DLLPRIVATE void                ImplInvalidateOverlapFrameRegion( const Region& rRegion );
477     SAL_DLLPRIVATE void                ImplInvalidateParentFrameRegion( Region& rRegion );
478     SAL_DLLPRIVATE void                ImplInvalidate( const Region* rRegion, sal_uInt16 nFlags );
479     SAL_DLLPRIVATE void                ImplValidateFrameRegion( const Region* rRegion, sal_uInt16 nFlags );
480     SAL_DLLPRIVATE void                ImplValidate( const Region* rRegion, sal_uInt16 nFlags );
481     SAL_DLLPRIVATE void                ImplMoveInvalidateRegion( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_Bool bChilds );
482     SAL_DLLPRIVATE void                ImplMoveAllInvalidateRegions( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_Bool bChilds );
483     SAL_DLLPRIVATE void                ImplScroll( const Rectangle& rRect, long nHorzScroll, long nVertScroll, sal_uInt16 nFlags );
484     SAL_DLLPRIVATE void                ImplUpdateAll( sal_Bool bOverlapWindows = sal_True );
485     SAL_DLLPRIVATE void                ImplUpdateWindowPtr( Window* pWindow );
486     SAL_DLLPRIVATE void                ImplUpdateWindowPtr();
487     SAL_DLLPRIVATE void                ImplUpdateOverlapWindowPtr( sal_Bool bNewFrame );
488     SAL_DLLPRIVATE sal_Bool                ImplUpdatePos();
489     SAL_DLLPRIVATE void                ImplUpdateSysObjPos();
490     SAL_DLLPRIVATE WindowImpl*         ImplGetWindowImpl() const { return mpWindowImpl; }
491     SAL_DLLPRIVATE void                ImplFreeExtWindowImpl();
492     // creates ExtWindowImpl on demand, but may return NULL (e.g. if mbInDtor)
493     SAL_DLLPRIVATE vcl::ExtWindowImpl* ImplGetExtWindowImpl() const;
494     SAL_DLLPRIVATE void                ImplDeleteOwnedChildren();
495     /** check whether a font is suitable for UI
496 
497     The font to be tested will be checked whether it could display a
498     localized test string. If this is not the case, then the font
499     is deemed unsuitable as UI font.
500 
501     @param rFont
502     the font to be tested
503 
504     @returns
505     <TRUE/> if the font can be used as UI font
506     <FALSE/> if the font is unsuitable as UI font
507      */
508     SAL_DLLPRIVATE bool		   ImplCheckUIFont( const Font& rFont );
509     SAL_DLLPRIVATE void        ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl = sal_True );
510     SAL_DLLPRIVATE void        ImplAlignChilds();
511     SAL_DLLPRIVATE void        ImplPosSizeWindow( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags );
512     SAL_DLLPRIVATE void        ImplToBottomChild();
513     SAL_DLLPRIVATE void        ImplCalcToTop( ImplCalcToTopData* pPrevData );
514     SAL_DLLPRIVATE void        ImplCalcChildOverlapToTop( ImplCalcToTopData* pPrevData );
515     SAL_DLLPRIVATE void        ImplToTop( sal_uInt16 nFlags );
516     SAL_DLLPRIVATE void        ImplStartToTop( sal_uInt16 nFlags );
517     SAL_DLLPRIVATE void        ImplFocusToTop( sal_uInt16 nFlags, sal_Bool bReallyVisible );
518     SAL_DLLPRIVATE void        ImplShowAllOverlaps();
519     SAL_DLLPRIVATE void        ImplHideAllOverlaps();
520     SAL_DLLPRIVATE void        ImplNotifyKeyMouseCommandEventListeners( NotifyEvent& rNEvt );
521     SAL_DLLPRIVATE void        ImplCallMouseMove( sal_uInt16 nMouseCode, sal_Bool bModChanged = sal_False );
522     SAL_DLLPRIVATE void        ImplGenerateMouseMove();
523     SAL_DLLPRIVATE void        ImplGrabFocus( sal_uInt16 nFlags );
524     SAL_DLLPRIVATE void        ImplInvertFocus( const Rectangle& rRect );
525     SAL_DLLPRIVATE void        ImplControlFocus( sal_uInt16 nFlags = 0 );
526     SAL_DLLPRIVATE Window*     ImplGetDlgWindow( sal_uInt16 n, sal_uInt16 nType, sal_uInt16 nStart = 0, sal_uInt16 nEnd = 0xFFFF, sal_uInt16* pIndex = NULL );
527     SAL_DLLPRIVATE sal_Bool        ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput );
528     SAL_DLLPRIVATE sal_Bool        ImplHasDlgCtrl();
529     SAL_DLLPRIVATE void        ImplDlgCtrlNextWindow();
530     SAL_DLLPRIVATE void        ImplDlgCtrlFocusChanged( Window* pWindow, sal_Bool bGetFocus );
531     SAL_DLLPRIVATE Window*     ImplFindDlgCtrlWindow( Window* pWindow );
532     SAL_DLLPRIVATE long        ImplLogicUnitToPixelX( long nX, MapUnit eUnit );
533     SAL_DLLPRIVATE long        ImplLogicUnitToPixelY( long nY, MapUnit eUnit );
534     SAL_DLLPRIVATE sal_Bool        ImplIsWindowInFront( const Window* pTestWindow ) const;
535     SAL_DLLPRIVATE void        ImplSaveOverlapBackground();
536     SAL_DLLPRIVATE sal_Bool        ImplRestoreOverlapBackground( Region& rInvRegion );
537     SAL_DLLPRIVATE void        ImplDeleteOverlapBackground();
538     SAL_DLLPRIVATE void        ImplInvalidateAllOverlapBackgrounds();
539     SAL_DLLPRIVATE static void ImplNewInputContext();
540     SAL_DLLPRIVATE void        ImplCallActivateListeners(Window*);
541     SAL_DLLPRIVATE void        ImplCallDeactivateListeners(Window*);
542     DECL_DLLPRIVATE_LINK(      ImplHandlePaintHdl, void* );
543     DECL_DLLPRIVATE_LINK(      ImplGenerateMouseMoveHdl, void* );
544     DECL_DLLPRIVATE_LINK(      ImplTrackTimerHdl, Timer* );
545     DECL_DLLPRIVATE_LINK(      ImplAsyncFocusHdl, void* );
546     DECL_DLLPRIVATE_LINK(      ImplAsyncStateChangedHdl, void* );
547     DECL_DLLPRIVATE_LINK(      ImplHideOwnerDrawWindowsHdl, void* );
548     DECL_DLLPRIVATE_LINK(      ImplHandleResizeTimerHdl, void* );
549 
550     SAL_DLLPRIVATE static void ImplCalcSymbolRect( Rectangle& rRect );
551     SAL_DLLPRIVATE void        ImplHandleScroll( ScrollBar* pHScrl, long nX, ScrollBar* pVScrl, long nY );
552     SAL_DLLPRIVATE sal_Bool        ImplGetCurrentBackgroundColor( Color& rCol );
553     SAL_DLLPRIVATE sal_Bool        ImplIsAccessibleCandidate() const;
554     SAL_DLLPRIVATE sal_Bool        ImplIsAccessibleNativeFrame() const;
555     SAL_DLLPRIVATE sal_uInt16      ImplGetAccessibleCandidateChildWindowCount( sal_uInt16 nFirstWindowType ) const;
556     SAL_DLLPRIVATE Window*     ImplGetAccessibleCandidateChild( sal_uInt16 nChild, sal_uInt16& rChildCount, sal_uInt16 nFirstWindowType, sal_Bool bTopLevel = sal_True ) const;
557     SAL_DLLPRIVATE sal_Bool        ImplRegisterAccessibleNativeFrame();
558     SAL_DLLPRIVATE void        ImplRevokeAccessibleNativeFrame();
559     SAL_DLLPRIVATE void        ImplCallResize();
560     SAL_DLLPRIVATE void        ImplExtResize();
561     SAL_DLLPRIVATE void        ImplCallMove();
562     SAL_DLLPRIVATE Rectangle   ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle& rRect ) const;
563     SAL_DLLPRIVATE void        ImplMirrorFramePos( Point &pt ) const;
564     SAL_DLLPRIVATE long        ImplGetUnmirroredOutOffX();
565     SAL_DLLPRIVATE void        ImplIncModalCount();
566     SAL_DLLPRIVATE void        ImplDecModalCount();
567 
568     // retrieves the list of owner draw decorated windows for this window hiearchy
569     SAL_DLLPRIVATE ::std::vector<Window *>& ImplGetOwnerDrawList();
570     SAL_DLLPRIVATE Window*     ImplGetTopmostFrameWindow();
571 
572     SAL_DLLPRIVATE Rectangle   ImplGetWindowExtentsRelative( Window *pRelativeWindow, sal_Bool bClientOnly ) const;
573     SAL_DLLPRIVATE void        ImplNotifyIconifiedState( sal_Bool bIconified );
574     SAL_DLLPRIVATE bool		   ImplStopDnd();
575     SAL_DLLPRIVATE void		   ImplStartDnd();
576 
577     SAL_DLLPRIVATE static void ImplInitAppFontData( Window* pWindow );
578     SAL_DLLPRIVATE void		   ImplPaintToDevice( OutputDevice* pTargetOutDev, const Point& rPos );
579 
580     SAL_DLLPRIVATE sal_Bool        ImplIsInTaskPaneList();
581     SAL_DLLPRIVATE void        ImplIsInTaskPaneList( sal_Bool mbIsInTaskList );
582     SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvas >
583                                ImplGetCanvas( const Size& rFullscreenSize, bool bFullscreen, bool bSpriteCanvas ) const;
584 
585 private:
586 	// Default construction is forbidden and not implemented.
587 	SAL_DLLPRIVATE             Window();
588 
589 	// Copy assignment is forbidden and not implemented.
590 	SAL_DLLPRIVATE             Window (const Window &);
591 	SAL_DLLPRIVATE             Window & operator= (const Window &);
592 
593 protected:
594     // Single argument ctors shall be explicit.
595     explicit            Window( WindowType nType );
596 
597             void        SetCompoundControl( sal_Bool bCompound );
598 
599             void        ImplCallEventListeners( sal_uLong nEvent, void* pData = NULL );
600             void        CallEventListeners( sal_uLong nEvent, void* pData = NULL );
601             void        FireVclEvent( VclSimpleEvent* pEvent );
602 
603     // FIXME: this is a hack to workaround missing layout functionality
604     SAL_DLLPRIVATE void ImplAdjustNWFSizes();
605 public:
606     // Single argument ctors shall be explicit.
607     explicit            Window( Window* pParent, WinBits nStyle = 0 );
608 
609                         Window( Window* pParent, const ResId& rResId );
610     virtual             ~Window();
611 
612     virtual void        MouseMove( const MouseEvent& rMEvt );
613     virtual void        MouseButtonDown( const MouseEvent& rMEvt );
614     virtual void        MouseButtonUp( const MouseEvent& rMEvt );
615     virtual void        KeyInput( const KeyEvent& rKEvt );
616     virtual void        KeyUp( const KeyEvent& rKEvt );
617     virtual void        PrePaint();
618     virtual void        Paint( const Rectangle& rRect );
619 
620     virtual void        PostPaint();
621     virtual void        Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags );
622     virtual void        Move();
623     virtual void        Resize();
624     virtual void        Activate();
625     virtual void        Deactivate();
626     virtual void        GetFocus();
627     virtual void        LoseFocus();
628     virtual void        RequestHelp( const HelpEvent& rHEvt );
629     virtual void        Command( const CommandEvent& rCEvt );
630     virtual void        Tracking( const TrackingEvent& rTEvt );
631     virtual void        UserEvent( sal_uLong nEvent, void* pEventData );
632     virtual void        StateChanged( StateChangedType nStateChange );
633     virtual void        DataChanged( const DataChangedEvent& rDCEvt );
634     virtual long        PreNotify( NotifyEvent& rNEvt );
635     virtual long        Notify( NotifyEvent& rNEvt );
636     virtual Window*     GetPreferredKeyInputWindow();
637 
638     /*virtual*/ void    AddEventListener( const Link& rEventListener );
639     /*virtual*/ void    RemoveEventListener( const Link& rEventListener );
640     /*virtual*/ void    AddChildEventListener( const Link& rEventListener );
641     /*virtual*/ void    RemoveChildEventListener( const Link& rEventListener );
642 
643     sal_uLong               PostUserEvent( sal_uLong nEvent, void* pEventData = NULL );
644     sal_uLong               PostUserEvent( const Link& rLink, void* pCaller = NULL );
645     sal_Bool                PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData = NULL );
646     sal_Bool                PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL );
647     void                RemoveUserEvent( sal_uLong nUserEvent );
648     void                PostStateChanged( StateChangedType nState );
649 
650     void                IncrementLockCount();
651     void                DecrementLockCount();
652     sal_Bool                IsLocked( sal_Bool bChilds = sal_False ) const;
653 
654                         // returns the input language used for the last key stroke
655                         // may be LANGUAGE_DONTKNOW if not supported by the OS
656     LanguageType        GetInputLanguage() const;
657 
658     void                SetStyle( WinBits nStyle );
659     WinBits             GetStyle() const;
660     WinBits             GetPrevStyle() const;
661     void                SetExtendedStyle( WinBits nExtendedStyle );
662     WinBits             GetExtendedStyle() const;
663     WinBits             GetPrevExtendedStyle() const;
664     void                SetType( WindowType nType );
665     WindowType          GetType() const;
666     sal_Bool                IsSystemWindow() const;
667     sal_Bool                IsDialog() const;
668     sal_Bool                IsMenuFloatingWindow() const;
669     sal_Bool                IsToolbarFloatingWindow() const;
670     sal_Bool                IsTopWindow() const;
671     SystemWindow*       GetSystemWindow() const;
672 
673     void                EnableAllResize( sal_Bool bEnable = sal_True );
674     sal_Bool                IsAllResizeEnabled() const;
675 
676     void                SetBorderStyle( sal_uInt16 nBorderStyle );
677     sal_uInt16              GetBorderStyle() const;
678     void                GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
679                                    sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const;
680     Size                CalcWindowSize( const Size& rOutSz ) const;
681     Size                CalcOutputSize( const Size& rWinSz ) const;
682     long                CalcTitleWidth() const;
683 
684     void                EnableClipSiblings( sal_Bool bClipSiblings = sal_True );
685     sal_Bool                IsClipSiblingsEnabled() const;
686 
687     void                EnableChildTransparentMode( sal_Bool bEnable = sal_True );
688     sal_Bool                IsChildTransparentModeEnabled() const;
689 
690     void                SetMouseTransparent( sal_Bool bTransparent );
691     sal_Bool                IsMouseTransparent() const;
692     void                SetPaintTransparent( sal_Bool bTransparent );
693     sal_Bool                IsPaintTransparent() const;
694     void                SetDialogControlStart( sal_Bool bStart );
695     sal_Bool                IsDialogControlStart() const;
696     void                SetDialogControlFlags( sal_uInt16 nFlags );
697     sal_uInt16              GetDialogControlFlags() const;
698 
699     struct PointerState
700     {
701         sal_uLong   mnState;    // the button state
702         Point   maPos;      // mouse position in output coordinates
703     };
704     PointerState        GetPointerState();
705     sal_Bool                IsMouseOver();
706 
707     sal_uLong               GetCurrentModButtons();
708 
709     void                SetInputContext( const InputContext& rInputContext );
710     const InputContext& GetInputContext() const;
711     void                EndExtTextInput( sal_uInt16 nFlags );
712     sal_Bool                IsExtTextInput() const;
713     void                SetCursorRect( const Rectangle* pRect = NULL, long nExtTextInputWidth = 0 );
714     const Rectangle*    GetCursorRect() const;
715     long                GetCursorExtTextInputWidth() const;
716 
717     void                EnableChildNotify( sal_Bool bEnable );
718     sal_Bool                IsChildNotify() const;
719 
720     using               OutputDevice::SetSettings;
721     virtual void        SetSettings( const AllSettings& rSettings );
722     virtual void        SetSettings( const AllSettings& rSettings, sal_Bool bChild );
723     void                UpdateSettings( const AllSettings& rSettings, sal_Bool bChild = sal_False );
724     void                NotifyAllChilds( DataChangedEvent& rDCEvt );
725 
726     void                SetPointFont( const Font& rFont );
727     Font                GetPointFont() const;
728     void                SetZoomedPointFont( const Font& rFont );
729     long                GetDrawPixel( OutputDevice* pDev, long nPixels ) const;
730     Font                GetDrawPixelFont( OutputDevice* pDev ) const;
731     void                GetFontResolution( sal_Int32& nDPIX, sal_Int32& nDPIY ) const;
732 
733     void                SetControlFont();
734     void                SetControlFont( const Font& rFont );
735     Font                GetControlFont() const;
736     sal_Bool                IsControlFont() const;
737     void                SetControlForeground();
738     void                SetControlForeground( const Color& rColor );
739     Color               GetControlForeground() const;
740     sal_Bool                IsControlForeground() const;
741     void                SetControlBackground();
742     void                SetControlBackground( const Color& rColor );
743     Color               GetControlBackground() const;
744     sal_Bool                IsControlBackground() const;
745 
746     void                SetParentClipMode( sal_uInt16 nMode = 0 );
747     sal_uInt16              GetParentClipMode() const;
748 
749     void                SetWindowRegionPixel();
750     void                SetWindowRegionPixel( const Region& rRegion );
751     const Region&       GetWindowRegionPixel() const;
752     sal_Bool                IsWindowRegionPixel() const;
753     Region              GetWindowClipRegionPixel( sal_uInt16 nFlags = 0 ) const;
754     Region              GetPaintRegion() const;
755     sal_Bool                IsInPaint() const;
756     // while IsInPaint returns true ExpandPaintClipRegion adds the
757     // submitted region to the paint clip region so you can
758     // paint additional parts of your window if necessary
759     void				ExpandPaintClipRegion( const Region& rRegion );
760 
761     void                SetParent( Window* pNewParent );
762     Window*             GetParent() const;
763 
764     void                Show( sal_Bool bVisible = sal_True, sal_uInt16 nFlags = 0 );
765     void                Hide( sal_uInt16 nFlags = 0 ) { Show( sal_False, nFlags ); }
766     sal_Bool                IsVisible() const;
767     sal_Bool                IsReallyVisible() const;
768     // Do not use this function, use IsReallyVisible()
769     sal_Bool                IsParentPathVisible() const;
770     sal_Bool                IsReallyShown() const;
771     sal_Bool                IsInInitShow() const;
772 
773     void                Enable( bool bEnable = true, bool bChild = true );
774     void                Disable( bool bChild = true ) { Enable( false, bChild ); }
775     sal_Bool                IsEnabled() const;
776 
777     void                EnableInput( sal_Bool bEnable = sal_True, sal_Bool bChild = sal_True );
778     void                EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin,
779                                      const Window* pExcludeWindow = NULL );
780     sal_Bool                IsInputEnabled() const;
781 
782     /** Override <code>EnableInput</code>. This can be necessary due to other people
783         using EnableInput for whole window hierarchies.
784 
785 
786         <code>AlwaysEnableInput</code> and <code>AlwaysDisableInput</code> are
787         mutually exclusive; the last setter wins.
788         @param bAlways
789         sets always enabled flag
790 
791         @param bChild
792         if true children are recursively set to AlwaysEnableInput
793     */
794     void                AlwaysEnableInput( sal_Bool bAlways, sal_Bool bChild = sal_True );
795     /** returns the current AlwaysEnableInput state
796     @return
797     true if window is in AlwaysEnableInput state
798     */
799     sal_Bool                IsAlwaysEnableInput() const;
800     /** Override <code>EnableInput</code>, counterpart to AlwaysEnableInput.
801         Windows with AlwaysDisableInput will not get key events even if enabled
802         and input enabled.This can be necessary due to other people using EnableInput
803         for whole window hierarchies.
804 
805         <code>AlwaysEnableInput</code> and <code>AlwaysDisableInput</code> are
806         mutually exclusive; the last setter wins.
807 
808         @param bAlways
809         sets always disable flag
810 
811         @param bChild
812         if true children are recursively set to AlwaysDisableInput
813     */
814     void                AlwaysDisableInput( sal_Bool bAlways, sal_Bool bChild = sal_True );
815     /** returns the current AlwaysDisableInput state
816     @return
817     true if window is in AlwaysEnableInput state
818     */
819     sal_Bool                IsAlwaysDisableInput() const;
820     /** usually event handlers (see AddEventListener and AddChildEventListener)
821     are not called on disabled, modal or input disabled windows. There are however rare cases
822     in which one wants a Window or rather one of its Control subclasses to
823     not evaluate events but still react to those events externally. In these
824     rare cases call SetCallHandlersOnInputDisabled( true ) to have your handler
825     called anyway.
826 
827     Currently only mouse events get this special treatment.
828 
829     Use this sparingly, chances are if you want to use it you're wroking around
830     the real problem.
831 
832     @param bCall
833     Enable/Disable calling event handlers for this disabled, modal or input disabled window.
834     This call is implicity done recursively for possible child windows.
835     */
836     void                SetCallHandlersOnInputDisabled( bool bCall );
837     /** get state of SetCallHandlersOnInputDisabled
838 
839     @returns whether handlers are called regardless of input enabled state
840     */
841     bool                IsCallHandlersOnInputDisabled() const;
842     /** A window is in modal mode if one of its children or subchildren
843         is a running modal window (a modal dialog)
844 
845         @returns sal_True if a child or subchild is a running modal window
846     */
847     sal_Bool                IsInModalMode() const;
848 
849     void                SetActivateMode( sal_uInt16 nMode );
850     sal_uInt16              GetActivateMode() const;
851 
852     void                ToTop( sal_uInt16 nFlags = 0 );
853     void                SetZOrder( Window* pRefWindow, sal_uInt16 nFlags );
854     void                EnableAlwaysOnTop( sal_Bool bEnable = sal_True );
855     sal_Bool                IsAlwaysOnTopEnabled() const;
856 
857     virtual void        SetPosSizePixel( long nX, long nY,
858                                          long nWidth, long nHeight,
859                                          sal_uInt16 nFlags = WINDOW_POSSIZE_ALL );
860     virtual void        SetPosPixel( const Point& rNewPos );
861     virtual Point       GetPosPixel() const;
862     virtual void        SetSizePixel( const Size& rNewSize );
863     virtual Size        GetSizePixel() const;
864     virtual void        SetPosSizePixel( const Point& rNewPos,
865                                          const Size& rNewSize );
866     virtual void        SetOutputSizePixel( const Size& rNewSize );
867     sal_Bool                IsDefaultPos() const;
868     sal_Bool                IsDefaultSize() const;
869 
870     // those conversion routines might deliver different results during UI mirroring
871     Point               OutputToScreenPixel( const Point& rPos ) const;
872     Point               ScreenToOutputPixel( const Point& rPos ) const;
873     //  the normalized screen methods work independent from UI mirroring
874     Point               OutputToNormalizedScreenPixel( const Point& rPos ) const;
875     Point               NormalizedScreenToOutputPixel( const Point& rPos ) const;
876     Point               OutputToAbsoluteScreenPixel( const Point& rPos ) const;
877     Point               AbsoluteScreenToOutputPixel( const Point& rPos ) const;
878     Rectangle           GetDesktopRectPixel() const;
879     //  window extents including border and decoratrion
880     Rectangle           GetWindowExtentsRelative( Window *pRelativeWindow ) const;
881     // window extents of the client window, coordinates to be used in SetPosPixel
882     Rectangle           GetClientWindowExtentsRelative( Window *pRelativeWindow ) const;
883 
884     virtual sal_Bool        IsScrollable() const;
885     virtual void        Scroll( long nHorzScroll, long nVertScroll,
886                                 sal_uInt16 nFlags = 0 );
887     virtual void        Scroll( long nHorzScroll, long nVertScroll,
888                                 const Rectangle& rRect, sal_uInt16 nFlags = 0 );
889     virtual void        Invalidate( sal_uInt16 nFlags = 0 );
890     virtual void        Invalidate( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
891     virtual void        Invalidate( const Region& rRegion, sal_uInt16 nFlags = 0 );
892     void                Validate( sal_uInt16 nFlags = 0 );
893     void                Validate( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
894     void                Validate( const Region& rRegion, sal_uInt16 nFlags = 0 );
895     sal_Bool                HasPaintEvent() const;
896     void                Update();
897     void                Flush();
898     void                Sync();
899 
900     // toggles new docking support, enabled via toolkit
901     void                EnableDocking( sal_Bool bEnable = sal_True );
902     // retrieves the single dockingmanager instance
903     static DockingManager* GetDockingManager();
904 
905     void                EnablePaint( sal_Bool bEnable );
906     sal_Bool                IsPaintEnabled() const;
907     void                SetUpdateMode( sal_Bool bUpdate );
908     sal_Bool                IsUpdateMode() const;
909     void                SetParentUpdateMode( sal_Bool bUpdate );
910     sal_Bool                IsParentUpdateMode() const;
911 
912     void                GrabFocus();
913     sal_Bool                HasFocus() const;
914     sal_Bool                HasChildPathFocus( sal_Bool bSystemWindow = sal_False ) const;
915     sal_Bool                IsActive() const;
916     sal_Bool                HasActiveChildFrame();
917     sal_uInt16              GetGetFocusFlags() const;
918 	void				GrabFocusToDocument();
919 
920     /**
921      * Set this when you need to act as if the window has focus even if it
922      * doesn't.  This is necessary for implementing tab stops inside floating
923      * windows, but floating windows don't get focus from the system.
924      */
925     void                SetFakeFocus( bool bFocus );
926 
927     sal_Bool                IsCompoundControl() const;
928     sal_Bool                HasCompoundControlFocus() const;
929 
930     static sal_uIntPtr  SaveFocus();
931     static sal_Bool         EndSaveFocus( sal_uIntPtr nSaveId, sal_Bool bRestore = sal_True );
932 
933     void                CaptureMouse();
934     void                ReleaseMouse();
935     sal_Bool                IsMouseCaptured() const;
936 
937     void                SetPointer( const Pointer& rPointer );
938     const Pointer&      GetPointer() const;
939     void                EnableChildPointerOverwrite( sal_Bool bOverwrite = sal_True );
940     sal_Bool                IsChildPointerOverwrite() const;
941     void                SetPointerPosPixel( const Point& rPos );
942     Point               GetPointerPosPixel();
943     Point               GetLastPointerPosPixel();
944     void                ShowPointer( sal_Bool bVisible );
945     sal_Bool                IsPointerVisible() const;
946     void                EnterWait();
947     void                LeaveWait();
948     sal_Bool                IsWait() const;
949 
950     void                SetCursor( Cursor* pCursor );
951     Cursor*             GetCursor() const;
952 
953     void                SetZoom( const Fraction& rZoom );
954     const Fraction&     GetZoom() const;
955     sal_Bool                IsZoom() const;
956     long                CalcZoom( long n ) const;
957 
958     virtual void      SetText( const XubString& rStr );
959     virtual String   	GetText() const;
960     // return the actual text displayed
961     // this may have e.g. accellerators removed or portions
962     // replaced by ellipsis
963     virtual String		GetDisplayText() const;
964     // gets the visible background color. for transparent windows
965     // this may be the parent's background color; for controls
966     // this may be a child's background color (e.g. ListBox)
967     virtual const Wallpaper& GetDisplayBackground() const;
968 
969     void                SetHelpText( const XubString& rHelpText );
970     const XubString&    GetHelpText() const;
971 
972     void                SetQuickHelpText( const XubString& rHelpText );
973     const XubString&    GetQuickHelpText() const;
974 
975     void                SetHelpId( const rtl::OString& );
976     const rtl::OString& GetHelpId() const;
977 
978     void                SetUniqueId( const rtl::OString& );
979     const rtl::OString& GetUniqueId() const;
980     const rtl::OString& GetUniqueOrHelpId() const;
981 
982     Window*             FindWindow( const Point& rPos ) const;
983 
984     sal_uInt16              GetChildCount() const;
985     Window*             GetChild( sal_uInt16 nChild ) const;
986     Window*             GetWindow( sal_uInt16 nType ) const;
987     sal_Bool                IsChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False ) const;
988     sal_Bool                IsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow = sal_False  ) const;
989 
990     void                SetData( void* pNewData );
991     void*               GetData() const;
992 
993     // Should be merged in the next top level build !!!
994     Bitmap              SnapShot( sal_Bool bBorder ) const;
995     Bitmap              SnapShot() const;
996 
997     void                ShowFocus( const Rectangle& rRect );
998     void                HideFocus();
999 
1000     void                Invert( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
1001     void                Invert( const Polygon& rPoly, sal_uInt16 nFlags = 0 );
1002 
1003     // transparent background for selected or checked items in toolboxes etc.
1004     void                DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly );
1005     // the same, but fills a passed Color with a text color complementing the selection background
1006     void                DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, Color* pSelectionTextColor );
1007     // support rounded edges in the selection rect
1008     void                DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, long nCornerRadius, Color* pSelectionTextColor, Color* pPaintColor );
1009 
1010     void                ShowTracking( const Rectangle& rRect,
1011                                       sal_uInt16 nFlags = SHOWTRACK_SMALL );
1012     void                HideTracking();
1013     void                InvertTracking( const Rectangle& rRect,
1014                                         sal_uInt16 nFlags = SHOWTRACK_SMALL );
1015     void                InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags = 0 );
1016 
1017     void                StartTracking( sal_uInt16 nFlags = 0 );
1018     void                EndTracking( sal_uInt16 nFlags = 0 );
1019     sal_Bool                IsTracking() const;
1020 
1021     void                StartAutoScroll( sal_uInt16 nFlags );
1022     void                EndAutoScroll();
1023     sal_Bool                IsAutoScroll() const;
1024 
1025     sal_Bool                HandleScrollCommand( const CommandEvent& rCmd,
1026                                              ScrollBar* pHScrl = NULL,
1027                                              ScrollBar* pVScrl = NULL );
1028 
1029     void                SaveBackground( const Point& rPos, const Size& rSize,
1030                                         const Point& rDestOff, VirtualDevice& rSaveDevice );
1031 
1032     const SystemEnvData*                      GetSystemData() const;
1033     ::com::sun::star::uno::Any                GetSystemDataAny() const;
1034 
1035     // API zum Setzen/Abfragen des Komponenteninterfaces
1036     virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > GetComponentInterface( sal_Bool bCreate = sal_True );
1037     virtual void                    SetComponentInterface( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xIFace );
1038 
1039 	// Accessibility
1040     ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible( sal_Bool bCreate = sal_True );
1041     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
1042 	void SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > );
1043 
1044     Window* GetAccessibleParentWindow() const;
1045     sal_uInt16  GetAccessibleChildWindowCount();
1046     Window* GetAccessibleChildWindow( sal_uInt16 n );
1047 
1048     void    SetAccessibleRole( sal_uInt16 nRole );
1049     sal_uInt16  GetAccessibleRole() const;
1050 
1051     void    SetAccessibleName( const String& rName );
1052     String  GetAccessibleName() const;
1053 
1054     void    SetAccessibleDescription( const String& rDescr );
1055     String  GetAccessibleDescription() const;
1056 
1057     void    SetAccessibleRelationLabeledBy( Window* pLabeledBy );
1058     Window* GetAccessibleRelationLabeledBy() const;
1059 
1060     void    SetAccessibleRelationLabelFor( Window* pLabelFor );
1061     Window* GetAccessibleRelationLabelFor() const;
1062 
1063     void    SetAccessibleRelationMemberOf( Window* pMemberOf );
1064     Window* GetAccessibleRelationMemberOf() const;
1065 
1066 
1067     // to avoid sending accessibility events in cases like closing dialogs
1068     // by default checks complete parent path
1069     sal_Bool    IsAccessibilityEventsSuppressed( sal_Bool bTraverseParentPath = sal_True );
1070     void    SetAccessibilityEventsSuppressed(sal_Bool bSuppressed);
1071 
1072     /// request XCanvas render interface for this window
1073     ::com::sun::star::uno::Reference<
1074 		::com::sun::star::rendering::XCanvas > GetCanvas() const;
1075     /// request XSpriteCanvas render interface for this window
1076     ::com::sun::star::uno::Reference<
1077 		::com::sun::star::rendering::XSpriteCanvas > GetSpriteCanvas() const;
1078     /// request fullscreen XSpriteCanvas render interface for this window
1079     ::com::sun::star::uno::Reference<
1080 		::com::sun::star::rendering::XSpriteCanvas > GetFullscreenSpriteCanvas( const Size& rFullscreenSize ) const;
1081 
1082     /*  records all DrawText operations within the passed rectangle;
1083      *  a synchronous paint is sent to achieve this
1084      */
1085     void				RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& rRect );
1086 
1087     // Setzen und Abfragen fuer das Toolkit
1088     VCLXWindow*             GetWindowPeer() const;
1089     void                    SetWindowPeer( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer, VCLXWindow* pVCLXWindow );
1090 
1091     // Merken, ob vom Toolkit erzeugt
1092     sal_Bool                    IsCreatedWithToolkit() const;
1093     void                    SetCreatedWithToolkit( sal_Bool b );
1094 
1095 			// Deprecated - can use SetAccessibleRelationLabelFor/By nowadys
1096     virtual Window*	GetParentLabelFor( const Window* pLabel ) const;
1097     virtual Window*	GetParentLabeledBy( const Window* pLabeled ) const;
1098     KeyEvent			GetActivationKey() const;
1099 
1100     // Drag and Drop interfaces
1101     virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > GetDropTarget();
1102     virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > GetDragSource();
1103     virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer > GetDragGestureRecognizer();
1104     // only for RVP transmission
1105     void GetDragSourceDropTarget(::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& xDragSource,::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > &xDropTarget );
1106 
1107     // Clipboard/Selection interfaces
1108     virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetClipboard();
1109     virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > GetPrimarySelection();
1110 
1111     // Advisory Sizing - what is a good size for this widget ?
1112     virtual Size GetOptimalSize(WindowSizeType eType) const;
1113 
1114     //-------------------------------------
1115     //  Native Widget Rendering functions
1116     //-------------------------------------
1117 
1118     // form controls must never use native widgets, this can be toggled here
1119     void    EnableNativeWidget( sal_Bool bEnable = sal_True );
1120     sal_Bool    IsNativeWidgetEnabled() const;
1121 
1122     // a helper method for a Control's Draw method
1123     void PaintToDevice( OutputDevice* pDevice, const Point& rPos, const Size& rSize );
1124 
1125     /* mark Window for deletion in top of event queue
1126     */
1127     void doLazyDelete();
1128 
1129     // let the window intercept the KeyDown messages of the system children
1130     void InterceptChildWindowKeyDown( sal_Bool bIntercept );
1131 
1132     virtual XubString GetSurroundingText() const;
1133     virtual Selection GetSurroundingTextSelection() const;
1134 
1135     // ExtImpl
1136 
1137     // layouting
1138     boost::shared_ptr< vcl::WindowArranger > getLayout();
1139 
1140     /* add a child Window
1141        addWindow will do the following things
1142        - insert the passed window into the child list (equivalent to i_pWin->SetParent( this ))
1143        - mark the window as "owned", meaning that the added Window will be destroyed by
1144          the parent's desctructor.
1145          This means: do not pass in member windows or stack objects here. Do not cause
1146          the destructor of the added window to be called in any way.
1147 
1148          to avoid ownership pass i_bTakeOwnership as "false"
1149     */
1150     void addWindow( Window* i_pWin, bool i_bTakeOwnership = true );
1151 
1152     /* remove a child Window
1153        the remove window functions will
1154        - reparent the searched window (equivalent to i_pWin->SetParent( i_pNewParent ))
1155        - return a pointer to the removed window or NULL if i_pWin was not found
1156        caution: ownership passes to the new parent or the caller, if the new parent was NULL
1157     */
1158     Window* removeWindow( Window* i_pWin, Window* i_pNewParent = NULL );
1159 
1160     /* return the identifier of this window
1161     */
1162     const rtl::OUString& getIdentifier() const;
1163     /* set an identifier
1164        identifiers have only loosely defined rules per se
1165        in context of Window they must be unique over the window
1166        hierarchy you'd like to find them again using the findWindow method
1167     */
1168     void setIdentifier( const rtl::OUString& );
1169 
1170     /* returns the first found descendant that matches
1171        the passed identifier or NULL
1172     */
1173     Window* findWindow( const rtl::OUString& ) const;
1174 
1175     /* get/set properties
1176        this will contain window properties (like visible, enabled)
1177        as well as properties of derived classes (e.g. text of Edit fields)
1178     */
1179     virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getProperties() const;
1180     /*
1181     */
1182     virtual void setProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
1183 
1184 };
1185 
1186 
1187 #endif // _SV_WINDOW_HXX
1188