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 __FRAMEWORK_SERVICES_FRAME_HXX_
21 : #define __FRAMEWORK_SERVICES_FRAME_HXX_
22 :
23 : #include <classes/framecontainer.hxx>
24 : #include <classes/propertysethelper.hxx>
25 : #include <threadhelp/resetableguard.hxx>
26 : #include <threadhelp/writeguard.hxx>
27 : #include <threadhelp/readguard.hxx>
28 : #include <threadhelp/threadhelpbase.hxx>
29 :
30 : #include <threadhelp/transactionbase.hxx>
31 : #include <macros/generic.hxx>
32 : #include <macros/debug.hxx>
33 : #include <macros/xinterface.hxx>
34 : #include <macros/xtypeprovider.hxx>
35 : #include <macros/xserviceinfo.hxx>
36 : #include <general.h>
37 :
38 : #include <com/sun/star/awt/XTopWindowListener.hpp>
39 : #include <com/sun/star/awt/XWindow.hpp>
40 : #include <com/sun/star/awt/XTopWindow.hpp>
41 : #include <com/sun/star/awt/XWindowListener.hpp>
42 : #include <com/sun/star/awt/XFocusListener.hpp>
43 : #include <com/sun/star/awt/FocusEvent.hpp>
44 : #include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
45 : #include <com/sun/star/document/XActionLockable.hpp>
46 : #include <com/sun/star/lang/XEventListener.hpp>
47 : #include <com/sun/star/frame/XComponentLoader.hpp>
48 : #include <com/sun/star/frame/XController.hpp>
49 : #include <com/sun/star/frame/XDispatch.hpp>
50 : #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
51 : #include <com/sun/star/frame/XFrame2.hpp>
52 : #include <com/sun/star/frame/XFrameActionListener.hpp>
53 : #include <com/sun/star/frame/XLayoutManager2.hpp>
54 : #include <com/sun/star/frame/XTitle.hpp>
55 : #include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
56 : #include <com/sun/star/task/XStatusIndicator.hpp>
57 : #include <com/sun/star/util/XCloseable.hpp>
58 :
59 : #include <unotools/cmdoptions.hxx>
60 : #include <cppuhelper/interfacecontainer.hxx>
61 : #include <cppuhelper/weak.hxx>
62 : #include <rtl/string.hxx>
63 :
64 : namespace framework{
65 :
66 : // This enum can be used to set different active states of frames
67 : enum EActiveState
68 : {
69 : E_INACTIVE , // I'am not a member of active path in tree and i don't have the focus.
70 : E_ACTIVE , // I'am in the middle of an active path in tree and i don't have the focus.
71 : E_FOCUS // I have the focus now. I must a member of an active path!
72 : };
73 :
74 : class WindowCommandDispatch;
75 :
76 : /*-************************************************************************************************************//**
77 : @short implements a normal frame of hierarchy
78 : @descr An instance of these class can be a normal node in frame tree. A frame support influencing of his
79 : subtree, find of subframes, activate- and deactivate-mechanism as well as
80 : set/get of a frame window, component or controller.
81 :
82 : @attention This implementation supports three states: a)uninitialized, b)working, c)disposed
83 : If you call wrong methods in modes a) or c) ... you will get some exceptions.
84 : How you should work with this service:
85 : i) create it by using "xServiceManager->createInstance(...)"
86 : ii) call XInitialization::initialize() with a valid window reference or use createInstanceWithArguments() at i)
87 : iii) works with object
88 : iv) dispose object by calling XComponent::dispose()
89 : After iv) all further requests are rejected by exceptions! (DisposedException)
90 :
91 : @base ThreadHelpBase
92 : help to guarantee correct initialized lock member at startup
93 : @base TransactionBase
94 : help to implement unbreakable interface calls
95 : @base OBroadcastHelper
96 : OPropertySetHelper
97 : implements the property set
98 : @base OWeakObject
99 : provides the refcount and XInterface, XWeak
100 :
101 : @devstatus ready to use
102 : @threadsafe yes
103 : *//*-*************************************************************************************************************/
104 : class Frame : // interfaces
105 : public css::lang::XTypeProvider ,
106 : public css::lang::XServiceInfo ,
107 : public css::frame::XFrame2 ,
108 : public css::awt::XWindowListener , // => XEventListener
109 : public css::awt::XTopWindowListener ,
110 : public css::awt::XFocusListener ,
111 : public css::document::XActionLockable ,
112 : public css::util::XCloseable , // => XCloseBroadcaster
113 : public css::frame::XComponentLoader ,
114 : public css::frame::XTitle ,
115 : public css::frame::XTitleChangeBroadcaster ,
116 : // base classes
117 : // Order is necessary for right initialization of this class!
118 : public ThreadHelpBase ,
119 : public TransactionBase ,
120 : public PropertySetHelper , // helper implements ThreadHelpbase, TransactionBase, XPropertySet, XPropertySetInfo
121 : public ::cppu::OWeakObject // helper implements XInterface, XWeak
122 : {
123 : //-------------------------------------------------------------------------------------------------------------
124 : // public methods
125 : //-------------------------------------------------------------------------------------------------------------
126 :
127 : public:
128 :
129 : //---------------------------------------------------------------------------------------------------------
130 : // constructor / destructor
131 : //---------------------------------------------------------------------------------------------------------
132 : Frame( const css::uno::Reference< css::uno::XComponentContext >& xContext );
133 : virtual ~Frame( );
134 :
135 : //---------------------------------------------------------------------------------------------------------
136 : // XInterface, XTypeProvider, XServiceInfo
137 : //---------------------------------------------------------------------------------------------------------
138 : FWK_DECLARE_XINTERFACE
139 : FWK_DECLARE_XTYPEPROVIDER
140 : DECLARE_XSERVICEINFO
141 :
142 : //---------------------------------------------------------------------------------------------------------
143 : // XComponentLoader
144 : //---------------------------------------------------------------------------------------------------------
145 : virtual css::uno::Reference< css::lang::XComponent > SAL_CALL loadComponentFromURL ( const OUString& sURL ,
146 : const OUString& sTargetFrameName ,
147 : sal_Int32 nSearchFlags ,
148 : const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::io::IOException ,
149 : css::lang::IllegalArgumentException ,
150 : css::uno::RuntimeException );
151 :
152 :
153 : //---------------------------------------------------------------------------------------------------------
154 : // XFramesSupplier
155 : //---------------------------------------------------------------------------------------------------------
156 : virtual css::uno::Reference< css::frame::XFrames > SAL_CALL getFrames ( ) throw( css::uno::RuntimeException );
157 : virtual css::uno::Reference< css::frame::XFrame > SAL_CALL getActiveFrame ( ) throw( css::uno::RuntimeException );
158 : virtual void SAL_CALL setActiveFrame ( const css::uno::Reference< css::frame::XFrame >& xFrame ) throw( css::uno::RuntimeException );
159 :
160 : //---------------------------------------------------------------------------------------------------------
161 : // XFrame
162 : //---------------------------------------------------------------------------------------------------------
163 : virtual void SAL_CALL initialize ( const css::uno::Reference< css::awt::XWindow >& xWindow ) throw( css::uno::RuntimeException );
164 : virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getContainerWindow ( ) throw( css::uno::RuntimeException );
165 : virtual void SAL_CALL setCreator ( const css::uno::Reference< css::frame::XFramesSupplier >& xCreator ) throw( css::uno::RuntimeException );
166 : virtual css::uno::Reference< css::frame::XFramesSupplier > SAL_CALL getCreator ( ) throw( css::uno::RuntimeException );
167 : virtual OUString SAL_CALL getName ( ) throw( css::uno::RuntimeException );
168 : virtual void SAL_CALL setName ( const OUString& sName ) throw( css::uno::RuntimeException );
169 : virtual css::uno::Reference< css::frame::XFrame > SAL_CALL findFrame ( const OUString& sTargetFrameName ,
170 : sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException );
171 : virtual sal_Bool SAL_CALL isTop ( ) throw( css::uno::RuntimeException );
172 : virtual void SAL_CALL activate ( ) throw( css::uno::RuntimeException );
173 : virtual void SAL_CALL deactivate ( ) throw( css::uno::RuntimeException );
174 : virtual sal_Bool SAL_CALL isActive ( ) throw( css::uno::RuntimeException );
175 : virtual void SAL_CALL contextChanged ( ) throw( css::uno::RuntimeException );
176 : virtual sal_Bool SAL_CALL setComponent ( const css::uno::Reference< css::awt::XWindow >& xComponentWindow ,
177 : const css::uno::Reference< css::frame::XController >& xController ) throw( css::uno::RuntimeException );
178 : virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getComponentWindow ( ) throw( css::uno::RuntimeException );
179 : virtual css::uno::Reference< css::frame::XController > SAL_CALL getController ( ) throw( css::uno::RuntimeException );
180 : virtual void SAL_CALL addFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException );
181 : virtual void SAL_CALL removeFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException );
182 :
183 : //---------------------------------------------------------------------------------------------------------
184 : // XComponent
185 : //---------------------------------------------------------------------------------------------------------
186 : virtual void SAL_CALL dispose ( ) throw( css::uno::RuntimeException );
187 : virtual void SAL_CALL addEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException );
188 : virtual void SAL_CALL removeEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException );
189 :
190 : //---------------------------------------------------------------------------------------------------------
191 : // XStatusIndicatorFactory
192 : //---------------------------------------------------------------------------------------------------------
193 : virtual css::uno::Reference< css::task::XStatusIndicator > SAL_CALL createStatusIndicator ( ) throw( css::uno::RuntimeException );
194 :
195 : //---------------------------------------------------------------------------------------------------------
196 : // XDispatchProvider
197 : //---------------------------------------------------------------------------------------------------------
198 : virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch ( const css::util::URL& aURL ,
199 : const OUString& sTargetFrameName ,
200 : sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException );
201 : virtual css::uno::Sequence<
202 : css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches ( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptor ) throw( css::uno::RuntimeException );
203 :
204 : //---------------------------------------------------------------------------------------------------------
205 : // XDispatchProviderInterception
206 : //---------------------------------------------------------------------------------------------------------
207 : virtual void SAL_CALL registerDispatchProviderInterceptor( const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& xInterceptor ) throw( css::uno::RuntimeException );
208 : virtual void SAL_CALL releaseDispatchProviderInterceptor ( const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& xInterceptor ) throw( css::uno::RuntimeException );
209 :
210 : //---------------------------------------------------------------------------------------------------------
211 : // XDispatchInformationProvider
212 : //---------------------------------------------------------------------------------------------------------
213 : virtual css::uno::Sequence< sal_Int16 > SAL_CALL getSupportedCommandGroups ( ) throw (css::uno::RuntimeException);
214 : virtual css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation(sal_Int16 nCommandGroup) throw (css::uno::RuntimeException);
215 :
216 : //---------------------------------------------------------------------------------------------------------
217 : // XWindowListener
218 : // Attention: windowResized() and windowShown() are implement only! All other are empty!
219 : //---------------------------------------------------------------------------------------------------------
220 : virtual void SAL_CALL windowResized ( const css::awt::WindowEvent& aEvent ) throw( css::uno::RuntimeException );
221 2188 : virtual void SAL_CALL windowMoved ( const css::awt::WindowEvent& /*aEvent*/ ) throw( css::uno::RuntimeException ) {};
222 : virtual void SAL_CALL windowShown ( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
223 : virtual void SAL_CALL windowHidden ( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
224 :
225 : //---------------------------------------------------------------------------------------------------------
226 : // XFocusListener
227 : // Attention: focusLost() not implemented yet!
228 : //---------------------------------------------------------------------------------------------------------
229 : virtual void SAL_CALL focusGained ( const css::awt::FocusEvent& aEvent ) throw( css::uno::RuntimeException );
230 647 : virtual void SAL_CALL focusLost ( const css::awt::FocusEvent& /*aEvent*/ ) throw( css::uno::RuntimeException ) {};
231 :
232 : //---------------------------------------------------------------------------------------------------------
233 : // XTopWindowListener
234 : // Attention: windowActivated(), windowDeactivated() and windowClosing() are implement only! All other are empty!
235 : //---------------------------------------------------------------------------------------------------------
236 : virtual void SAL_CALL windowActivated ( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
237 : virtual void SAL_CALL windowDeactivated ( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
238 2162 : virtual void SAL_CALL windowOpened ( const css::lang::EventObject& /*aEvent*/ ) throw( css::uno::RuntimeException ) {};
239 : virtual void SAL_CALL windowClosing ( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
240 5 : virtual void SAL_CALL windowClosed ( const css::lang::EventObject& /*aEvent*/ ) throw( css::uno::RuntimeException ) {};
241 2 : virtual void SAL_CALL windowMinimized ( const css::lang::EventObject& /*aEvent*/ ) throw( css::uno::RuntimeException ) {};
242 2 : virtual void SAL_CALL windowNormalized ( const css::lang::EventObject& /*aEvent*/ ) throw( css::uno::RuntimeException ) {};
243 :
244 : //---------------------------------------------------------------------------------------------------------
245 : // XEventListener
246 : //---------------------------------------------------------------------------------------------------------
247 : virtual void SAL_CALL disposing ( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
248 :
249 : //---------------------------------------------------------------------------------------------------------
250 : // XActionLockable
251 : //---------------------------------------------------------------------------------------------------------
252 : virtual sal_Bool SAL_CALL isActionLocked ( ) throw( css::uno::RuntimeException );
253 : virtual void SAL_CALL addActionLock ( ) throw( css::uno::RuntimeException );
254 : virtual void SAL_CALL removeActionLock( ) throw( css::uno::RuntimeException );
255 : virtual void SAL_CALL setActionLocks ( sal_Int16 nLock ) throw( css::uno::RuntimeException );
256 : virtual sal_Int16 SAL_CALL resetActionLocks( ) throw( css::uno::RuntimeException );
257 :
258 : //---------------------------------------------------------------------------------------------------------
259 : // XCloseable
260 : //---------------------------------------------------------------------------------------------------------
261 : virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) throw( css::util::CloseVetoException,
262 : css::uno::RuntimeException );
263 :
264 : //---------------------------------------------------------------------------------------------------------
265 : // XCloseBroadcaster
266 : //---------------------------------------------------------------------------------------------------------
267 : virtual void SAL_CALL addCloseListener ( const css::uno::Reference< css::util::XCloseListener >& xListener ) throw (css::uno::RuntimeException);
268 : virtual void SAL_CALL removeCloseListener( const css::uno::Reference< css::util::XCloseListener >& xListener ) throw (css::uno::RuntimeException);
269 :
270 : //---------------------------------------------------------------------------------------------------------
271 : // XTitle
272 : //---------------------------------------------------------------------------------------------------------
273 : virtual OUString SAL_CALL getTitle( ) throw (css::uno::RuntimeException);
274 : virtual void SAL_CALL setTitle( const OUString& sTitle ) throw (css::uno::RuntimeException);
275 :
276 : //---------------------------------------------------------------------------------------------------------
277 : // XTitleChangeBroadcaster
278 : //---------------------------------------------------------------------------------------------------------
279 : virtual void SAL_CALL addTitleChangeListener ( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener) throw (css::uno::RuntimeException);
280 : virtual void SAL_CALL removeTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListenr ) throw (css::uno::RuntimeException);
281 :
282 :
283 : //---------------------------------------------------------------------------------------------------------
284 : // XFrame2 attributes
285 : //---------------------------------------------------------------------------------------------------------
286 : virtual css::uno::Reference<css::container::XNameContainer> SAL_CALL getUserDefinedAttributes() throw (css::uno::RuntimeException);
287 :
288 : virtual css::uno::Reference<css::frame::XDispatchRecorderSupplier> SAL_CALL getDispatchRecorderSupplier() throw (css::uno::RuntimeException);
289 : virtual void SAL_CALL setDispatchRecorderSupplier(const css::uno::Reference<css::frame::XDispatchRecorderSupplier>&) throw (css::uno::RuntimeException);
290 :
291 : virtual css::uno::Reference<css::uno::XInterface> SAL_CALL getLayoutManager() throw (css::uno::RuntimeException);
292 : virtual void SAL_CALL setLayoutManager(const css::uno::Reference<css::uno::XInterface>&) throw (css::uno::RuntimeException);
293 :
294 :
295 : //---------------------------------------------------------------------------------------------------------
296 : // PropertySetHelper => XPropertySet, XPropertySetInfo
297 : //---------------------------------------------------------------------------------------------------------
298 : private:
299 :
300 : void impl_initializePropInfo();
301 :
302 : virtual void SAL_CALL impl_setPropertyValue(const OUString& sProperty,
303 : sal_Int32 nHandle ,
304 : const css::uno::Any& aValue );
305 :
306 : virtual css::uno::Any SAL_CALL impl_getPropertyValue(const OUString& sProperty,
307 : sal_Int32 nHandle );
308 :
309 : //-------------------------------------------------------------------------------------------------------------
310 : // private methods
311 : //-------------------------------------------------------------------------------------------------------------
312 :
313 : private:
314 :
315 : /*-****************************************************************************************************//**
316 : @short helper methods
317 : @descr Follow methods are needed at different points of our code (more then ones!).
318 :
319 : @attention Threadsafe methods are signed by "implts_..."!
320 : *//*-*****************************************************************************************************/
321 :
322 : // threadsafe
323 : void implts_sendFrameActionEvent ( const css::frame::FrameAction& aAction );
324 : void implts_resizeComponentWindow ( );
325 : void implts_setIconOnWindow ( );
326 : void implts_startWindowListening ( );
327 : void implts_stopWindowListening ( );
328 : void implts_saveWindowAttributes ( );
329 : void implts_checkSuicide ( );
330 : void implts_forgetSubFrames ( );
331 : DECL_LINK( implts_windowClosing, void* );
332 : css::uno::Reference< css::awt::XTopWindow > impl_searchTopWindow ( const css::uno::Reference< css::awt::XWindow >& xWindow );
333 :
334 : // non threadsafe
335 : void impl_checkMenuCloser ( );
336 : void impl_setCloser ( const css::uno::Reference< css::frame::XFrame2 >& xFrame ,
337 : sal_Bool bState );
338 : void impl_disposeContainerWindow ( css::uno::Reference< css::awt::XWindow >& xWindow );
339 : static const css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor( );
340 :
341 : //-------------------------------------------------------------------------------------------------------------
342 : // debug methods
343 : // (should be private everyway!)
344 : //-------------------------------------------------------------------------------------------------------------
345 :
346 : /*-****************************************************************************************************//**
347 : @short debug-method to check incoming parameter of some other mehods of this class
348 : @descr The following methods are used to check parameters for other methods
349 : of this class. The return value is used directly for an ASSERT(...).
350 :
351 : @attention This methods are static and can't use our member directly! It's better for threadsafe code...
352 : because we call it with references or pointer to check variables ... and must make it safe
353 : by himself!
354 :
355 : @seealso ASSERTs in implementation!
356 :
357 : @param references to checking variables
358 : @return sal_True ,on invalid parameter
359 : @return sal_False ,otherwise
360 :
361 : @onerror We return sal_True
362 : *//*-*****************************************************************************************************/
363 :
364 : #ifdef ENABLE_ASSERTIONS
365 :
366 : private:
367 :
368 : static sal_Bool implcp_ctor ( const css::uno::Reference< css::uno::XComponentContext >& xContext );
369 : static sal_Bool implcp_setActiveFrame ( const css::uno::Reference< css::frame::XFrame >& xFrame );
370 : static sal_Bool implcp_addFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener );
371 : static sal_Bool implcp_removeFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener );
372 : static sal_Bool implcp_addEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener );
373 : static sal_Bool implcp_removeEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener );
374 : static sal_Bool implcp_windowResized ( const css::awt::WindowEvent& aEvent );
375 : static sal_Bool implcp_focusGained ( const css::awt::FocusEvent& aEvent );
376 : static sal_Bool implcp_windowActivated ( const css::lang::EventObject& aEvent );
377 : static sal_Bool implcp_windowDeactivated ( const css::lang::EventObject& aEvent );
378 : static sal_Bool implcp_disposing ( const css::lang::EventObject& aEvent );
379 :
380 : #endif // #ifdef ENABLE_ASSERTIONS
381 :
382 : //*************************************************************************************************************
383 : // variables
384 : // -threadsafe by own read/write lock "m_aLock"
385 : //*************************************************************************************************************
386 : private:
387 :
388 : css::uno::Reference< css::uno::XComponentContext > m_xContext ; /// reference to factory, which has create this instance
389 : css::uno::Reference< css::task::XStatusIndicatorFactory > m_xIndicatorFactoryHelper ; /// reference to factory helper to create status indicator objects
390 : css::uno::WeakReference< css::task::XStatusIndicator > m_xIndicatorInterception ; /// points to an external set progress, which should be used instead of the internal one.
391 : css::uno::Reference< css::frame::XDispatchProvider > m_xDispatchHelper ; /// helper for XDispatch/Provider and interception interfaces
392 : css::uno::Reference< css::frame::XFrames > m_xFramesHelper ; /// helper for XFrames, XIndexAccess and XElementAccess interfaces
393 : ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer ; /// container for ALL Listener
394 : css::uno::Reference< css::frame::XFramesSupplier > m_xParent ; /// parent of this frame
395 : css::uno::Reference< css::awt::XWindow > m_xContainerWindow ; /// containerwindow of this frame for embedded components
396 : css::uno::Reference< css::awt::XWindow > m_xComponentWindow ; /// window of the actual component
397 : css::uno::Reference< css::frame::XController > m_xController ; /// controller of the actual frame
398 : css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > m_xDropTargetListener ; /// listen to drag & drop
399 : EActiveState m_eActiveState ; /// state, if i'am a member of active path in tree or i have the focus or ...
400 : OUString m_sName ; /// name of this frame
401 : sal_Bool m_bIsFrameTop ; /// frame has no parent or the parent is a taskor the desktop
402 : sal_Bool m_bConnected ; /// due to FrameActionEvent
403 : sal_Int16 m_nExternalLockCount ;
404 : css::uno::Reference< css::frame::XDispatchRecorderSupplier > m_xDispatchRecorderSupplier ; /// is used for dispatch recording and will be set/get from outside. Frame provide it only!
405 : SvtCommandOptions m_aCommandOptions ; /// ref counted class to support disabling commands defined by configuration file
406 : sal_Bool m_bSelfClose ; /// in case of CloseVetoException on method close() wqs thrown by ourself - we must close ourself later if no internal processes are running
407 : sal_Bool m_bIsHidden ; /// indicates, if this frame is used in hidden mode or not
408 : static css::uno::WeakReference< css::frame::XFrame2 > m_xCloserFrame ; /// holds the only frame, which must show the special closer menu item (can be NULL!)
409 : css::uno::Reference< ::css::frame::XLayoutManager2 > m_xLayoutManager ; /// is used to layout the child windows of the frame.
410 : css::uno::Reference< css::frame::XDispatchInformationProvider > m_xDispatchInfoHelper ;
411 : css::uno::Reference< css::frame::XTitle > m_xTitleHelper ;
412 :
413 : WindowCommandDispatch* m_pWindowCommandDispatch ;
414 :
415 : protected:
416 :
417 : FrameContainer m_aChildFrameContainer ; /// array of child frames
418 :
419 : inline css::uno::Reference< css::uno::XComponentContext > impl_getComponentContext()
420 : {
421 : ReadGuard aReadLock( m_aLock );
422 : return m_xContext;
423 : }
424 :
425 : inline OUString impl_getName()
426 : {
427 : ReadGuard aReadLock( m_aLock );
428 : return m_sName;
429 : }
430 :
431 : inline css::uno::Reference< css::awt::XWindow > impl_getContainerWindow()
432 : {
433 : ReadGuard aReadLock( m_aLock );
434 : return m_xContainerWindow;
435 : }
436 :
437 : inline css::uno::Reference< css::frame::XDispatchProvider > impl_getDispatchHelper()
438 : {
439 : ReadGuard aReadLock( m_aLock );
440 : return m_xDispatchHelper;
441 : }
442 :
443 : inline css::uno::Reference< css::frame::XFramesSupplier > impl_getParent()
444 : {
445 : ReadGuard aReadLock( m_aLock );
446 : return m_xParent;
447 : }
448 :
449 : }; // class Frame
450 :
451 : } // namespace framework
452 :
453 : #endif // #ifndef __FRAMEWORK_SERVICES_FRAME_HXX_
454 :
455 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|