Update ooo320-m1
[ooovba.git] / UnoControls / inc / basecontainercontrol.hxx
blobb14e94f86cec7fe7501006bb558bd272887ce608
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: basecontainercontrol.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_HXX
32 #define _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_HXX
34 //____________________________________________________________________________________________________________
35 // includes of other projects
36 //____________________________________________________________________________________________________________
38 #include <com/sun/star/lang/XServiceName.hpp>
39 #include <com/sun/star/lang/XServiceInfo.hpp>
40 #include <com/sun/star/container/XContainer.hpp>
41 #include <com/sun/star/container/XIndexContainer.hpp>
42 #include <com/sun/star/container/XNameReplace.hpp>
43 #include <com/sun/star/container/XContainerListener.hpp>
44 #include <com/sun/star/container/XSet.hpp>
45 #include <com/sun/star/container/ContainerEvent.hpp>
46 #include <com/sun/star/container/XIndexReplace.hpp>
47 #include <com/sun/star/container/XNameContainer.hpp>
48 #include <tools/list.hxx>
50 //____________________________________________________________________________________________________________
51 // includes of my own project
52 //____________________________________________________________________________________________________________
53 #include "basecontrol.hxx"
55 //____________________________________________________________________________________________________________
56 // "namespaces"
57 //____________________________________________________________________________________________________________
59 namespace unocontrols{
61 #define UNO3_REFERENCE ::com::sun::star::uno::Reference
62 #define UNO3_XCONTROL ::com::sun::star::awt::XControl
63 #define UNO3_OUSTRING ::rtl::OUString
64 #define UNO3_XCONTROLMODEL ::com::sun::star::awt::XControlModel
65 #define UNO3_XCONTROLCONTAINER ::com::sun::star::awt::XControlContainer
66 #define UNO3_XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory
67 #define UNO3_TYPE ::com::sun::star::uno::Type
68 #define UNO3_RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException
69 #define UNO3_XTOOLKIT ::com::sun::star::awt::XToolkit
70 #define UNO3_XWINDOWPEER ::com::sun::star::awt::XWindowPeer
71 #define UNO3_EVENTOBJECT ::com::sun::star::lang::EventObject
72 #define UNO3_SEQUENCE ::com::sun::star::uno::Sequence
73 #define UNO3_XCONTAINERLISTENER ::com::sun::star::container::XContainerListener
74 #define UNO3_ANY ::com::sun::star::uno::Any
75 #define UNO3_XTABCONTROLLER ::com::sun::star::awt::XTabController
76 #define UNO3_WINDOWDESCRIPTOR ::com::sun::star::awt::WindowDescriptor
77 #define UNO3_XGRAPHICS ::com::sun::star::awt::XGraphics
78 #define UNO3_OMULTITYPEINTERFACECONTAINERHELPER ::cppu::OMultiTypeInterfaceContainerHelper
79 #define UNO3_ILLEGALARGUMENTEXCEPTION ::com::sun::star::lang::IllegalArgumentException
81 //____________________________________________________________________________________________________________
82 // structs, types, forwards
83 //____________________________________________________________________________________________________________
85 struct IMPL_ControlInfo
87 UNO3_REFERENCE< UNO3_XCONTROL > xControl ;
88 UNO3_OUSTRING sName ;
91 // makro define a list-class for struct IMPL_ControlInfo!
92 class IMPL_ControlInfoList ;
93 DECLARE_LIST( IMPL_ControlInfoList, IMPL_ControlInfo* )
95 //____________________________________________________________________________________________________________
96 // classes
97 //____________________________________________________________________________________________________________
99 class BaseContainerControl : public UNO3_XCONTROLMODEL
100 , public UNO3_XCONTROLCONTAINER
101 , public BaseControl
104 //____________________________________________________________________________________________________________
105 // public methods
106 //____________________________________________________________________________________________________________
108 public:
110 //________________________________________________________________________________________________________
111 // construct/destruct
112 //________________________________________________________________________________________________________
114 /**_______________________________________________________________________________________________________
115 @short -
116 @descr -
118 @seealso -
120 @param -
122 @return -
124 @onerror -
127 BaseContainerControl( const UNO3_REFERENCE< UNO3_XMULTISERVICEFACTORY >& xFactory );
129 /**_______________________________________________________________________________________________________
130 @short -
131 @descr -
133 @seealso -
135 @param -
137 @return -
139 @onerror -
142 virtual ~BaseContainerControl();
144 //________________________________________________________________________________________________________
145 // XInterface
146 //________________________________________________________________________________________________________
148 /**_______________________________________________________________________________________________________
149 @short give answer, if interface is supported
150 @descr The interfaces are searched by type.
152 @seealso XInterface
154 @param "rType" is the type of searched interface.
156 @return Any information about found interface
158 @onerror A RuntimeException is thrown.
161 virtual UNO3_ANY SAL_CALL queryInterface( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION );
163 //________________________________________________________________________________________________________
164 // XTypeProvider
165 //________________________________________________________________________________________________________
167 /**_______________________________________________________________________________________________________
168 @short get information about supported interfaces
169 @descr -
171 @seealso XTypeProvider
173 @param -
175 @return Sequence of types of all supported interfaces
177 @onerror A RuntimeException is thrown.
180 virtual UNO3_SEQUENCE< UNO3_TYPE > SAL_CALL getTypes() throw( UNO3_RUNTIMEEXCEPTION );
182 //________________________________________________________________________________________________________
183 // XAggregation
184 //________________________________________________________________________________________________________
186 /**_______________________________________________________________________________________________________
187 @short -
188 @descr -
190 @seealso -
192 @param -
194 @return -
196 @onerror -
199 virtual UNO3_ANY SAL_CALL queryAggregation( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION );
201 //________________________________________________________________________________________________________
202 // XControl
203 //________________________________________________________________________________________________________
205 /**_______________________________________________________________________________________________________
206 @short -
207 @descr -
209 @seealso -
211 @param -
213 @return -
215 @onerror -
218 virtual void SAL_CALL createPeer( const UNO3_REFERENCE< UNO3_XTOOLKIT >& xToolkit ,
219 const UNO3_REFERENCE< UNO3_XWINDOWPEER >& xParent ) throw( UNO3_RUNTIMEEXCEPTION );
221 /**_______________________________________________________________________________________________________
222 @short -
223 @descr -
225 @seealso -
227 @param -
229 @return -
231 @onerror -
234 virtual sal_Bool SAL_CALL setModel( const UNO3_REFERENCE< UNO3_XCONTROLMODEL >& xModel ) throw( UNO3_RUNTIMEEXCEPTION );
236 /**_______________________________________________________________________________________________________
237 @short -
238 @descr -
240 @seealso -
242 @param -
244 @return -
246 @onerror -
249 virtual UNO3_REFERENCE< UNO3_XCONTROLMODEL > SAL_CALL getModel() throw( UNO3_RUNTIMEEXCEPTION );
251 //________________________________________________________________________________________________________
252 // XComponent
253 //________________________________________________________________________________________________________
255 /**_______________________________________________________________________________________________________
256 @short -
257 @descr -
259 @seealso -
261 @param -
263 @return -
265 @onerror -
268 virtual void SAL_CALL dispose() throw( UNO3_RUNTIMEEXCEPTION );
270 //________________________________________________________________________________________________________
271 // XEventListener
272 //________________________________________________________________________________________________________
274 /**_______________________________________________________________________________________________________
275 @short -
276 @descr -
278 @seealso -
280 @param -
282 @return -
284 @onerror -
287 virtual void SAL_CALL disposing( const UNO3_EVENTOBJECT& rEvent ) throw( UNO3_RUNTIMEEXCEPTION );
289 //________________________________________________________________________________________________________
290 // XControlContainer
291 //________________________________________________________________________________________________________
293 /**_______________________________________________________________________________________________________
294 @short -
295 @descr -
297 @seealso -
299 @param -
301 @return -
303 @onerror -
306 virtual void SAL_CALL addControl( const UNO3_OUSTRING& sName ,
307 const UNO3_REFERENCE< UNO3_XCONTROL >& xControl ) throw( UNO3_RUNTIMEEXCEPTION );
309 /**_______________________________________________________________________________________________________
310 @short -
311 @descr -
313 @seealso -
315 @param -
317 @return -
319 @onerror -
322 virtual void SAL_CALL addContainerListener( const UNO3_REFERENCE< UNO3_XCONTAINERLISTENER >& xListener ) throw( UNO3_RUNTIMEEXCEPTION );
324 /**_______________________________________________________________________________________________________
325 @short -
326 @descr -
328 @seealso -
330 @param -
332 @return -
334 @onerror -
337 virtual void SAL_CALL removeControl( const UNO3_REFERENCE< UNO3_XCONTROL >& xControl ) throw( UNO3_RUNTIMEEXCEPTION );
339 /**_______________________________________________________________________________________________________
340 @short -
341 @descr -
343 @seealso -
345 @param -
347 @return -
349 @onerror -
352 virtual void SAL_CALL removeContainerListener( const UNO3_REFERENCE< UNO3_XCONTAINERLISTENER >& xListener ) throw( UNO3_RUNTIMEEXCEPTION );
354 /**_______________________________________________________________________________________________________
355 @short -
356 @descr -
358 @seealso -
360 @param -
362 @return -
364 @onerror -
367 virtual void SAL_CALL setStatusText( const UNO3_OUSTRING& sStatusText ) throw( UNO3_RUNTIMEEXCEPTION );
369 /**_______________________________________________________________________________________________________
370 @short -
371 @descr -
373 @seealso -
375 @param -
377 @return -
379 @onerror -
382 virtual UNO3_REFERENCE< UNO3_XCONTROL > SAL_CALL getControl( const UNO3_OUSTRING& sName) throw( UNO3_RUNTIMEEXCEPTION );
384 /**_______________________________________________________________________________________________________
385 @short -
386 @descr -
388 @seealso -
390 @param -
392 @return -
394 @onerror -
397 virtual UNO3_SEQUENCE< UNO3_REFERENCE< UNO3_XCONTROL > > SAL_CALL getControls() throw( UNO3_RUNTIMEEXCEPTION );
399 //________________________________________________________________________________________________________
400 // XUnoControlContainer
401 //________________________________________________________________________________________________________
403 /**_______________________________________________________________________________________________________
404 @short -
405 @descr -
407 @seealso -
409 @param -
411 @return -
413 @onerror -
416 virtual void SAL_CALL addTabController( const UNO3_REFERENCE< UNO3_XTABCONTROLLER >& xTabController ) throw( UNO3_RUNTIMEEXCEPTION );
418 /**_______________________________________________________________________________________________________
419 @short -
420 @descr -
422 @seealso -
424 @param -
426 @return -
428 @onerror -
431 virtual void SAL_CALL removeTabController( const UNO3_REFERENCE< UNO3_XTABCONTROLLER >& xTabController ) throw( UNO3_RUNTIMEEXCEPTION );
433 /**_______________________________________________________________________________________________________
434 @short -
435 @descr -
437 @seealso -
439 @param -
441 @return -
443 @onerror -
446 virtual void SAL_CALL setTabControllers( const UNO3_SEQUENCE< UNO3_REFERENCE< UNO3_XTABCONTROLLER > >& xTabControllers ) throw( UNO3_RUNTIMEEXCEPTION );
448 /**_______________________________________________________________________________________________________
449 @short -
450 @descr -
452 @seealso -
454 @param -
456 @return -
458 @onerror -
461 virtual UNO3_SEQUENCE< UNO3_REFERENCE< UNO3_XTABCONTROLLER > > SAL_CALL getTabControllers() throw( UNO3_RUNTIMEEXCEPTION );
463 //________________________________________________________________________________________________________
464 // XWindow
465 //________________________________________________________________________________________________________
467 /**_______________________________________________________________________________________________________
468 @short -
469 @descr -
471 @seealso -
473 @param -
475 @return -
477 @onerror -
480 virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw( UNO3_RUNTIMEEXCEPTION );
482 //____________________________________________________________________________________________________________
483 // protected methods
484 //____________________________________________________________________________________________________________
486 protected:
487 using OComponentHelper::disposing;
488 /**_______________________________________________________________________________________________________
489 @short
490 @descr
492 @seealso
494 @param
496 @return
498 @onerror
501 virtual UNO3_WINDOWDESCRIPTOR* impl_getWindowDescriptor( const UNO3_REFERENCE< UNO3_XWINDOWPEER >& xParentPeer );
503 /**_______________________________________________________________________________________________________
504 @short
505 @descr
507 @seealso
509 @param
511 @return
513 @onerror
516 virtual void impl_paint( sal_Int32 nX ,
517 sal_Int32 nY ,
518 const UNO3_REFERENCE< UNO3_XGRAPHICS >& xGraphics );
520 //____________________________________________________________________________________________________________
521 // private methods
522 //____________________________________________________________________________________________________________
524 private:
526 /**_______________________________________________________________________________________________________
527 @short
528 @descr
530 @seealso
532 @param
534 @return
536 @onerror
539 void impl_activateTabControllers();
541 /**_______________________________________________________________________________________________________
542 @short
543 @descr
545 @seealso
547 @param
549 @return
551 @onerror
554 void impl_cleanMemory();
556 //____________________________________________________________________________________________________________
557 // private variables
558 //____________________________________________________________________________________________________________
560 private:
562 IMPL_ControlInfoList* m_pControlInfoList ; /// list of pointer of "struct IMPL_ControlInfo" to hold child-controls
563 UNO3_SEQUENCE< UNO3_REFERENCE< UNO3_XTABCONTROLLER > > m_xTabControllerList ; /// list of references of XTabController to hold tab-order in this container
564 UNO3_OMULTITYPEINTERFACECONTAINERHELPER m_aListeners ;
566 }; // class BaseContainerControl
568 } // namespace unocontrols
570 #endif // ifndef _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_HXX