1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
35 #include "basecontrol.hxx"
39 namespace unocontrols
{
41 // structs, types, forwards
43 struct IMPL_ControlInfo
45 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
> xControl
;
49 class BaseContainerControl
: public ::com::sun::star::awt::XControlModel
50 , public ::com::sun::star::awt::XControlContainer
60 /**_______________________________________________________________________________________________________
63 BaseContainerControl( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& rxContext
);
65 /**_______________________________________________________________________________________________________
68 virtual ~BaseContainerControl();
72 /**_______________________________________________________________________________________________________
73 @short give answer, if interface is supported
74 @descr The interfaces are searched by type.
78 @param "rType" is the type of searched interface.
80 @return Any information about found interface
82 @onerror A RuntimeException is thrown.
85 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(
86 const ::com::sun::star::uno::Type
& aType
87 ) throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 /**_______________________________________________________________________________________________________
92 @short get information about supported interfaces
93 @seealso XTypeProvider
94 @return Sequence of types of all supported interfaces
96 @onerror A RuntimeException is thrown.
99 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes()
100 throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
104 /**_______________________________________________________________________________________________________
107 virtual ::com::sun::star::uno::Any SAL_CALL
queryAggregation(
108 const ::com::sun::star::uno::Type
& aType
109 ) throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
113 /**_______________________________________________________________________________________________________
116 virtual void SAL_CALL
createPeer(
117 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XToolkit
>& xToolkit
,
118 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindowPeer
>& xParent
119 ) throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
121 /**_______________________________________________________________________________________________________
124 virtual sal_Bool SAL_CALL
setModel(
125 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlModel
>& xModel
126 ) throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
128 /**_______________________________________________________________________________________________________
131 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlModel
> SAL_CALL
getModel()
132 throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
136 /**_______________________________________________________________________________________________________
139 virtual void SAL_CALL
dispose() throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
143 /**_______________________________________________________________________________________________________
146 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& rEvent
) throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
150 /**_______________________________________________________________________________________________________
153 virtual void SAL_CALL
addControl(
154 const OUString
& sName
,
155 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
>& xControl
156 ) throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
158 /**_______________________________________________________________________________________________________
161 virtual void SAL_CALL
removeControl(
162 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
>& xControl
163 ) throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
165 /**_______________________________________________________________________________________________________
168 virtual void SAL_CALL
setStatusText(
169 const OUString
& sStatusText
170 ) throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
172 /**_______________________________________________________________________________________________________
175 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
> SAL_CALL
getControl(
176 const OUString
& sName
177 ) throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
179 /**_______________________________________________________________________________________________________
182 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
> > SAL_CALL
getControls()
183 throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
187 /**_______________________________________________________________________________________________________
190 virtual void SAL_CALL
setVisible( sal_Bool bVisible
) throw( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
195 using OComponentHelper::disposing
;
196 /**_______________________________________________________________________________________________________
209 virtual ::com::sun::star::awt::WindowDescriptor
* impl_getWindowDescriptor(
210 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindowPeer
>& xParentPeer
213 /**_______________________________________________________________________________________________________
226 virtual void impl_paint(
229 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XGraphics
>& xGraphics
236 /**_______________________________________________________________________________________________________
249 void impl_activateTabControllers();
251 /**_______________________________________________________________________________________________________
264 void impl_cleanMemory();
269 // list of pointer of "struct IMPL_ControlInfo" to hold child-controls
270 ::std::vector
< IMPL_ControlInfo
* > maControlInfoList
;
272 // list of references of XTabController to hold tab-order in this container
273 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XTabController
> > m_xTabControllerList
;
275 ::cppu::OMultiTypeInterfaceContainerHelper m_aListeners
;
277 }; // class BaseContainerControl
279 } // namespace unocontrols
281 #endif // INCLUDED_UNOCONTROLS_INC_BASECONTAINERCONTROL_HXX
283 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */