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