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 _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_HXX
21 #define _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_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"
37 //____________________________________________________________________________________________________________
39 //____________________________________________________________________________________________________________
41 namespace unocontrols
{
43 //____________________________________________________________________________________________________________
44 // structs, types, forwards
45 //____________________________________________________________________________________________________________
47 struct IMPL_ControlInfo
49 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
> xControl
;
53 class BaseContainerControl
: public ::com::sun::star::awt::XControlModel
54 , public ::com::sun::star::awt::XControlContainer
58 //____________________________________________________________________________________________________________
60 //____________________________________________________________________________________________________________
64 //________________________________________________________________________________________________________
66 //________________________________________________________________________________________________________
68 /**_______________________________________________________________________________________________________
81 BaseContainerControl( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& rxContext
);
83 /**_______________________________________________________________________________________________________
96 virtual ~BaseContainerControl();
98 //________________________________________________________________________________________________________
100 //________________________________________________________________________________________________________
102 /**_______________________________________________________________________________________________________
103 @short give answer, if interface is supported
104 @descr The interfaces are searched by type.
108 @param "rType" is the type of searched interface.
110 @return Any information about found interface
112 @onerror A RuntimeException is thrown.
115 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(
116 const ::com::sun::star::uno::Type
& aType
117 ) throw( ::com::sun::star::uno::RuntimeException
);
119 //________________________________________________________________________________________________________
121 //________________________________________________________________________________________________________
123 /**_______________________________________________________________________________________________________
124 @short get information about supported interfaces
127 @seealso XTypeProvider
131 @return Sequence of types of all supported interfaces
133 @onerror A RuntimeException is thrown.
136 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes()
137 throw( ::com::sun::star::uno::RuntimeException
);
139 //________________________________________________________________________________________________________
141 //________________________________________________________________________________________________________
143 /**_______________________________________________________________________________________________________
156 virtual ::com::sun::star::uno::Any SAL_CALL
queryAggregation(
157 const ::com::sun::star::uno::Type
& aType
158 ) throw( ::com::sun::star::uno::RuntimeException
);
160 //________________________________________________________________________________________________________
162 //________________________________________________________________________________________________________
164 /**_______________________________________________________________________________________________________
177 virtual void SAL_CALL
createPeer(
178 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XToolkit
>& xToolkit
,
179 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindowPeer
>& xParent
180 ) throw( ::com::sun::star::uno::RuntimeException
);
182 /**_______________________________________________________________________________________________________
195 virtual sal_Bool SAL_CALL
setModel(
196 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlModel
>& xModel
197 ) throw( ::com::sun::star::uno::RuntimeException
);
199 /**_______________________________________________________________________________________________________
212 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlModel
> SAL_CALL
getModel()
213 throw( ::com::sun::star::uno::RuntimeException
);
215 //________________________________________________________________________________________________________
217 //________________________________________________________________________________________________________
219 /**_______________________________________________________________________________________________________
232 virtual void SAL_CALL
dispose() throw( ::com::sun::star::uno::RuntimeException
);
234 //________________________________________________________________________________________________________
236 //________________________________________________________________________________________________________
238 /**_______________________________________________________________________________________________________
251 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& rEvent
) throw( ::com::sun::star::uno::RuntimeException
);
253 //________________________________________________________________________________________________________
255 //________________________________________________________________________________________________________
257 /**_______________________________________________________________________________________________________
270 virtual void SAL_CALL
addControl(
271 const OUString
& sName
,
272 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
>& xControl
273 ) throw( ::com::sun::star::uno::RuntimeException
);
275 /**_______________________________________________________________________________________________________
288 virtual void SAL_CALL
addContainerListener(
289 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& xListener
290 ) throw( ::com::sun::star::uno::RuntimeException
);
292 /**_______________________________________________________________________________________________________
305 virtual void SAL_CALL
removeControl(
306 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
>& xControl
307 ) throw( ::com::sun::star::uno::RuntimeException
);
309 /**_______________________________________________________________________________________________________
322 virtual void SAL_CALL
removeContainerListener(
323 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& xListener
324 ) throw( ::com::sun::star::uno::RuntimeException
);
326 /**_______________________________________________________________________________________________________
339 virtual void SAL_CALL
setStatusText(
340 const OUString
& sStatusText
341 ) throw( ::com::sun::star::uno::RuntimeException
);
343 /**_______________________________________________________________________________________________________
356 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
> SAL_CALL
getControl(
357 const OUString
& sName
358 ) throw( ::com::sun::star::uno::RuntimeException
);
360 /**_______________________________________________________________________________________________________
373 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
> > SAL_CALL
getControls()
374 throw( ::com::sun::star::uno::RuntimeException
);
376 //________________________________________________________________________________________________________
377 // XUnoControlContainer
378 //________________________________________________________________________________________________________
380 /**_______________________________________________________________________________________________________
393 virtual void SAL_CALL
addTabController(
394 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XTabController
>& xTabController
395 ) throw( ::com::sun::star::uno::RuntimeException
);
397 /**_______________________________________________________________________________________________________
410 virtual void SAL_CALL
removeTabController(
411 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XTabController
>& xTabController
412 ) throw( ::com::sun::star::uno::RuntimeException
);
414 /**_______________________________________________________________________________________________________
427 virtual void SAL_CALL
setTabControllers(
428 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XTabController
> >& xTabControllers
429 ) throw( ::com::sun::star::uno::RuntimeException
);
431 /**_______________________________________________________________________________________________________
444 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XTabController
> > SAL_CALL
getTabControllers()
445 throw( ::com::sun::star::uno::RuntimeException
);
447 //________________________________________________________________________________________________________
449 //________________________________________________________________________________________________________
451 /**_______________________________________________________________________________________________________
464 virtual void SAL_CALL
setVisible( sal_Bool bVisible
) throw( ::com::sun::star::uno::RuntimeException
);
466 //____________________________________________________________________________________________________________
468 //____________________________________________________________________________________________________________
471 using OComponentHelper::disposing
;
472 /**_______________________________________________________________________________________________________
485 virtual ::com::sun::star::awt::WindowDescriptor
* impl_getWindowDescriptor(
486 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindowPeer
>& xParentPeer
489 /**_______________________________________________________________________________________________________
502 virtual void impl_paint(
505 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XGraphics
>& xGraphics
508 //____________________________________________________________________________________________________________
510 //____________________________________________________________________________________________________________
514 /**_______________________________________________________________________________________________________
527 void impl_activateTabControllers();
529 /**_______________________________________________________________________________________________________
542 void impl_cleanMemory();
544 //____________________________________________________________________________________________________________
546 //____________________________________________________________________________________________________________
549 // list of pointer of "struct IMPL_ControlInfo" to hold child-controls
550 ::std::vector
< IMPL_ControlInfo
* > maControlInfoList
;
552 // list of references of XTabController to hold tab-order in this container
553 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XTabController
> > m_xTabControllerList
;
555 ::cppu::OMultiTypeInterfaceContainerHelper m_aListeners
;
557 }; // class BaseContainerControl
559 } // namespace unocontrols
561 #endif // ifndef _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_HXX
563 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */