Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / dbaccess / source / ui / app / subcomponentmanager.hxx
blobc66732528471094e657cc164e20ae5fd5f53b396
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef DBACCESS_SUBCOMPONENTMANAGER_HXX
29 #define DBACCESS_SUBCOMPONENTMANAGER_HXX
31 #include "AppElementType.hxx"
33 /** === begin UNO includes === **/
34 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
35 #include <com/sun/star/frame/XController.hpp>
36 /** === end UNO includes === **/
38 #include <comphelper/sharedmutex.hxx>
39 #include <cppuhelper/implbase1.hxx>
41 #include <memory>
43 //........................................................................
44 namespace dbaui
46 //........................................................................
48 struct SubComponentManager_Data;
49 class OApplicationController;
51 //====================================================================
52 //= SubComponentManager
53 //====================================================================
54 typedef ::cppu::WeakImplHelper1 < ::com::sun::star::beans::XPropertyChangeListener
55 > SubComponentManager_Base;
56 class SubComponentManager : public SubComponentManager_Base
58 public:
59 SubComponentManager( OApplicationController& _rController, const ::comphelper::SharedMutex& _rMutex );
60 virtual ~SubComponentManager();
62 void disposing();
64 // XPropertyChangeListener
65 virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException);
67 // XEventListener
68 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
70 // XDatabaseDocumentUI helpers
71 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> >
72 getSubComponents() const;
73 sal_Bool closeSubComponents();
75 // container access
76 void onSubComponentOpened(
77 const ::rtl::OUString& _rName,
78 const sal_Int32 _nComponentType,
79 const ElementOpenMode _eOpenMode,
80 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >&
81 _rxComponent
83 bool empty() const;
85 /** activates (i.e. brings to top) the frame in which the given component is loaded, if any
87 @return
88 <TRUE/> if any only of such a frame was found, i.e. the component had already been loaded
89 previously
91 bool activateSubFrame(
92 const ::rtl::OUString& _rName,
93 const sal_Int32 _nComponentType,
94 const ElementOpenMode _eOpenMode,
95 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& o_rComponent
96 ) const;
98 /** closes all frames of the given component
100 If a view for the component (given by name and type) has been loaded into one or more
101 frames (with potentially different OpenModes), then those frames are gracefully closed.
103 @return
104 <TRUE/> if and only if closing those frames was successful, or frames for the given sub component
105 exist.
107 bool closeSubFrames(
108 const ::rtl::OUString& _rName,
109 const sal_Int32 _nComponentType
112 /** searches for the given sub component
114 @param i_rComponent
115 the sub component to look up
116 @param o_rName
117 contains, upon successful return, the name of the sub component
118 @param o_nComponentType
119 contains, upon successful return, the type of the sub component
120 @return
121 <TRUE/> if and only if the component was found
123 bool lookupSubComponent(
124 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& i_rComponent,
125 ::rtl::OUString& o_rName,
126 sal_Int32& o_rComponentType
129 private:
130 ::std::auto_ptr< SubComponentManager_Data > m_pData;
133 //........................................................................
134 } // namespace dbaui
135 //........................................................................
137 #endif // DBACCESS_SUBCOMPONENTMANAGER_HXX
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */