1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: window.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SV_WINDOW_HXX
32 #define _SV_WINDOW_HXX
35 #include <vcl/dllapi.h>
36 #include <vcl/outdev.hxx>
37 #include <tools/resid.hxx>
38 #ifndef _SV_POINTR_HXX
39 #include <vcl/pointr.hxx>
41 #include <vcl/wintypes.hxx>
42 #ifndef _SV_APPTYPES_HXX
43 #include <vcl/apptypes.hxx>
45 #include <vcl/inputctx.hxx>
46 #include <vcl/vclevent.hxx>
47 // Only for compatibility - because many people outside haven't included event.hxx
48 #ifndef _VCL_EVENT_HXX
49 #include <vcl/event.hxx>
51 #include <vcl/region.hxx>
52 #include <vcl/salnativewidgets.hxx>
53 #include <rtl/ustring.hxx>
54 #include <cppuhelper/weakref.hxx>
55 #include <com/sun/star/uno/Reference.hxx>
56 #include <vcl/smartid.hxx>
61 struct ImplOverlapData
;
63 struct ImplCalcToTopData
;
65 struct SystemParentData
;
66 class ImplBorderWindow
;
79 class DataChangedEvent
;
84 class MenuFloatingWindow
;
86 // Nur fuer ExecuteDrag:
89 struct ImplAccessibleInfos
;
94 namespace accessibility
{
101 namespace rendering
{
117 namespace datatransfer
{
118 namespace clipboard
{
123 class XDragGestureRecognizer
;
128 namespace vcl
{ struct ControlLayoutData
; }
134 // Type fuer GetWindow()
135 #define WINDOW_PARENT ((USHORT)0)
136 #define WINDOW_FIRSTCHILD ((USHORT)1)
137 #define WINDOW_LASTCHILD ((USHORT)2)
138 #define WINDOW_PREV ((USHORT)3)
139 #define WINDOW_NEXT ((USHORT)4)
140 #define WINDOW_FIRSTOVERLAP ((USHORT)5)
141 #define WINDOW_LASTOVERLAP ((USHORT)6)
142 #define WINDOW_OVERLAP ((USHORT)7)
143 #define WINDOW_PARENTOVERLAP ((USHORT)8)
144 #define WINDOW_CLIENT ((USHORT)9)
145 #define WINDOW_REALPARENT ((USHORT)10)
146 #define WINDOW_FRAME ((USHORT)11)
147 #define WINDOW_BORDER ((USHORT)12)
148 #define WINDOW_FIRSTTOPWINDOWCHILD ((USHORT)13)
149 #define WINDOW_LASTTOPWINDOWCHILD ((USHORT)14)
150 #define WINDOW_PREVTOPWINDOWSIBLING ((USHORT)15)
151 #define WINDOW_NEXTTOPWINDOWSIBLING ((USHORT)16)
153 // Flags for SetPosSizePixel()
154 #define WINDOW_POSSIZE_X ((USHORT)0x0001)
155 #define WINDOW_POSSIZE_Y ((USHORT)0x0002)
156 #define WINDOW_POSSIZE_WIDTH ((USHORT)0x0004)
157 #define WINDOW_POSSIZE_HEIGHT ((USHORT)0x0008)
158 #define WINDOW_POSSIZE_POS (WINDOW_POSSIZE_X | WINDOW_POSSIZE_Y)
159 #define WINDOW_POSSIZE_SIZE (WINDOW_POSSIZE_WIDTH | WINDOW_POSSIZE_HEIGHT)
160 #define WINDOW_POSSIZE_POSSIZE (WINDOW_POSSIZE_POS | WINDOW_POSSIZE_SIZE)
161 #define WINDOW_POSSIZE_ALL (WINDOW_POSSIZE_POSSIZE)
162 #define WINDOW_POSSIZE_DROPDOWN ((USHORT)0x0010)
165 #define SHOW_NOPARENTUPDATE ((USHORT)0x0001)
166 #define SHOW_NOFOCUSCHANGE ((USHORT)0x0002)
167 #define SHOW_NOACTIVATE ((USHORT)0x0004)
169 // Flags for SetZOrder()
170 #define WINDOW_ZORDER_BEFOR ((USHORT)0x0001)
171 #define WINDOW_ZORDER_BEHIND ((USHORT)0x0002)
172 #define WINDOW_ZORDER_FIRST ((USHORT)0x0004)
173 #define WINDOW_ZORDER_LAST ((USHORT)0x0008)
176 #define ACTIVATE_MODE_GRABFOCUS ((USHORT)0x0001)
179 #define TOTOP_RESTOREWHENMIN ((USHORT)0x0001)
180 #define TOTOP_FOREGROUNDTASK ((USHORT)0x0002)
181 #define TOTOP_NOGRABFOCUS ((USHORT)0x0004)
182 //#if 0 // _SOLAR__PRIVATE // vcl internal only
183 #define TOTOP_GRABFOCUSONLY ((USHORT)0x0008)
186 // Flags for Invalidate
187 #define INVALIDATE_CHILDREN ((USHORT)0x0001)
188 #define INVALIDATE_NOCHILDREN ((USHORT)0x0002)
189 #define INVALIDATE_NOERASE ((USHORT)0x0004)
190 #define INVALIDATE_UPDATE ((USHORT)0x0008)
191 #define INVALIDATE_TRANSPARENT ((USHORT)0x0010)
192 #define INVALIDATE_NOTRANSPARENT ((USHORT)0x0020)
193 #define INVALIDATE_NOCLIPCHILDREN ((USHORT)0x4000)
194 // Temporaer fuer Kompatibilitaet
195 #define INVALIDATE_BACKGROUND INVALIDATE_TRANSPARENT
197 // Flags for Validate
198 #define VALIDATE_CHILDREN ((USHORT)0x0001)
199 #define VALIDATE_NOCHILDREN ((USHORT)0x0002)
202 #define SCROLL_CLIP ((USHORT)0x0001)
203 #define SCROLL_CHILDREN ((USHORT)0x0002)
204 #define SCROLL_NOCHILDREN ((USHORT)0x0004)
205 #define SCROLL_NOERASE ((USHORT)0x0008)
206 #define SCROLL_NOINVALIDATE ((USHORT)0x0010)
207 #define SCROLL_NOWINDOWINVALIDATE ((USHORT)0x0020)
208 #define SCROLL_USECLIPREGION ((USHORT)0x0040)
209 #define SCROLL_UPDATE ((USHORT)0x0080)
211 // Flags for ParentClipMode
212 #define PARENTCLIPMODE_CLIP ((USHORT)0x0001)
213 #define PARENTCLIPMODE_NOCLIP ((USHORT)0x0002)
215 // Flags for Invert()
216 #define INVERT_HIGHLIGHT ((USHORT)0x0001)
217 #define INVERT_50 ((USHORT)0x0002)
219 // Flags for ShowTracking()
220 #define SHOWTRACK_SMALL ((USHORT)0x0001)
221 #define SHOWTRACK_BIG ((USHORT)0x0002)
222 #define SHOWTRACK_SPLIT ((USHORT)0x0003)
223 #define SHOWTRACK_OBJECT ((USHORT)0x0004)
224 #define SHOWTRACK_WINDOW ((USHORT)0x1000)
225 #define SHOWTRACK_CLIP ((USHORT)0x2000)
226 #define SHOWTRACK_STYLE ((USHORT)0x000F)
228 // Flags for StartTracking()
229 #define STARTTRACK_KEYINPUT ((USHORT)0x0001)
230 #define STARTTRACK_KEYMOD ((USHORT)0x0002)
231 #define STARTTRACK_NOKEYCANCEL ((USHORT)0x0004)
232 #define STARTTRACK_SCROLLREPEAT ((USHORT)0x0008)
233 #define STARTTRACK_BUTTONREPEAT ((USHORT)0x0010)
234 #define STARTTRACK_MOUSEBUTTONDOWN ((USHORT)0x0020)
235 #define STARTTRACK_FOCUSCANCEL ((USHORT)0x0040)
237 // Flags for StartAutoScroll()
238 #define AUTOSCROLL_VERT ((USHORT)0x0001)
239 #define AUTOSCROLL_HORZ ((USHORT)0x0002)
241 // Flags for StateChanged()
242 typedef USHORT StateChangedType
;
243 #define STATE_CHANGE_INITSHOW ((StateChangedType)1)
244 #define STATE_CHANGE_VISIBLE ((StateChangedType)2)
245 #define STATE_CHANGE_UPDATEMODE ((StateChangedType)3)
246 #define STATE_CHANGE_ENABLE ((StateChangedType)4)
247 #define STATE_CHANGE_TEXT ((StateChangedType)5)
248 #define STATE_CHANGE_IMAGE ((StateChangedType)6)
249 #define STATE_CHANGE_DATA ((StateChangedType)7)
250 #define STATE_CHANGE_STATE ((StateChangedType)8)
251 #define STATE_CHANGE_STYLE ((StateChangedType)9)
252 #define STATE_CHANGE_ZOOM ((StateChangedType)10)
253 #define STATE_CHANGE_BORDER ((StateChangedType)11)
254 #define STATE_CHANGE_TRANSPARENT ((StateChangedType)12)
255 #define STATE_CHANGE_CONTROLFONT ((StateChangedType)13)
256 #define STATE_CHANGE_CONTROLFOREGROUND ((StateChangedType)14)
257 #define STATE_CHANGE_CONTROLBACKGROUND ((StateChangedType)15)
258 #define STATE_CHANGE_READONLY ((StateChangedType)16)
259 #define STATE_CHANGE_FORMAT ((StateChangedType)17)
260 #define STATE_CHANGE_EXTENDEDSTYLE ((StateChangedType)18)
261 #define STATE_CHANGE_MIRRORING ((StateChangedType)19)
262 #define STATE_CHANGE_USER ((StateChangedType)10000)
265 #define GETFOCUS_TAB ((USHORT)0x0001)
266 #define GETFOCUS_CURSOR ((USHORT)0x0002)
267 #define GETFOCUS_MNEMONIC ((USHORT)0x0004)
268 #define GETFOCUS_FORWARD ((USHORT)0x0010)
269 #define GETFOCUS_BACKWARD ((USHORT)0x0020)
270 #define GETFOCUS_AROUND ((USHORT)0x0040)
271 #define GETFOCUS_UNIQUEMNEMONIC ((USHORT)0x0100)
272 #define GETFOCUS_INIT ((USHORT)0x0200)
273 #define GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL ((USHORT)0x0400)
275 // Draw-Flags fuer Draw()
276 #define WINDOW_DRAW_MONO ((ULONG)0x00000001)
277 #define WINDOW_DRAW_NOBORDER ((ULONG)0x00000002)
278 #define WINDOW_DRAW_NOCONTROLS ((ULONG)0x00000004)
279 #define WINDOW_DRAW_NODISABLE ((ULONG)0x00000008)
280 #define WINDOW_DRAW_NOMNEMONIC ((ULONG)0x00000010)
281 #define WINDOW_DRAW_NOSELECTION ((ULONG)0x00000020)
282 #define WINDOW_DRAW_NOFOCUS ((ULONG)0x00000040)
283 #define WINDOW_DRAW_NOBACKGROUND ((ULONG)0x00000080)
284 #define WINDOW_DRAW_ROLLOVER ((ULONG)0x00000100)
286 // Border-Styles fuer SetBorder()
287 #define WINDOW_BORDER_NORMAL ((USHORT)0x0001)
288 #define WINDOW_BORDER_MONO ((USHORT)0x0002)
289 #define WINDOW_BORDER_ACTIVE ((USHORT)0x0004)
290 #define WINDOW_BORDER_DOUBLEOUT ((USHORT)0x0008)
291 #define WINDOW_BORDER_MENU ((USHORT)0x0010)
292 #define WINDOW_BORDER_NOBORDER ((USHORT)0x1000)
293 #define WINDOW_BORDER_REMOVEBORDER ((USHORT)0x2000)
295 // DialogControl-Flags
296 #define WINDOW_DLGCTRL_RETURN ((USHORT)0x0001)
297 #define WINDOW_DLGCTRL_WANTFOCUS ((USHORT)0x0002)
298 #define WINDOW_DLGCTRL_MOD1TAB ((USHORT)0x0004)
299 #define WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ((USHORT)0x0008)
301 // GetWindowClipRegionPixel-Flags
302 #define WINDOW_GETCLIPREGION_NULL ((USHORT)0x0001)
303 #define WINDOW_GETCLIPREGION_NOCHILDREN ((USHORT)0x0002)
305 // EndExtTextInput-Flags
306 #define EXTTEXTINPUT_END_COMPLETE ((USHORT)0x0001)
307 #define EXTTEXTINPUT_END_CANCEL ((USHORT)0x0002)
309 //#if 0 // _SOLAR__PRIVATE
310 #define IMPL_MINSIZE_BUTTON_WIDTH 70
311 #define IMPL_MINSIZE_BUTTON_HEIGHT 22
312 #define IMPL_EXTRA_BUTTON_WIDTH 18
313 #define IMPL_EXTRA_BUTTON_HEIGHT 10
314 #define IMPL_SEP_BUTTON_X 5
315 #define IMPL_SEP_BUTTON_Y 5
316 #define IMPL_MINSIZE_MSGBOX_WIDTH 150
317 #define IMPL_MINSIZE_MSGBOX_HEIGHT 80
318 #define IMPL_DIALOG_OFFSET 5
319 #define IMPL_DIALOG_BAR_OFFSET 3
320 #define IMPL_MSGBOX_OFFSET_EXTRA_X 0
321 #define IMPL_MSGBOX_OFFSET_EXTRA_Y 2
322 #define IMPL_SEP_MSGBOX_IMAGE 8
323 #define IMPL_SEP_BUTTON_IMAGE 4
325 #define DLGWINDOW_PREV 0
326 #define DLGWINDOW_NEXT 1
327 #define DLGWINDOW_FIRST 2
330 enum WindowSizeType
{
332 WINDOWSIZE_PREFERRED
,
341 const char* ImplDbgCheckWindow( const void* pObj
);
345 class VCL_DLLPUBLIC Window
: public OutputDevice
348 friend class OutputDevice
;
349 friend class Application
;
350 friend class SystemWindow
;
351 friend class WorkWindow
;
353 friend class MessBox
;
354 friend class DockingWindow
;
355 friend class FloatingWindow
;
356 friend class GroupBox
;
357 friend class PushButton
;
358 friend class RadioButton
;
359 friend class SystemChildWindow
;
360 friend class ImplBorderWindow
;
362 // TODO: improve missing functionality
363 // only required because of SetFloatingMode()
364 friend class ImplDockingWindowWrapper
;
365 friend class ImplPopupFloatWin
;
366 friend class MenuFloatingWindow
;
369 // NOTE: to remove many dependencies of other modules
370 // to this central file, all members are now hidden
371 // in the WindowImpl class and all inline functions
374 // Please do *not* add new members or inline functions to class Window,
375 // but use class WindowImpl instead
377 WindowImpl
* mpWindowImpl
;
379 SAL_DLLPRIVATE
void ImplInitWindowData( WindowType nType
);
382 friend const char* ImplDbgCheckWindow( const void* pObj
);
384 friend Window
* ImplFindWindow( const SalFrame
* pFrame
, Point
& rSalFramePos
);
386 SAL_DLLPRIVATE
void ImplInit( Window
* pParent
, WinBits nStyle
, SystemParentData
* pSystemParentData
);
387 SAL_DLLPRIVATE
void ImplInit( Window
* pParent
, WinBits nStyle
, const ::com::sun::star::uno::Any
& aSystemWorkWindowToken
);
388 SAL_DLLPRIVATE WinBits
ImplInitRes( const ResId
& rResId
);
389 SAL_DLLPRIVATE
void ImplLoadRes( const ResId
& rResId
);
390 SAL_DLLPRIVATE
void ImplWindowRes( const ResId
& rResId
);
391 SAL_DLLPRIVATE
void ImplSetFrameParent( const Window
* pParent
);
392 SAL_DLLPRIVATE
void ImplInsertWindow( Window
* pParent
);
393 SAL_DLLPRIVATE
void ImplRemoveWindow( BOOL bRemoveFrameData
);
394 SAL_DLLPRIVATE Window
* ImplGetWindow();
395 SAL_DLLPRIVATE ImplFrameData
* ImplGetFrameData();
396 SAL_DLLPRIVATE SalFrame
* ImplGetFrame() const;
397 SAL_DLLPRIVATE ImplWinData
* ImplGetWinData() const;
398 SAL_DLLPRIVATE SalGraphics
* ImplGetFrameGraphics() const;
399 SAL_DLLPRIVATE
void ImplCallFocusChangeActivate( Window
* pNewOverlapWindow
, Window
* pOldOverlapWindow
);
400 SAL_DLLPRIVATE Window
* ImplFindWindow( const Point
& rFramePos
);
401 SAL_DLLPRIVATE USHORT
ImplHitTest( const Point
& rFramePos
);
402 SAL_DLLPRIVATE Window
* ImplGetParent() const;
403 SAL_DLLPRIVATE Window
* ImplGetClientWindow() const;
404 SAL_DLLPRIVATE Window
* ImplGetBorderWindow() const;
405 SAL_DLLPRIVATE Window
* ImplGetFirstOverlapWindow();
406 SAL_DLLPRIVATE
const Window
* ImplGetFirstOverlapWindow() const;
407 SAL_DLLPRIVATE Window
* ImplGetFrameWindow() const;
408 SAL_DLLPRIVATE BOOL
ImplIsRealParentPath( const Window
* pWindow
) const;
409 SAL_DLLPRIVATE BOOL
ImplIsChild( const Window
* pWindow
, BOOL bSystemWindow
= FALSE
) const;
410 SAL_DLLPRIVATE BOOL
ImplIsWindowOrChild( const Window
* pWindow
, BOOL bSystemWindow
= FALSE
) const;
411 SAL_DLLPRIVATE Window
* ImplGetSameParent( const Window
* pWindow
) const;
412 SAL_DLLPRIVATE BOOL
ImplIsDockingWindow() const;
413 SAL_DLLPRIVATE BOOL
ImplIsFloatingWindow() const;
414 SAL_DLLPRIVATE BOOL
ImplIsToolbox() const;
415 SAL_DLLPRIVATE BOOL
ImplIsSplitter() const;
416 SAL_DLLPRIVATE BOOL
ImplIsPushButton() const;
417 SAL_DLLPRIVATE BOOL
ImplIsOverlapWindow() const;
418 SAL_DLLPRIVATE
void ImplSetActive( BOOL bActive
);
419 SAL_DLLPRIVATE BOOL
ImplIsMouseTransparent() const;
420 SAL_DLLPRIVATE
void ImplSetMouseTransparent( BOOL bTransparent
);
421 SAL_DLLPRIVATE
int ImplTestMousePointerSet();
422 SAL_DLLPRIVATE PointerStyle
ImplGetMousePointer() const;
423 SAL_DLLPRIVATE
void ImplResetReallyVisible();
424 SAL_DLLPRIVATE
void ImplSetReallyVisible();
425 SAL_DLLPRIVATE
void ImplCallInitShow();
426 SAL_DLLPRIVATE
void ImplAddDel( ImplDelData
* pDel
);
427 SAL_DLLPRIVATE
void ImplRemoveDel( ImplDelData
* pDel
);
428 SAL_DLLPRIVATE
void ImplInitResolutionSettings();
429 SAL_DLLPRIVATE
void ImplPointToLogic( Font
& rFont
) const;
430 SAL_DLLPRIVATE
void ImplLogicToPoint( Font
& rFont
) const;
431 SAL_DLLPRIVATE Point
ImplOutputToFrame( const Point
& rPos
);
432 SAL_DLLPRIVATE Point
ImplFrameToOutput( const Point
& rPos
);
433 SAL_DLLPRIVATE
void ImplOutputToFrame( Rectangle
& rRect
);
434 SAL_DLLPRIVATE
void ImplFrameToOutput( Rectangle
& rRect
);
435 SAL_DLLPRIVATE BOOL
ImplSysObjClip( const Region
* pOldRegion
);
436 SAL_DLLPRIVATE
void ImplUpdateSysObjChildsClip();
437 SAL_DLLPRIVATE
void ImplUpdateSysObjOverlapsClip();
438 SAL_DLLPRIVATE
void ImplUpdateSysObjClip();
439 SAL_DLLPRIVATE BOOL
ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller
= FALSE
);
440 SAL_DLLPRIVATE BOOL
ImplSetClipFlagOverlapWindows( BOOL bSysObjOnlySmaller
= FALSE
);
441 SAL_DLLPRIVATE BOOL
ImplSetClipFlag( BOOL bSysObjOnlySmaller
= FALSE
);
442 SAL_DLLPRIVATE
void ImplIntersectWindowClipRegion( Region
& rRegion
);
443 SAL_DLLPRIVATE
void ImplIntersectWindowRegion( Region
& rRegion
);
444 SAL_DLLPRIVATE
void ImplExcludeWindowRegion( Region
& rRegion
);
445 SAL_DLLPRIVATE
void ImplExcludeOverlapWindows( Region
& rRegion
);
446 SAL_DLLPRIVATE
void ImplExcludeOverlapWindows2( Region
& rRegion
);
447 SAL_DLLPRIVATE
void ImplClipBoundaries( Region
& rRegion
, BOOL bThis
, BOOL bOverlaps
);
448 SAL_DLLPRIVATE BOOL
ImplClipChilds( Region
& rRegion
);
449 SAL_DLLPRIVATE
void ImplClipAllChilds( Region
& rRegion
);
450 SAL_DLLPRIVATE
void ImplClipSiblings( Region
& rRegion
);
451 SAL_DLLPRIVATE
void ImplInitWinClipRegion();
452 SAL_DLLPRIVATE
void ImplInitWinChildClipRegion();
453 SAL_DLLPRIVATE Region
* ImplGetWinChildClipRegion();
454 SAL_DLLPRIVATE
void ImplIntersectAndUnionOverlapWindows( const Region
& rInterRegion
, Region
& rRegion
);
455 SAL_DLLPRIVATE
void ImplIntersectAndUnionOverlapWindows2( const Region
& rInterRegion
, Region
& rRegion
);
456 SAL_DLLPRIVATE
void ImplCalcOverlapRegionOverlaps( const Region
& rInterRegion
, Region
& rRegion
);
457 SAL_DLLPRIVATE
void ImplCalcOverlapRegion( const Rectangle
& rSourceRect
, Region
& rRegion
,
458 BOOL bChilds
, BOOL bParent
, BOOL bSiblings
);
459 SAL_DLLPRIVATE
void ImplCallPaint( const Region
* pRegion
, USHORT nPaintFlags
);
460 SAL_DLLPRIVATE
void ImplCallOverlapPaint();
461 SAL_DLLPRIVATE
void ImplPostPaint();
462 SAL_DLLPRIVATE
void ImplInvalidateFrameRegion( const Region
* pRegion
, USHORT nFlags
);
463 SAL_DLLPRIVATE
void ImplInvalidateOverlapFrameRegion( const Region
& rRegion
);
464 SAL_DLLPRIVATE
void ImplInvalidateParentFrameRegion( Region
& rRegion
);
465 SAL_DLLPRIVATE
void ImplInvalidate( const Region
* rRegion
, USHORT nFlags
);
466 SAL_DLLPRIVATE
void ImplValidateFrameRegion( const Region
* rRegion
, USHORT nFlags
);
467 SAL_DLLPRIVATE
void ImplValidate( const Region
* rRegion
, USHORT nFlags
);
468 SAL_DLLPRIVATE
void ImplMoveInvalidateRegion( const Rectangle
& rRect
, long nHorzScroll
, long nVertScroll
, BOOL bChilds
);
469 SAL_DLLPRIVATE
void ImplMoveAllInvalidateRegions( const Rectangle
& rRect
, long nHorzScroll
, long nVertScroll
, BOOL bChilds
);
470 SAL_DLLPRIVATE
void ImplScroll( const Rectangle
& rRect
, long nHorzScroll
, long nVertScroll
, USHORT nFlags
);
471 SAL_DLLPRIVATE
void ImplUpdateAll( BOOL bOverlapWindows
= TRUE
);
472 SAL_DLLPRIVATE
void ImplUpdateWindowPtr( Window
* pWindow
);
473 SAL_DLLPRIVATE
void ImplUpdateWindowPtr();
474 SAL_DLLPRIVATE
void ImplUpdateOverlapWindowPtr( BOOL bNewFrame
);
475 SAL_DLLPRIVATE BOOL
ImplUpdatePos();
476 SAL_DLLPRIVATE
void ImplUpdateSysObjPos();
477 SAL_DLLPRIVATE WindowImpl
* ImplGetWindowImpl() const { return mpWindowImpl
; }
478 /** check whether a font is suitable for UI
480 The font to be tested will be checked whether it could display a
481 localized test string. If this is not the case, then the font
482 is deemed unsuitable as UI font.
485 the font to be tested
488 <TRUE/> if the font can be used as UI font
489 <FALSE/> if the font is unsuitable as UI font
491 SAL_DLLPRIVATE
bool ImplCheckUIFont( const Font
& rFont
);
492 SAL_DLLPRIVATE
void ImplUpdateGlobalSettings( AllSettings
& rSettings
, BOOL bCallHdl
= TRUE
);
493 SAL_DLLPRIVATE
void ImplAlignChilds();
494 SAL_DLLPRIVATE
void ImplPosSizeWindow( long nX
, long nY
, long nWidth
, long nHeight
, USHORT nFlags
);
495 SAL_DLLPRIVATE
void ImplToBottomChild();
496 SAL_DLLPRIVATE
void ImplCalcToTop( ImplCalcToTopData
* pPrevData
);
497 SAL_DLLPRIVATE
void ImplCalcChildOverlapToTop( ImplCalcToTopData
* pPrevData
);
498 SAL_DLLPRIVATE
void ImplToTop( USHORT nFlags
);
499 SAL_DLLPRIVATE
void ImplStartToTop( USHORT nFlags
);
500 SAL_DLLPRIVATE
void ImplFocusToTop( USHORT nFlags
, BOOL bReallyVisible
);
501 SAL_DLLPRIVATE
void ImplShowAllOverlaps();
502 SAL_DLLPRIVATE
void ImplHideAllOverlaps();
503 SAL_DLLPRIVATE
void ImplNotifyKeyMouseCommandEventListeners( NotifyEvent
& rNEvt
);
504 SAL_DLLPRIVATE
void ImplCallMouseMove( USHORT nMouseCode
, BOOL bModChanged
= FALSE
);
505 SAL_DLLPRIVATE
void ImplGenerateMouseMove();
506 SAL_DLLPRIVATE
void ImplGrabFocus( USHORT nFlags
);
507 SAL_DLLPRIVATE
void ImplInvertFocus( const Rectangle
& rRect
);
508 SAL_DLLPRIVATE
void ImplControlFocus( USHORT nFlags
= 0 );
509 SAL_DLLPRIVATE Window
* ImplGetDlgWindow( USHORT n
, USHORT nType
, USHORT nStart
= 0, USHORT nEnd
= 0xFFFF, USHORT
* pIndex
= NULL
);
510 SAL_DLLPRIVATE BOOL
ImplDlgCtrl( const KeyEvent
& rKEvt
, BOOL bKeyInput
);
511 SAL_DLLPRIVATE BOOL
ImplHasDlgCtrl();
512 SAL_DLLPRIVATE
void ImplDlgCtrlNextWindow();
513 SAL_DLLPRIVATE
void ImplDlgCtrlFocusChanged( Window
* pWindow
, BOOL bGetFocus
);
514 SAL_DLLPRIVATE Window
* ImplFindDlgCtrlWindow( Window
* pWindow
);
515 SAL_DLLPRIVATE
long ImplLogicUnitToPixelX( long nX
, MapUnit eUnit
);
516 SAL_DLLPRIVATE
long ImplLogicUnitToPixelY( long nY
, MapUnit eUnit
);
517 SAL_DLLPRIVATE BOOL
ImplIsWindowInFront( const Window
* pTestWindow
) const;
518 SAL_DLLPRIVATE
void ImplSaveOverlapBackground();
519 SAL_DLLPRIVATE BOOL
ImplRestoreOverlapBackground( Region
& rInvRegion
);
520 SAL_DLLPRIVATE
void ImplDeleteOverlapBackground();
521 SAL_DLLPRIVATE
void ImplInvalidateAllOverlapBackgrounds();
522 SAL_DLLPRIVATE
static void ImplNewInputContext();
523 SAL_DLLPRIVATE
void ImplCallActivateListeners(Window
*);
524 SAL_DLLPRIVATE
void ImplCallDeactivateListeners(Window
*);
525 DECL_DLLPRIVATE_LINK( ImplHandlePaintHdl
, void* );
526 DECL_DLLPRIVATE_LINK( ImplGenerateMouseMoveHdl
, void* );
527 DECL_DLLPRIVATE_LINK( ImplTrackTimerHdl
, Timer
* );
528 DECL_DLLPRIVATE_LINK( ImplAsyncFocusHdl
, void* );
529 DECL_DLLPRIVATE_LINK( ImplAsyncStateChangedHdl
, void* );
530 DECL_DLLPRIVATE_LINK( ImplHideOwnerDrawWindowsHdl
, void* );
531 DECL_DLLPRIVATE_LINK( ImplHandleResizeTimerHdl
, void* );
533 SAL_DLLPRIVATE
static void ImplCalcSymbolRect( Rectangle
& rRect
);
534 SAL_DLLPRIVATE
void ImplHandleScroll( ScrollBar
* pHScrl
, long nX
, ScrollBar
* pVScrl
, long nY
);
535 SAL_DLLPRIVATE BOOL
ImplGetCurrentBackgroundColor( Color
& rCol
);
536 SAL_DLLPRIVATE BOOL
ImplIsAccessibleCandidate() const;
537 SAL_DLLPRIVATE BOOL
ImplIsAccessibleNativeFrame() const;
538 SAL_DLLPRIVATE USHORT
ImplGetAccessibleCandidateChildWindowCount( USHORT nFirstWindowType
) const;
539 SAL_DLLPRIVATE Window
* ImplGetAccessibleCandidateChild( USHORT nChild
, USHORT
& rChildCount
, USHORT nFirstWindowType
, BOOL bTopLevel
= TRUE
) const;
540 SAL_DLLPRIVATE BOOL
ImplRegisterAccessibleNativeFrame();
541 SAL_DLLPRIVATE
void ImplRevokeAccessibleNativeFrame();
542 SAL_DLLPRIVATE
void ImplCallResize();
543 SAL_DLLPRIVATE
void ImplCallMove();
544 SAL_DLLPRIVATE Rectangle
ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle
& rRect
) const;
545 SAL_DLLPRIVATE
void ImplMirrorFramePos( Point
&pt
) const;
546 SAL_DLLPRIVATE
long ImplGetUnmirroredOutOffX();
547 SAL_DLLPRIVATE
void ImplIncModalCount();
548 SAL_DLLPRIVATE
void ImplDecModalCount();
550 // retrieves the list of owner draw decorated windows for this window hiearchy
551 SAL_DLLPRIVATE ::std::vector
<Window
*>& ImplGetOwnerDrawList();
552 SAL_DLLPRIVATE Window
* ImplGetTopmostFrameWindow();
554 SAL_DLLPRIVATE Rectangle
ImplGetWindowExtentsRelative( Window
*pRelativeWindow
, BOOL bClientOnly
);
555 SAL_DLLPRIVATE
void ImplNotifyIconifiedState( BOOL bIconified
);
556 SAL_DLLPRIVATE
bool ImplStopDnd();
557 SAL_DLLPRIVATE
void ImplStartDnd();
559 SAL_DLLPRIVATE
static void ImplInitAppFontData( Window
* pWindow
);
560 SAL_DLLPRIVATE
void ImplInitSalControlHandle();
561 SAL_DLLPRIVATE
void ImplPaintToDevice( OutputDevice
* pTargetOutDev
, const Point
& rPos
);
563 SAL_DLLPRIVATE BOOL
ImplIsInTaskPaneList();
564 SAL_DLLPRIVATE
void ImplIsInTaskPaneList( BOOL mbIsInTaskList
);
565 SAL_DLLPRIVATE ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XCanvas
>
566 ImplGetCanvas( const Size
& rFullscreenSize
, bool bFullscreen
, bool bSpriteCanvas
) const;
567 SAL_DLLPRIVATE
void ImplMoveControlValue( ControlType
, const ImplControlValue
&, const Point
& ) const;
570 // Default construction is forbidden and not implemented.
571 SAL_DLLPRIVATE
Window();
573 // Copy assignment is forbidden and not implemented.
574 SAL_DLLPRIVATE
Window (const Window
&);
575 SAL_DLLPRIVATE Window
& operator= (const Window
&);
578 // Single argument ctors shall be explicit.
579 explicit Window( WindowType nType
);
581 void SetCompoundControl( BOOL bCompound
);
583 void ImplCallEventListeners( ULONG nEvent
, void* pData
= NULL
);
584 void CallEventListeners( ULONG nEvent
, void* pData
= NULL
);
585 void FireVclEvent( VclSimpleEvent
* pEvent
);
587 // FIXME: this is a hack to workaround missing layout functionality
588 SAL_DLLPRIVATE
void ImplAdjustNWFSizes();
590 // Single argument ctors shall be explicit.
591 explicit Window( Window
* pParent
, WinBits nStyle
= 0 );
593 Window( Window
* pParent
, const ResId
& rResId
);
596 virtual void MouseMove( const MouseEvent
& rMEvt
);
597 virtual void MouseButtonDown( const MouseEvent
& rMEvt
);
598 virtual void MouseButtonUp( const MouseEvent
& rMEvt
);
599 virtual void KeyInput( const KeyEvent
& rKEvt
);
600 virtual void KeyUp( const KeyEvent
& rKEvt
);
601 virtual void PrePaint();
602 virtual void Paint( const Rectangle
& rRect
);
603 virtual void Draw( OutputDevice
* pDev
, const Point
& rPos
, const Size
& rSize
, ULONG nFlags
);
605 virtual void Resize();
606 virtual void Activate();
607 virtual void Deactivate();
608 virtual void GetFocus();
609 virtual void LoseFocus();
610 virtual void RequestHelp( const HelpEvent
& rHEvt
);
611 virtual void Command( const CommandEvent
& rCEvt
);
612 virtual void Tracking( const TrackingEvent
& rTEvt
);
613 virtual void UserEvent( ULONG nEvent
, void* pEventData
);
614 virtual void StateChanged( StateChangedType nStateChange
);
615 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
616 virtual long PreNotify( NotifyEvent
& rNEvt
);
617 virtual long Notify( NotifyEvent
& rNEvt
);
618 virtual Window
* GetPreferredKeyInputWindow();
620 /*virtual*/ void AddEventListener( const Link
& rEventListener
);
621 /*virtual*/ void RemoveEventListener( const Link
& rEventListener
);
622 /*virtual*/ void AddChildEventListener( const Link
& rEventListener
);
623 /*virtual*/ void RemoveChildEventListener( const Link
& rEventListener
);
625 ULONG
PostUserEvent( ULONG nEvent
, void* pEventData
= NULL
);
626 ULONG
PostUserEvent( const Link
& rLink
, void* pCaller
= NULL
);
627 BOOL
PostUserEvent( ULONG
& rEventId
, ULONG nEvent
, void* pEventData
= NULL
);
628 BOOL
PostUserEvent( ULONG
& rEventId
, const Link
& rLink
, void* pCaller
= NULL
);
629 void RemoveUserEvent( ULONG nUserEvent
);
630 void PostStateChanged( StateChangedType nState
);
632 void IncrementLockCount();
633 void DecrementLockCount();
634 BOOL
IsLocked( BOOL bChilds
= FALSE
) const;
636 // returns the input language used for the last key stroke
637 // may be LANGUAGE_DONTKNOW if not supported by the OS
638 LanguageType
GetInputLanguage() const;
640 void SetStyle( WinBits nStyle
);
641 WinBits
GetStyle() const;
642 WinBits
GetPrevStyle() const;
643 void SetExtendedStyle( WinBits nExtendedStyle
);
644 WinBits
GetExtendedStyle() const;
645 WinBits
GetPrevExtendedStyle() const;
646 void SetType( WindowType nType
);
647 WindowType
GetType() const;
648 BOOL
IsSystemWindow() const;
649 BOOL
IsDialog() const;
650 BOOL
IsMenuFloatingWindow() const;
651 BOOL
IsToolbarFloatingWindow() const;
652 BOOL
IsTopWindow() const;
653 SystemWindow
* GetSystemWindow() const;
655 void EnableAllResize( BOOL bEnable
= TRUE
);
656 BOOL
IsAllResizeEnabled() const;
658 void SetBorderStyle( USHORT nBorderStyle
);
659 USHORT
GetBorderStyle() const;
660 void GetBorder( sal_Int32
& rLeftBorder
, sal_Int32
& rTopBorder
,
661 sal_Int32
& rRightBorder
, sal_Int32
& rBottomBorder
) const;
662 Size
CalcWindowSize( const Size
& rOutSz
) const;
663 Size
CalcOutputSize( const Size
& rWinSz
) const;
664 long CalcTitleWidth() const;
666 void EnableClipSiblings( BOOL bClipSiblings
= TRUE
);
667 BOOL
IsClipSiblingsEnabled() const;
669 void EnableChildTransparentMode( BOOL bEnable
= TRUE
);
670 BOOL
IsChildTransparentModeEnabled() const;
672 void SetMouseTransparent( BOOL bTransparent
);
673 BOOL
IsMouseTransparent() const;
674 void SetPaintTransparent( BOOL bTransparent
);
675 BOOL
IsPaintTransparent() const;
676 void SetDialogControlStart( BOOL bStart
);
677 BOOL
IsDialogControlStart() const;
678 void SetDialogControlFlags( USHORT nFlags
);
679 USHORT
GetDialogControlFlags() const;
683 ULONG mnState
; // the button state
684 Point maPos
; // mouse position in output coordinates
686 PointerState
GetPointerState();
689 ULONG
GetCurrentModButtons();
691 void SetInputContext( const InputContext
& rInputContext
);
692 const InputContext
& GetInputContext() const;
693 void EndExtTextInput( USHORT nFlags
);
694 BOOL
IsExtTextInput() const;
695 void SetCursorRect( const Rectangle
* pRect
= NULL
, long nExtTextInputWidth
= 0 );
696 const Rectangle
* GetCursorRect() const;
697 long GetCursorExtTextInputWidth() const;
699 void EnableChildNotify( BOOL bEnable
);
700 BOOL
IsChildNotify() const;
702 using OutputDevice::SetSettings
;
703 virtual void SetSettings( const AllSettings
& rSettings
);
704 virtual void SetSettings( const AllSettings
& rSettings
, BOOL bChild
);
705 void UpdateSettings( const AllSettings
& rSettings
, BOOL bChild
= FALSE
);
706 void NotifyAllChilds( DataChangedEvent
& rDCEvt
);
708 void SetPointFont( const Font
& rFont
);
709 Font
GetPointFont() const;
710 void SetZoomedPointFont( const Font
& rFont
);
711 long GetDrawPixel( OutputDevice
* pDev
, long nPixels
) const;
712 Font
GetDrawPixelFont( OutputDevice
* pDev
) const;
713 void GetFontResolution( sal_Int32
& nDPIX
, sal_Int32
& nDPIY
) const;
715 void SetControlFont();
716 void SetControlFont( const Font
& rFont
);
717 Font
GetControlFont() const;
718 BOOL
IsControlFont() const;
719 void SetControlForeground();
720 void SetControlForeground( const Color
& rColor
);
721 Color
GetControlForeground() const;
722 BOOL
IsControlForeground() const;
723 void SetControlBackground();
724 void SetControlBackground( const Color
& rColor
);
725 Color
GetControlBackground() const;
726 BOOL
IsControlBackground() const;
728 void SetParentClipMode( USHORT nMode
= 0 );
729 USHORT
GetParentClipMode() const;
731 void SetWindowRegionPixel();
732 void SetWindowRegionPixel( const Region
& rRegion
);
733 const Region
& GetWindowRegionPixel() const;
734 BOOL
IsWindowRegionPixel() const;
735 Region
GetWindowClipRegionPixel( USHORT nFlags
= 0 ) const;
736 Region
GetPaintRegion() const;
737 BOOL
IsInPaint() const;
738 // while IsInPaint returns true ExpandPaintClipRegion adds the
739 // submitted region to the paint clip region so you can
740 // paint additional parts of your window if necessary
741 void ExpandPaintClipRegion( const Region
& rRegion
);
743 void SetParent( Window
* pNewParent
);
744 Window
* GetParent() const;
746 void Show( BOOL bVisible
= TRUE
, USHORT nFlags
= 0 );
747 void Hide( USHORT nFlags
= 0 ) { Show( FALSE
, nFlags
); }
748 BOOL
IsVisible() const;
749 BOOL
IsReallyVisible() const;
750 // Do not use this function, use IsReallyVisible()
751 BOOL
IsParentPathVisible() const;
752 BOOL
IsReallyShown() const;
753 BOOL
IsInInitShow() const;
755 void Enable( bool bEnable
= true, bool bChild
= true );
756 void Disable( bool bChild
= true ) { Enable( false, bChild
); }
757 BOOL
IsEnabled() const;
759 void EnableInput( BOOL bEnable
= TRUE
, BOOL bChild
= TRUE
);
760 void EnableInput( BOOL bEnable
, BOOL bChild
, BOOL bSysWin
,
761 const Window
* pExcludeWindow
= NULL
);
762 BOOL
IsInputEnabled() const;
764 /** Override <code>EnableInput</code>. This can be necessary due to other people
765 using EnableInput for whole window hierarchies.
768 <code>AlwaysEnableInput</code> and <code>AlwaysDisableInput</code> are
769 mutually exclusive; the last setter wins.
771 sets always enabled flag
774 if true children are recursively set to AlwaysEnableInput
776 void AlwaysEnableInput( BOOL bAlways
, BOOL bChild
= TRUE
);
777 /** returns the current AlwaysEnableInput state
779 true if window is in AlwaysEnableInput state
781 BOOL
IsAlwaysEnableInput() const;
782 /** Override <code>EnableInput</code>, counterpart to AlwaysEnableInput.
783 Windows with AlwaysDisableInput will not get key events even if enabled
784 and input enabled.This can be necessary due to other people using EnableInput
785 for whole window hierarchies.
787 <code>AlwaysEnableInput</code> and <code>AlwaysDisableInput</code> are
788 mutually exclusive; the last setter wins.
791 sets always disable flag
794 if true children are recursively set to AlwaysDisableInput
796 void AlwaysDisableInput( BOOL bAlways
, BOOL bChild
= TRUE
);
797 /** returns the current AlwaysDisableInput state
799 true if window is in AlwaysEnableInput state
801 BOOL
IsAlwaysDisableInput() const;
802 /** usually event handlers (see AddEventListener and AddChildEventListener)
803 are not called on disabled, modal or input disabled windows. There are however rare cases
804 in which one wants a Window or rather one of its Control subclasses to
805 not evaluate events but still react to those events externally. In these
806 rare cases call SetCallHandlersOnInputDisabled( true ) to have your handler
809 Currently only mouse events get this special treatment.
811 Use this sparingly, chances are if you want to use it you're wroking around
815 Enable/Disable calling event handlers for this disabled, modal or input disabled window.
816 This call is implicity done recursively for possible child windows.
818 void SetCallHandlersOnInputDisabled( bool bCall
);
819 /** get state of SetCallHandlersOnInputDisabled
821 @returns whether handlers are called regardless of input enabled state
823 bool IsCallHandlersOnInputDisabled() const;
824 /** A window is in modal mode if one of its children or subchildren
825 is a running modal window (a modal dialog)
827 @returns TRUE if a child or subchild is a running modal window
829 BOOL
IsInModalMode() const;
831 void SetActivateMode( USHORT nMode
);
832 USHORT
GetActivateMode() const;
834 void ToTop( USHORT nFlags
= 0 );
835 void SetZOrder( Window
* pRefWindow
, USHORT nFlags
);
836 void EnableAlwaysOnTop( BOOL bEnable
= TRUE
);
837 BOOL
IsAlwaysOnTopEnabled() const;
839 virtual void SetPosSizePixel( long nX
, long nY
,
840 long nWidth
, long nHeight
,
841 USHORT nFlags
= WINDOW_POSSIZE_ALL
);
842 virtual void SetPosPixel( const Point
& rNewPos
);
843 virtual Point
GetPosPixel() const;
844 virtual void SetSizePixel( const Size
& rNewSize
);
845 virtual Size
GetSizePixel() const;
846 virtual void SetPosSizePixel( const Point
& rNewPos
,
847 const Size
& rNewSize
);
848 virtual void SetOutputSizePixel( const Size
& rNewSize
);
849 BOOL
IsDefaultPos() const;
850 BOOL
IsDefaultSize() const;
852 // those conversion routines might deliver different results during UI mirroring
853 Point
OutputToScreenPixel( const Point
& rPos
) const;
854 Point
ScreenToOutputPixel( const Point
& rPos
) const;
855 // the normalized screen methods work independent from UI mirroring
856 Point
OutputToNormalizedScreenPixel( const Point
& rPos
) const;
857 Point
NormalizedScreenToOutputPixel( const Point
& rPos
) const;
858 Point
OutputToAbsoluteScreenPixel( const Point
& rPos
) const;
859 Point
AbsoluteScreenToOutputPixel( const Point
& rPos
) const;
860 Rectangle
GetDesktopRectPixel() const;
861 // window extents including border and decoratrion
862 Rectangle
GetWindowExtentsRelative( Window
*pRelativeWindow
);
863 // window extents of the client window, coordinates to be used in SetPosPixel
864 Rectangle
GetClientWindowExtentsRelative( Window
*pRelativeWindow
);
866 virtual BOOL
IsScrollable() const;
867 virtual void Scroll( long nHorzScroll
, long nVertScroll
,
869 virtual void Scroll( long nHorzScroll
, long nVertScroll
,
870 const Rectangle
& rRect
, USHORT nFlags
= 0 );
871 virtual void Invalidate( USHORT nFlags
= 0 );
872 virtual void Invalidate( const Rectangle
& rRect
, USHORT nFlags
= 0 );
873 virtual void Invalidate( const Region
& rRegion
, USHORT nFlags
= 0 );
874 void Validate( USHORT nFlags
= 0 );
875 void Validate( const Rectangle
& rRect
, USHORT nFlags
= 0 );
876 void Validate( const Region
& rRegion
, USHORT nFlags
= 0 );
877 BOOL
HasPaintEvent() const;
882 // toggles new docking support, enabled via toolkit
883 void EnableDocking( BOOL bEnable
= TRUE
);
884 // retrieves the single dockingmanager instance
885 static DockingManager
* GetDockingManager();
887 void EnablePaint( BOOL bEnable
);
888 BOOL
IsPaintEnabled() const;
889 void SetUpdateMode( BOOL bUpdate
);
890 BOOL
IsUpdateMode() const;
891 void SetParentUpdateMode( BOOL bUpdate
);
892 BOOL
IsParentUpdateMode() const;
895 BOOL
HasFocus() const;
896 BOOL
HasChildPathFocus( BOOL bSystemWindow
= FALSE
) const;
897 BOOL
IsActive() const;
898 BOOL
HasActiveChildFrame();
899 USHORT
GetGetFocusFlags() const;
900 void GrabFocusToDocument();
903 * Set this when you need to act as if the window has focus even if it
904 * doesn't. This is necessary for implementing tab stops inside floating
905 * windows, but floating windows don't get focus from the system.
907 void SetFakeFocus( bool bFocus
);
909 BOOL
IsCompoundControl() const;
910 BOOL
HasCompoundControlFocus() const;
912 static sal_uIntPtr
SaveFocus();
913 static BOOL
EndSaveFocus( sal_uIntPtr nSaveId
, BOOL bRestore
= TRUE
);
917 BOOL
IsMouseCaptured() const;
919 void SetPointer( const Pointer
& rPointer
);
920 const Pointer
& GetPointer() const;
921 void EnableChildPointerOverwrite( BOOL bOverwrite
= TRUE
);
922 BOOL
IsChildPointerOverwrite() const;
923 void SetPointerPosPixel( const Point
& rPos
);
924 Point
GetPointerPosPixel();
925 Point
GetLastPointerPosPixel();
926 void ShowPointer( BOOL bVisible
);
927 BOOL
IsPointerVisible() const;
932 void SetCursor( Cursor
* pCursor
);
933 Cursor
* GetCursor() const;
935 void SetZoom( const Fraction
& rZoom
);
936 const Fraction
& GetZoom() const;
938 long CalcZoom( long n
) const;
940 virtual void SetText( const XubString
& rStr
);
941 virtual String
GetText() const;
942 // return the actual text displayed
943 // this may have e.g. accellerators removed or portions
944 // replaced by ellipsis
945 virtual String
GetDisplayText() const;
946 // gets the visible background color. for transparent windows
947 // this may be the parent's background color; for controls
948 // this may be a child's background color (e.g. ListBox)
949 virtual const Wallpaper
& GetDisplayBackground() const;
951 void SetHelpText( const XubString
& rHelpText
);
952 const XubString
& GetHelpText() const;
954 void SetQuickHelpText( const XubString
& rHelpText
);
955 const XubString
& GetQuickHelpText() const;
957 void SetHelpId( ULONG nHelpId
); /// deprecated
958 ULONG
GetHelpId() const; /// deprecated
959 void SetSmartHelpId( const SmartId
& aId
, SmartIdUpdateMode aMode
= SMART_SET_SMART
);
960 SmartId
GetSmartHelpId() const;
962 void SetUniqueId( ULONG nUniqueId
); /// deprecated
963 ULONG
GetUniqueId() const; /// deprecated
964 void SetSmartUniqueId( const SmartId
& aId
, SmartIdUpdateMode aMode
= SMART_SET_SMART
);
965 SmartId
GetSmartUniqueId() const;
966 SmartId
GetSmartUniqueOrHelpId() const;
968 Window
* FindWindow( const Point
& rPos
) const;
970 USHORT
GetChildCount() const;
971 Window
* GetChild( USHORT nChild
) const;
972 Window
* GetWindow( USHORT nType
) const;
973 BOOL
IsChild( const Window
* pWindow
, BOOL bSystemWindow
= FALSE
) const;
974 BOOL
IsWindowOrChild( const Window
* pWindow
, BOOL bSystemWindow
= FALSE
) const;
976 void SetData( void* pNewData
);
977 void* GetData() const;
979 // Should be merged in the next top level build !!!
980 Bitmap
SnapShot( BOOL bBorder
) const;
981 Bitmap
SnapShot() const;
983 void ShowFocus( const Rectangle
& rRect
);
986 void Invert( const Rectangle
& rRect
, USHORT nFlags
= 0 );
987 void Invert( const Polygon
& rPoly
, USHORT nFlags
= 0 );
989 // transparent background for selected or checked items in toolboxes etc.
990 void DrawSelectionBackground( const Rectangle
& rRect
, USHORT highlight
, BOOL bChecked
, BOOL bDrawBorder
, BOOL bDrawExtBorderOnly
);
991 // the same, but fills a passed Color with a text color complementing the selection background
992 void DrawSelectionBackground( const Rectangle
& rRect
, USHORT highlight
, BOOL bChecked
, BOOL bDrawBorder
, BOOL bDrawExtBorderOnly
, Color
* pSelectionTextColor
);
993 // support rounded edges in the selection rect
994 void DrawSelectionBackground( const Rectangle
& rRect
, USHORT highlight
, BOOL bChecked
, BOOL bDrawBorder
, BOOL bDrawExtBorderOnly
, long nCornerRadius
, Color
* pSelectionTextColor
, Color
* pPaintColor
);
996 void ShowTracking( const Rectangle
& rRect
,
997 USHORT nFlags
= SHOWTRACK_SMALL
);
999 void InvertTracking( const Rectangle
& rRect
,
1000 USHORT nFlags
= SHOWTRACK_SMALL
);
1001 void InvertTracking( const Polygon
& rPoly
, USHORT nFlags
= 0 );
1003 void StartTracking( USHORT nFlags
= 0 );
1004 void EndTracking( USHORT nFlags
= 0 );
1005 BOOL
IsTracking() const;
1007 void StartAutoScroll( USHORT nFlags
);
1008 void EndAutoScroll();
1009 BOOL
IsAutoScroll() const;
1011 BOOL
HandleScrollCommand( const CommandEvent
& rCmd
,
1012 ScrollBar
* pHScrl
= NULL
,
1013 ScrollBar
* pVScrl
= NULL
);
1015 void SaveBackground( const Point
& rPos
, const Size
& rSize
,
1016 const Point
& rDestOff
, VirtualDevice
& rSaveDevice
);
1018 const SystemEnvData
* GetSystemData() const;
1019 ::com::sun::star::uno::Any
GetSystemDataAny() const;
1021 // API zum Setzen/Abfragen des Komponenteninterfaces
1022 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindowPeer
> GetComponentInterface( BOOL bCreate
= TRUE
);
1023 virtual void SetComponentInterface( ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindowPeer
> xIFace
);
1026 ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> GetAccessible( BOOL bCreate
= TRUE
);
1027 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> CreateAccessible();
1028 void SetAccessible( ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> );
1030 Window
* GetAccessibleParentWindow() const;
1031 USHORT
GetAccessibleChildWindowCount();
1032 Window
* GetAccessibleChildWindow( USHORT n
);
1034 void SetAccessibleRole( USHORT nRole
);
1035 USHORT
GetAccessibleRole() const;
1037 void SetAccessibleName( const String
& rName
);
1038 String
GetAccessibleName() const;
1040 void SetAccessibleDescription( const String
& rDescr
);
1041 String
GetAccessibleDescription() const;
1043 // to avoid sending accessibility events in cases like closing dialogs
1044 // by default checks complete parent path
1045 BOOL
IsAccessibilityEventsSuppressed( BOOL bTraverseParentPath
= TRUE
);
1047 /// request XCanvas render interface for this window
1048 ::com::sun::star::uno::Reference
<
1049 ::com::sun::star::rendering::XCanvas
> GetCanvas() const;
1050 /// request XSpriteCanvas render interface for this window
1051 ::com::sun::star::uno::Reference
<
1052 ::com::sun::star::rendering::XSpriteCanvas
> GetSpriteCanvas() const;
1053 /// request fullscreen XSpriteCanvas render interface for this window
1054 ::com::sun::star::uno::Reference
<
1055 ::com::sun::star::rendering::XSpriteCanvas
> GetFullscreenSpriteCanvas( const Size
& rFullscreenSize
) const;
1057 /* records all DrawText operations within the passed rectangle;
1058 * a synchronous paint is sent to achieve this
1060 void RecordLayoutData( vcl::ControlLayoutData
* pLayout
, const Rectangle
& rRect
);
1062 // Setzen und Abfragen fuer das Toolkit
1063 VCLXWindow
* GetWindowPeer() const;
1064 void SetWindowPeer( ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindowPeer
> xPeer
, VCLXWindow
* pVCLXWindow
);
1066 // Merken, ob vom Toolkit erzeugt
1067 BOOL
IsCreatedWithToolkit() const;
1068 void SetCreatedWithToolkit( BOOL b
);
1070 Window
* GetLabelFor() const;
1071 Window
* GetLabeledBy() const;
1072 virtual Window
* GetParentLabelFor( const Window
* pLabel
) const;
1073 virtual Window
* GetParentLabeledBy( const Window
* pLabeled
) const;
1074 KeyEvent
GetActivationKey() const;
1076 // Drag and Drop interfaces
1077 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDropTarget
> GetDropTarget();
1078 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDragSource
> GetDragSource();
1079 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer
> GetDragGestureRecognizer();
1080 // only for RVP transmission
1081 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
);
1083 // Clipboard/Selection interfaces
1084 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
> GetClipboard();
1085 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
> GetPrimarySelection();
1087 // Advisory Sizing - what is a good size for this widget ?
1088 virtual Size
GetOptimalSize(WindowSizeType eType
) const;
1090 //-------------------------------------
1091 // Native Widget Rendering functions
1092 //-------------------------------------
1094 // form controls must never use native widgets, this can be toggled here
1095 void EnableNativeWidget( BOOL bEnable
= TRUE
);
1096 BOOL
IsNativeWidgetEnabled() const;
1098 // These all just call through to the private mpWindowImpl->mpFrame functions of the same name.
1100 // Query the platform layer for control support
1101 BOOL
IsNativeControlSupported( ControlType nType
, ControlPart nPart
);
1103 // Query the native control to determine if it was acted upon
1104 BOOL
HitTestNativeControl( ControlType nType
,
1106 const Region
& rControlRegion
,
1110 // Request rendering of a particular control and/or part
1111 BOOL
DrawNativeControl( ControlType nType
,
1113 const Region
& rControlRegion
,
1114 ControlState nState
,
1115 const ImplControlValue
& aValue
,
1116 rtl::OUString aCaption
);
1118 // Request rendering of a caption string for a control
1119 BOOL
DrawNativeControlText( ControlType nType
,
1121 const Region
& rControlRegion
,
1122 ControlState nState
,
1123 const ImplControlValue
& aValue
,
1124 rtl::OUString aCaption
);
1126 // Query the native control's actual drawing region (including adornment)
1127 BOOL
GetNativeControlRegion( ControlType nType
,
1129 const Region
& rControlRegion
,
1130 ControlState nState
,
1131 const ImplControlValue
& aValue
,
1132 rtl::OUString aCaption
,
1133 Region
&rNativeBoundingRegion
,
1134 Region
&rNativeContentRegion
);
1136 // a helper method for a Control's Draw method
1137 void PaintToDevice( OutputDevice
* pDevice
, const Point
& rPos
, const Size
& rSize
);
1139 /* mark Window for deletion in top of event queue
1141 void doLazyDelete();
1143 //-------------------------------------
1144 // Keyboard access functions
1145 //-------------------------------------
1147 /** Query the states of keyboard indicators - Caps Lock, Num Lock and
1148 Scroll Lock. Use the following mask to retrieve the state of each
1153 INDICATOR_SCROLL_LOCK
1155 USHORT
GetIndicatorState() const;
1157 void SimulateKeyPress( USHORT nKeyCode
) const;
1159 virtual XubString
GetSurroundingText() const;
1160 virtual Selection
GetSurroundingTextSelection() const;
1164 #endif // _SV_WINDOW_HXX