Bump version to 6.0-36
[LibreOffice.git] / UnoControls / inc / basecontainercontrol.hxx
blob55a8f940d7c447f028d28fce811ecb61af9c12aa
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_UNOCONTROLS_INC_BASECONTAINERCONTROL_HXX
21 #define INCLUDED_UNOCONTROLS_INC_BASECONTAINERCONTROL_HXX
23 #include <com/sun/star/lang/XServiceName.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/container/XContainer.hpp>
26 #include <com/sun/star/container/XIndexContainer.hpp>
27 #include <com/sun/star/container/XNameReplace.hpp>
28 #include <com/sun/star/container/XContainerListener.hpp>
29 #include <com/sun/star/container/XSet.hpp>
30 #include <com/sun/star/container/ContainerEvent.hpp>
31 #include <com/sun/star/container/XIndexReplace.hpp>
32 #include <com/sun/star/container/XNameContainer.hpp>
33 #include <vector>
35 #include "basecontrol.hxx"
37 // "namespaces"
39 namespace unocontrols{
41 // structs, types, forwards
43 struct IMPL_ControlInfo
45 css::uno::Reference< css::awt::XControl > xControl;
46 OUString sName;
49 class BaseContainerControl : public css::awt::XControlModel
50 , public css::awt::XControlContainer
51 , public BaseControl
54 public:
56 BaseContainerControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
58 virtual ~BaseContainerControl() override;
60 // XInterface
62 /**_______________________________________________________________________________________________________
63 @short give answer, if interface is supported
64 @descr The interfaces are searched by type.
66 @seealso XInterface
68 @param "rType" is the type of searched interface.
70 @return Any information about found interface
72 @onerror A RuntimeException is thrown.
75 virtual css::uno::Any SAL_CALL queryInterface(
76 const css::uno::Type& aType
77 ) override;
79 // XTypeProvider
81 /**_______________________________________________________________________________________________________
82 @short get information about supported interfaces
83 @seealso XTypeProvider
84 @return Sequence of types of all supported interfaces
86 @onerror A RuntimeException is thrown.
89 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
91 // XAggregation
93 virtual css::uno::Any SAL_CALL queryAggregation(
94 const css::uno::Type& aType
95 ) override;
97 // XControl
99 virtual void SAL_CALL createPeer(
100 const css::uno::Reference< css::awt::XToolkit >& xToolkit ,
101 const css::uno::Reference< css::awt::XWindowPeer >& xParent
102 ) override;
104 virtual sal_Bool SAL_CALL setModel(
105 const css::uno::Reference< css::awt::XControlModel >& xModel
106 ) override;
108 virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getModel() override;
110 // XComponent
112 virtual void SAL_CALL dispose() override;
114 // XEventListener
116 virtual void SAL_CALL disposing( const css::lang::EventObject& rEvent ) override;
118 // XControlContainer
120 virtual void SAL_CALL addControl(
121 const OUString& sName ,
122 const css::uno::Reference< css::awt::XControl >& xControl
123 ) override;
125 virtual void SAL_CALL removeControl(
126 const css::uno::Reference< css::awt::XControl >& xControl
127 ) override;
129 virtual void SAL_CALL setStatusText(
130 const OUString& sStatusText
131 ) override;
133 virtual css::uno::Reference< css::awt::XControl > SAL_CALL getControl(
134 const OUString& sName
135 ) override;
137 virtual css::uno::Sequence< css::uno::Reference< css::awt::XControl > > SAL_CALL getControls() override;
139 // XWindow
141 virtual void SAL_CALL setVisible( sal_Bool bVisible ) override;
143 protected:
144 using OComponentHelper::disposing;
146 virtual css::awt::WindowDescriptor* impl_getWindowDescriptor(
147 const css::uno::Reference< css::awt::XWindowPeer >& xParentPeer
148 ) override;
151 virtual void impl_paint(
152 sal_Int32 nX ,
153 sal_Int32 nY ,
154 const css::uno::Reference< css::awt::XGraphics >& xGraphics
155 ) override;
157 private:
159 void impl_activateTabControllers();
161 void impl_cleanMemory();
163 // list of pointer of "struct IMPL_ControlInfo" to hold child-controls
164 ::std::vector< IMPL_ControlInfo* > maControlInfoList;
166 // list of references of XTabController to hold tab-order in this container
167 css::uno::Sequence< css::uno::Reference< css::awt::XTabController > > m_xTabControllerList;
169 ::cppu::OMultiTypeInterfaceContainerHelper m_aListeners;
171 }; // class BaseContainerControl
173 } // namespace unocontrols
175 #endif // INCLUDED_UNOCONTROLS_INC_BASECONTAINERCONTROL_HXX
177 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */