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