Bump version to 5.0-14
[LibreOffice.git] / dbaccess / source / ui / app / subcomponentmanager.hxx
blob76bde5d2438a4fc5b8b68ea18a7db1ea5d1122ef
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_DBACCESS_SOURCE_UI_APP_SUBCOMPONENTMANAGER_HXX
21 #define INCLUDED_DBACCESS_SOURCE_UI_APP_SUBCOMPONENTMANAGER_HXX
23 #include "AppElementType.hxx"
25 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
26 #include <com/sun/star/frame/XController.hpp>
28 #include <comphelper/sharedmutex.hxx>
29 #include <cppuhelper/implbase1.hxx>
31 #include <memory>
33 namespace dbaui
36 struct SubComponentManager_Data;
37 class OApplicationController;
39 // SubComponentManager
40 typedef ::cppu::WeakImplHelper1 < ::com::sun::star::beans::XPropertyChangeListener
41 > SubComponentManager_Base;
42 class SubComponentManager : public SubComponentManager_Base
44 public:
45 SubComponentManager( OApplicationController& _rController, const ::comphelper::SharedMutex& _rMutex );
46 virtual ~SubComponentManager();
48 void disposing();
50 // XPropertyChangeListener
51 virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
53 // XEventListener
54 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
56 // XDatabaseDocumentUI helpers
57 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> >
58 getSubComponents() const;
59 bool closeSubComponents();
61 // container access
62 void onSubComponentOpened(
63 const OUString& _rName,
64 const sal_Int32 _nComponentType,
65 const ElementOpenMode _eOpenMode,
66 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >&
67 _rxComponent
69 bool empty() const;
71 /** activates (i.e. brings to top) the frame in which the given component is loaded, if any
73 @return
74 <TRUE/> if any only of such a frame was found, i.e. the component had already been loaded
75 previously
77 bool activateSubFrame(
78 const OUString& _rName,
79 const sal_Int32 _nComponentType,
80 const ElementOpenMode _eOpenMode,
81 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& o_rComponent
82 ) const;
84 /** closes all frames of the given component
86 If a view for the component (given by name and type) has been loaded into one or more
87 frames (with potentially different OpenModes), then those frames are gracefully closed.
89 @return
90 <TRUE/> if and only if closing those frames was successful, or frames for the given sub component
91 exist.
93 bool closeSubFrames(
94 const OUString& _rName,
95 const sal_Int32 _nComponentType
98 /** searches for the given sub component
100 @param i_rComponent
101 the sub component to look up
102 @param o_rName
103 contains, upon successful return, the name of the sub component
104 @param o_nComponentType
105 contains, upon successful return, the type of the sub component
106 @return
107 <TRUE/> if and only if the component was found
109 bool lookupSubComponent(
110 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& i_rComponent,
111 OUString& o_rName,
112 sal_Int32& o_rComponentType
115 private:
116 ::std::unique_ptr< SubComponentManager_Data > m_pData;
119 } // namespace dbaui
121 #endif // INCLUDED_DBACCESS_SOURCE_UI_APP_SUBCOMPONENTMANAGER_HXX
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */