1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_VCL_INC_WINDOW_H
21 #define INCLUDED_VCL_INC_WINDOW_H
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <cppuhelper/weakref.hxx>
26 #include <tools/wintypes.hxx>
27 #include <vcl/inputctx.hxx>
28 #include <vcl/outdev.hxx>
29 #include <vcl/pointr.hxx>
30 #include <vcl/salnativewidgets.hxx>
31 #include <vcl/timer.hxx>
32 #include <vcl/vclevent.hxx>
37 struct ImplAccessibleInfos
;
44 class PhysicalFontCollection
;
53 namespace accessibility
{
75 namespace datatransfer
{
81 class XDropTargetListener
;
82 class XDragGestureRecognizer
;
88 struct ControlLayoutData
;
91 bool ImplWindowFrameProc( Window
* pInst
, SalFrame
* pFrame
, sal_uInt16 nEvent
, const void* pEvent
);
93 #define WINDOW_HITTEST_INSIDE ((sal_uInt16)0x0001)
94 #define WINDOW_HITTEST_TRANSPARENT ((sal_uInt16)0x0002)
98 OUString
* mpExtOldText
;
99 sal_uInt16
* mpExtOldAttrAry
;
100 Rectangle
* mpCursorRect
;
101 long mnCursorExtWidth
;
103 Rectangle
* mpCompositionCharRects
;
104 long mnCompositionCharRects
;
105 Rectangle
* mpFocusRect
;
106 Rectangle
* mpTrackRect
;
107 sal_uInt16 mnTrackFlags
;
108 sal_uInt16 mnIsTopWindow
;
109 bool mbMouseOver
; // tracks mouse over for native widget paint effect
110 bool mbEnableNativeWidget
; // toggle native widget rendering
111 ::std::list
< Window
* >
115 struct ImplOverlapData
117 VirtualDevice
* mpSaveBackDev
; // saved background bitmap
118 Region
* mpSaveBackRgn
; // saved region, which must be invalidated
119 Window
* mpNextBackWin
; // next window with saved background
120 sal_uIntPtr mnSaveBackSize
; // bitmap size of saved background
121 bool mbSaveBack
; // sal_True: save background
122 sal_uInt8 mnTopLevel
; // Level for Overlap-Window
127 Timer maPaintTimer
; // paint timer
128 Timer maResizeTimer
; // resize timer
129 InputContext maOldInputContext
; // last set Input Context
130 Window
* mpNextFrame
; // next frame window
131 Window
* mpFirstOverlap
; // first overlap window
132 Window
* mpFocusWin
; // focus window (is also set, when frame doesn't have the focous)
133 Window
* mpMouseMoveWin
; // last window, where MouseMove() called
134 Window
* mpMouseDownWin
; // last window, where MouseButtonDown() called
135 Window
* mpFirstBackWin
; // first overlap-window with saved background
136 ::std::vector
<Window
*> maOwnerDrawList
; // List of system windows with owner draw decoration
137 PhysicalFontCollection
* mpFontCollection
; // Font-List for this frame
138 ImplFontCache
* mpFontCache
; // Font-Cache for this frame
139 sal_Int32 mnDPIX
; // Original Screen Resolution
140 sal_Int32 mnDPIY
; // Original Screen Resolution
141 ImplMapRes maMapUnitRes
; // for LogicUnitToPixel
142 sal_uIntPtr mnAllSaveBackSize
; // size of all bitmaps of saved backgrounds
143 ImplSVEvent
* mnFocusId
; // FocusId for PostUserLink
144 ImplSVEvent
* mnMouseMoveId
; // MoveId for PostUserLink
145 long mnLastMouseX
; // last x mouse position
146 long mnLastMouseY
; // last y mouse position
147 long mnBeforeLastMouseX
; // last but one x mouse position
148 long mnBeforeLastMouseY
; // last but one y mouse position
149 long mnFirstMouseX
; // first x mouse position by mousebuttondown
150 long mnFirstMouseY
; // first y mouse position by mousebuttondown
151 long mnLastMouseWinX
; // last x mouse position, rel. to pMouseMoveWin
152 long mnLastMouseWinY
; // last y mouse position, rel. to pMouseMoveWin
153 sal_uInt16 mnModalMode
; // frame based modal count (app based makes no sense anymore)
154 sal_uIntPtr mnMouseDownTime
; // mouse button down time for double click
155 sal_uInt16 mnClickCount
; // mouse click count
156 sal_uInt16 mnFirstMouseCode
; // mouse code by mousebuttondown
157 sal_uInt16 mnMouseCode
; // mouse code
158 sal_uInt16 mnMouseMode
; // mouse mode
159 MapUnit meMapUnit
; // last MapUnit for LogicUnitToPixel
160 bool mbHasFocus
; // focus
161 bool mbInMouseMove
; // is MouseMove on stack
162 bool mbMouseIn
; // is Mouse inside the frame
163 bool mbStartDragCalled
; // is command startdrag called
164 bool mbNeedSysWindow
; // set, when FrameSize <= IMPL_MIN_NEEDSYSWIN
165 bool mbMinimized
; // set, when FrameSize <= 0
166 bool mbStartFocusState
; // FocusState, when sending the event
167 bool mbInSysObjFocusHdl
; // within a SysChildren's GetFocus handler
168 bool mbInSysObjToTopHdl
; // within a SysChildren's ToTop handler
169 bool mbSysObjFocus
; // does a SysChild have focus
171 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDragSource
> mxDragSource
;
172 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDropTarget
> mxDropTarget
;
173 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::dnd::XDropTargetListener
> mxDropTargetListener
;
174 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
> mxClipboard
;
175 ::com::sun::star::uno::Reference
< ::com::sun::star::datatransfer::clipboard::XClipboard
> mxSelection
;
177 bool mbInternalDragGestureRecognizer
;
180 struct ImplAccessibleInfos
182 sal_uInt16 nAccessibleRole
;
183 OUString
* pAccessibleName
;
184 OUString
* pAccessibleDescription
;
185 Window
* pLabeledByWindow
;
186 Window
* pLabelForWindow
;
187 Window
* pMemberOfWindow
;
189 ImplAccessibleInfos();
190 ~ImplAccessibleInfos();
193 enum AlwaysInputMode
{ AlwaysInputNone
= 0, AlwaysInputEnabled
= 1, AlwaysInputDisabled
=2 };
198 WindowImpl( WindowType
);
201 ImplWinData
* mpWinData
;
202 ImplOverlapData
* mpOverlapData
;
203 ImplFrameData
* mpFrameData
;
206 Window
* mpFrameWindow
;
207 Window
* mpOverlapWindow
;
208 Window
* mpBorderWindow
;
209 Window
* mpClientWindow
;
211 Window
* mpRealParent
;
212 Window
* mpFirstChild
;
214 Window
* mpFirstOverlap
;
215 Window
* mpLastOverlap
;
218 Window
* mpNextOverlap
;
219 Window
* mpLastFocusWindow
;
220 Window
* mpDlgCtrlDownWindow
;
221 VclEventListeners maEventListeners
;
222 VclEventListeners maChildEventListeners
;
224 // The canvas interface for this VCL window. Is persistent after the first GetCanvas() call
225 ::com::sun::star::uno::WeakReference
< ::com::sun::star::rendering::XCanvas
> mxCanvas
;
227 ImplDelData
* mpFirstDel
;
234 Color maControlForeground
;
235 Color maControlBackground
;
236 sal_Int32 mnLeftBorder
;
237 sal_Int32 mnTopBorder
;
238 sal_Int32 mnRightBorder
;
239 sal_Int32 mnBottomBorder
;
240 sal_Int32 mnWidthRequest
;
241 sal_Int32 mnHeightRequest
;
249 OUString maQuickHelpText
;
250 InputContext maInputContext
;
251 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindowPeer
> mxWindowPeer
;
252 ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> mxAccessible
;
253 ::boost::shared_ptr
< VclSizeGroup
> m_xSizeGroup
;
254 ::std::vector
< FixedText
* > m_aMnemonicLabels
;
255 ImplAccessibleInfos
* mpAccessibleInfos
;
256 VCLXWindow
* mpVCLXWindow
;
257 Region maWinRegion
; // region to 'shape' the VCL window (frame coordinates)
258 Region maWinClipRegion
; // the (clipping) region that finally corresponds to the VCL window (frame coordinates)
259 Region maInvalidateRegion
; // region that has to be redrawn (frame coordinates)
260 Region
* mpChildClipRegion
; // child clip region if CLIPCHILDREN is set (frame coordinates)
261 Region
* mpPaintRegion
; // only set during Paint() method call (window coordinates)
264 WinBits mnExtendedStyle
;
265 WinBits mnPrevExtendedStyle
;
267 ControlPart mnNativeBackground
;
268 sal_uInt16 mnWaitCount
;
269 sal_uInt16 mnPaintFlags
;
270 sal_uInt16 mnGetFocusFlags
;
271 sal_uInt16 mnParentClipMode
;
272 sal_uInt16 mnActivateMode
;
273 sal_uInt16 mnDlgCtrlFlags
;
274 sal_uInt16 mnLockCount
;
275 AlwaysInputMode meAlwaysInputMode
;
278 VclPackType mePackType
;
280 sal_Int32 mnGridHeight
;
281 sal_Int32 mnGridLeftAttach
;
282 sal_Int32 mnGridTopAttach
;
283 sal_Int32 mnGridWidth
;
284 sal_Int32 mnBorderWidth
;
285 sal_Int32 mnMarginLeft
;
286 sal_Int32 mnMarginRight
;
287 sal_Int32 mnMarginTop
;
288 sal_Int32 mnMarginBottom
;
309 mbChildPtrOverwrite
:1,
323 mbWaitSystemResize
:1,
324 mbInitWinClipRegion
:1,
329 mbChildTransparent
:1,
330 mbPaintTransparent
:1,
331 mbMouseTransparent
:1,
336 mbNativeFocusVisible
:1,
339 mbControlForeground
:1,
340 mbControlBackground
:1,
343 mbCompoundControlHasFocus
:1,
350 mbCreatedWithToolkit
:1,
353 mbSuppressAccessibilityEvents
:1,
354 mbMenuFloatingWindow
:1,
355 mbDrawSelectionBackground
:1,
356 mbIsInTaskPaneList
:1,
357 mbToolbarFloatingWindow
:1,
358 mbCallHandlersDuringInputDisabled
:1,
368 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> mxDNDListenerContainer
;
373 bool ImplHandleMouseEvent( Window
* pWindow
, sal_uInt16 nSVEvent
, bool bMouseLeave
,
374 long nX
, long nY
, sal_uIntPtr nMsgTime
,
375 sal_uInt16 nCode
, sal_uInt16 nMode
);
376 void ImplHandleResize( Window
* pWindow
, long nNewWidth
, long nNewHeight
);
378 #endif // INCLUDED_VCL_INC_WINDOW_H
380 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */