1 /*************************************************************************
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * Copyright 2008 by Sun Microsystems, Inc.
6 * OpenOffice.org - a multi-platform office productivity suite
8 * $RCSfile: subcomponentmanager.hxx,v $
10 * $Revision: 1.1.2.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
28 ************************************************************************/
30 #ifndef DBACCESS_SUBCOMPONENTMANAGER_HXX
31 #define DBACCESS_SUBCOMPONENTMANAGER_HXX
33 #include "AppElementType.hxx"
35 /** === begin UNO includes === **/
36 #include <com/sun/star/lang/XEventListener.hpp>
37 #include <com/sun/star/frame/XController.hpp>
38 /** === end UNO includes === **/
40 #include <comphelper/sharedmutex.hxx>
41 #include <cppuhelper/implbase1.hxx>
45 //........................................................................
48 //........................................................................
50 struct SubComponentManager_Data
;
51 class OApplicationController
;
53 //====================================================================
54 //= SubComponentManager
55 //====================================================================
56 typedef ::cppu::WeakImplHelper1
< ::com::sun::star::lang::XEventListener
57 > SubComponentManager_Base
;
58 class SubComponentManager
: public SubComponentManager_Base
61 SubComponentManager( OApplicationController
& _rController
, const ::comphelper::SharedMutex
& _rMutex
);
62 virtual ~SubComponentManager();
67 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
) throw (::com::sun::star::uno::RuntimeException
);
69 // XDatabaseDocumentUI helpers
70 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
> >
71 getSubComponents() const;
72 sal_Bool
closeSubComponents();
75 void onSubComponentOpened(
76 const ::rtl::OUString
& _rName
,
77 const sal_Int32 _nComponentType
,
78 const ElementOpenMode _eOpenMode
,
79 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>&
84 /** activates (i.e. brings to top) the frame in which the given component is loaded, if any
87 <TRUE/> if any only of such a frame was found, i.e. the component had already been loaded
90 bool activateSubFrame(
91 const ::rtl::OUString
& _rName
,
92 const sal_Int32 _nComponentType
,
93 const ElementOpenMode _eOpenMode
96 /** closes all frames of the given component
98 If a view for the component (given by name and type) has been loaded into one or more
99 frames (with potentially different OpenModes), then those frames are gracefully closed.
102 <TRUE/> if and only if closing those frames was successful, or frames for the given sub component
106 const ::rtl::OUString
& _rName
,
107 const sal_Int32 _nComponentType
110 ::std::auto_ptr
< SubComponentManager_Data
> m_pData
;
113 //........................................................................
115 //........................................................................
117 #endif // DBACCESS_SUBCOMPONENTMANAGER_HXX