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