Update ooo320-m1
[ooovba.git] / dbaccess / source / ui / app / subcomponentmanager.hxx
blob8348fdfb67bfce63dab9ebd3bea045d3ab666d6e
1 /*************************************************************************
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 *
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>
43 #include <memory>
45 //........................................................................
46 namespace dbaui
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
60 public:
61 SubComponentManager( OApplicationController& _rController, const ::comphelper::SharedMutex& _rMutex );
62 virtual ~SubComponentManager();
64 void disposing();
66 // XEventListener
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();
74 // container access
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 >&
80 _rxComponent
82 bool empty() const;
84 /** activates (i.e. brings to top) the frame in which the given component is loaded, if any
86 @return
87 <TRUE/> if any only of such a frame was found, i.e. the component had already been loaded
88 previously
90 bool activateSubFrame(
91 const ::rtl::OUString& _rName,
92 const sal_Int32 _nComponentType,
93 const ElementOpenMode _eOpenMode
94 ) const;
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.
101 @return
102 <TRUE/> if and only if closing those frames was successful, or frames for the given sub component
103 exist.
105 bool closeSubFrames(
106 const ::rtl::OUString& _rName,
107 const sal_Int32 _nComponentType
109 private:
110 ::std::auto_ptr< SubComponentManager_Data > m_pData;
113 //........................................................................
114 } // namespace dbaui
115 //........................................................................
117 #endif // DBACCESS_SUBCOMPONENTMANAGER_HXX