1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_HXX
30 #define _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_HXX
32 //____________________________________________________________________________________________________________
33 // includes of other projects
34 //____________________________________________________________________________________________________________
36 #include <com/sun/star/lang/XServiceName.hpp>
37 #include <com/sun/star/lang/XServiceInfo.hpp>
38 #include <com/sun/star/container/XContainer.hpp>
39 #include <com/sun/star/container/XIndexContainer.hpp>
40 #include <com/sun/star/container/XNameReplace.hpp>
41 #include <com/sun/star/container/XContainerListener.hpp>
42 #include <com/sun/star/container/XSet.hpp>
43 #include <com/sun/star/container/ContainerEvent.hpp>
44 #include <com/sun/star/container/XIndexReplace.hpp>
45 #include <com/sun/star/container/XNameContainer.hpp>
48 //____________________________________________________________________________________________________________
49 // includes of my own project
50 //____________________________________________________________________________________________________________
51 #include "basecontrol.hxx"
53 //____________________________________________________________________________________________________________
55 //____________________________________________________________________________________________________________
57 namespace unocontrols
{
59 //____________________________________________________________________________________________________________
60 // structs, types, forwards
61 //____________________________________________________________________________________________________________
63 struct IMPL_ControlInfo
65 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
> xControl
;
66 ::rtl::OUString sName
;
69 //____________________________________________________________________________________________________________
71 //____________________________________________________________________________________________________________
73 class BaseContainerControl
: public ::com::sun::star::awt::XControlModel
74 , public ::com::sun::star::awt::XControlContainer
78 //____________________________________________________________________________________________________________
80 //____________________________________________________________________________________________________________
84 //________________________________________________________________________________________________________
86 //________________________________________________________________________________________________________
88 /**_______________________________________________________________________________________________________
101 BaseContainerControl( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xFactory
);
103 /**_______________________________________________________________________________________________________
116 virtual ~BaseContainerControl();
118 //________________________________________________________________________________________________________
120 //________________________________________________________________________________________________________
122 /**_______________________________________________________________________________________________________
123 @short give answer, if interface is supported
124 @descr The interfaces are searched by type.
128 @param "rType" is the type of searched interface.
130 @return Any information about found interface
132 @onerror A RuntimeException is thrown.
135 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(
136 const ::com::sun::star::uno::Type
& aType
137 ) throw( ::com::sun::star::uno::RuntimeException
);
139 //________________________________________________________________________________________________________
141 //________________________________________________________________________________________________________
143 /**_______________________________________________________________________________________________________
144 @short get information about supported interfaces
147 @seealso XTypeProvider
151 @return Sequence of types of all supported interfaces
153 @onerror A RuntimeException is thrown.
156 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes()
157 throw( ::com::sun::star::uno::RuntimeException
);
159 //________________________________________________________________________________________________________
161 //________________________________________________________________________________________________________
163 /**_______________________________________________________________________________________________________
176 virtual ::com::sun::star::uno::Any SAL_CALL
queryAggregation(
177 const ::com::sun::star::uno::Type
& aType
178 ) throw( ::com::sun::star::uno::RuntimeException
);
180 //________________________________________________________________________________________________________
182 //________________________________________________________________________________________________________
184 /**_______________________________________________________________________________________________________
197 virtual void SAL_CALL
createPeer(
198 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XToolkit
>& xToolkit
,
199 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindowPeer
>& xParent
200 ) throw( ::com::sun::star::uno::RuntimeException
);
202 /**_______________________________________________________________________________________________________
215 virtual sal_Bool SAL_CALL
setModel(
216 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlModel
>& xModel
217 ) throw( ::com::sun::star::uno::RuntimeException
);
219 /**_______________________________________________________________________________________________________
232 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlModel
> SAL_CALL
getModel()
233 throw( ::com::sun::star::uno::RuntimeException
);
235 //________________________________________________________________________________________________________
237 //________________________________________________________________________________________________________
239 /**_______________________________________________________________________________________________________
252 virtual void SAL_CALL
dispose() throw( ::com::sun::star::uno::RuntimeException
);
254 //________________________________________________________________________________________________________
256 //________________________________________________________________________________________________________
258 /**_______________________________________________________________________________________________________
271 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& rEvent
) throw( ::com::sun::star::uno::RuntimeException
);
273 //________________________________________________________________________________________________________
275 //________________________________________________________________________________________________________
277 /**_______________________________________________________________________________________________________
290 virtual void SAL_CALL
addControl(
291 const ::rtl::OUString
& sName
,
292 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
>& xControl
293 ) throw( ::com::sun::star::uno::RuntimeException
);
295 /**_______________________________________________________________________________________________________
308 virtual void SAL_CALL
addContainerListener(
309 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& xListener
310 ) throw( ::com::sun::star::uno::RuntimeException
);
312 /**_______________________________________________________________________________________________________
325 virtual void SAL_CALL
removeControl(
326 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
>& xControl
327 ) throw( ::com::sun::star::uno::RuntimeException
);
329 /**_______________________________________________________________________________________________________
342 virtual void SAL_CALL
removeContainerListener(
343 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& xListener
344 ) throw( ::com::sun::star::uno::RuntimeException
);
346 /**_______________________________________________________________________________________________________
359 virtual void SAL_CALL
setStatusText(
360 const ::rtl::OUString
& sStatusText
361 ) throw( ::com::sun::star::uno::RuntimeException
);
363 /**_______________________________________________________________________________________________________
376 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
> SAL_CALL
getControl(
377 const ::rtl::OUString
& sName
378 ) throw( ::com::sun::star::uno::RuntimeException
);
380 /**_______________________________________________________________________________________________________
393 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControl
> > SAL_CALL
getControls()
394 throw( ::com::sun::star::uno::RuntimeException
);
396 //________________________________________________________________________________________________________
397 // XUnoControlContainer
398 //________________________________________________________________________________________________________
400 /**_______________________________________________________________________________________________________
413 virtual void SAL_CALL
addTabController(
414 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XTabController
>& xTabController
415 ) throw( ::com::sun::star::uno::RuntimeException
);
417 /**_______________________________________________________________________________________________________
430 virtual void SAL_CALL
removeTabController(
431 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XTabController
>& xTabController
432 ) throw( ::com::sun::star::uno::RuntimeException
);
434 /**_______________________________________________________________________________________________________
447 virtual void SAL_CALL
setTabControllers(
448 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XTabController
> >& xTabControllers
449 ) throw( ::com::sun::star::uno::RuntimeException
);
451 /**_______________________________________________________________________________________________________
464 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XTabController
> > SAL_CALL
getTabControllers()
465 throw( ::com::sun::star::uno::RuntimeException
);
467 //________________________________________________________________________________________________________
469 //________________________________________________________________________________________________________
471 /**_______________________________________________________________________________________________________
484 virtual void SAL_CALL
setVisible( sal_Bool bVisible
) throw( ::com::sun::star::uno::RuntimeException
);
486 //____________________________________________________________________________________________________________
488 //____________________________________________________________________________________________________________
491 using OComponentHelper::disposing
;
492 /**_______________________________________________________________________________________________________
505 virtual ::com::sun::star::awt::WindowDescriptor
* impl_getWindowDescriptor(
506 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindowPeer
>& xParentPeer
509 /**_______________________________________________________________________________________________________
522 virtual void impl_paint(
525 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XGraphics
>& xGraphics
528 //____________________________________________________________________________________________________________
530 //____________________________________________________________________________________________________________
534 /**_______________________________________________________________________________________________________
547 void impl_activateTabControllers();
549 /**_______________________________________________________________________________________________________
562 void impl_cleanMemory();
564 //____________________________________________________________________________________________________________
566 //____________________________________________________________________________________________________________
569 // list of pointer of "struct IMPL_ControlInfo" to hold child-controls
570 ::std::vector
< IMPL_ControlInfo
* > maControlInfoList
;
572 // list of references of XTabController to hold tab-order in this container
573 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XTabController
> > m_xTabControllerList
;
575 ::cppu::OMultiTypeInterfaceContainerHelper m_aListeners
;
577 }; // class BaseContainerControl
579 } // namespace unocontrols
581 #endif // ifndef _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_HXX
583 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */