Gtk-WARNING gtktreestore.c:1047: Invalid column number 1 added to iter
[LibreOffice.git] / dbaccess / source / ui / app / subcomponentmanager.hxx
blob402a3d593b90bd10947c119c3af7c7abb91cd42e
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 #pragma once
22 #include <AppElementType.hxx>
24 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
25 #include <com/sun/star/lang/XComponent.hpp>
27 #include <comphelper/sharedmutex.hxx>
28 #include <cppuhelper/implbase.hxx>
30 #include <memory>
32 namespace dbaui
35 struct SubComponentManager_Data;
36 class OApplicationController;
38 // SubComponentManager
39 typedef ::cppu::WeakImplHelper< css::beans::XPropertyChangeListener
40 > SubComponentManager_Base;
41 class SubComponentManager : public SubComponentManager_Base
43 public:
44 SubComponentManager( OApplicationController& _rController, const ::comphelper::SharedMutex& _rMutex );
45 virtual ~SubComponentManager() override;
47 void disposing();
49 // XPropertyChangeListener
50 virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& evt ) override;
52 // XEventListener
53 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
55 // XDatabaseDocumentUI helpers
56 css::uno::Sequence< css::uno::Reference< css::lang::XComponent> >
57 getSubComponents() const;
58 bool closeSubComponents();
60 // container access
61 void onSubComponentOpened(
62 const OUString& _rName,
63 const sal_Int32 _nComponentType,
64 const ElementOpenMode _eOpenMode,
65 const css::uno::Reference< css::lang::XComponent >&
66 _rxComponent
68 bool empty() const;
70 /** activates (i.e. brings to top) the frame in which the given component is loaded, if any
72 @return
73 <TRUE/> if any only of such a frame was found, i.e. the component had already been loaded
74 previously
76 bool activateSubFrame(
77 const OUString& _rName,
78 const sal_Int32 _nComponentType,
79 const ElementOpenMode _eOpenMode,
80 css::uno::Reference< css::lang::XComponent >& o_rComponent
81 ) const;
83 /** closes all frames of the given component
85 If a view for the component (given by name and type) has been loaded into one or more
86 frames (with potentially different OpenModes), then those frames are gracefully closed.
88 @return
89 <TRUE/> if and only if closing those frames was successful, or frames for the given sub component
90 exist.
92 bool closeSubFrames(
93 std::u16string_view _rName,
94 const sal_Int32 _nComponentType
97 /** searches for the given sub component
99 @param i_rComponent
100 the sub component to look up
101 @param o_rName
102 contains, upon successful return, the name of the sub component
103 @param o_nComponentType
104 contains, upon successful return, the type of the sub component
105 @return
106 <TRUE/> if and only if the component was found
108 bool lookupSubComponent(
109 const css::uno::Reference< css::lang::XComponent >& i_rComponent,
110 OUString& o_rName,
111 sal_Int32& o_rComponentType
114 private:
115 std::unique_ptr< SubComponentManager_Data > m_pData;
118 } // namespace dbaui
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */