Bump for 3.6-28
[LibreOffice.git] / UnoControls / inc / basecontainercontrol.hxx
blob7052c580bd610f9fadb0e5c21a7668d4ca67ef34
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>
46 #include <vector>
48 //____________________________________________________________________________________________________________
49 // includes of my own project
50 //____________________________________________________________________________________________________________
51 #include "basecontrol.hxx"
53 //____________________________________________________________________________________________________________
54 // "namespaces"
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 //____________________________________________________________________________________________________________
70 // classes
71 //____________________________________________________________________________________________________________
73 class BaseContainerControl : public ::com::sun::star::awt::XControlModel
74 , public ::com::sun::star::awt::XControlContainer
75 , public BaseControl
78 //____________________________________________________________________________________________________________
79 // public methods
80 //____________________________________________________________________________________________________________
82 public:
84 //________________________________________________________________________________________________________
85 // construct/destruct
86 //________________________________________________________________________________________________________
88 /**_______________________________________________________________________________________________________
89 @short -
90 @descr -
92 @seealso -
94 @param -
96 @return -
98 @onerror -
101 BaseContainerControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
103 /**_______________________________________________________________________________________________________
104 @short -
105 @descr -
107 @seealso -
109 @param -
111 @return -
113 @onerror -
116 virtual ~BaseContainerControl();
118 //________________________________________________________________________________________________________
119 // XInterface
120 //________________________________________________________________________________________________________
122 /**_______________________________________________________________________________________________________
123 @short give answer, if interface is supported
124 @descr The interfaces are searched by type.
126 @seealso XInterface
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 //________________________________________________________________________________________________________
140 // XTypeProvider
141 //________________________________________________________________________________________________________
143 /**_______________________________________________________________________________________________________
144 @short get information about supported interfaces
145 @descr -
147 @seealso XTypeProvider
149 @param -
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 //________________________________________________________________________________________________________
160 // XAggregation
161 //________________________________________________________________________________________________________
163 /**_______________________________________________________________________________________________________
164 @short -
165 @descr -
167 @seealso -
169 @param -
171 @return -
173 @onerror -
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 //________________________________________________________________________________________________________
181 // XControl
182 //________________________________________________________________________________________________________
184 /**_______________________________________________________________________________________________________
185 @short -
186 @descr -
188 @seealso -
190 @param -
192 @return -
194 @onerror -
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 /**_______________________________________________________________________________________________________
203 @short -
204 @descr -
206 @seealso -
208 @param -
210 @return -
212 @onerror -
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 /**_______________________________________________________________________________________________________
220 @short -
221 @descr -
223 @seealso -
225 @param -
227 @return -
229 @onerror -
232 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel()
233 throw( ::com::sun::star::uno::RuntimeException );
235 //________________________________________________________________________________________________________
236 // XComponent
237 //________________________________________________________________________________________________________
239 /**_______________________________________________________________________________________________________
240 @short -
241 @descr -
243 @seealso -
245 @param -
247 @return -
249 @onerror -
252 virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
254 //________________________________________________________________________________________________________
255 // XEventListener
256 //________________________________________________________________________________________________________
258 /**_______________________________________________________________________________________________________
259 @short -
260 @descr -
262 @seealso -
264 @param -
266 @return -
268 @onerror -
271 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& rEvent ) throw( ::com::sun::star::uno::RuntimeException );
273 //________________________________________________________________________________________________________
274 // XControlContainer
275 //________________________________________________________________________________________________________
277 /**_______________________________________________________________________________________________________
278 @short -
279 @descr -
281 @seealso -
283 @param -
285 @return -
287 @onerror -
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 /**_______________________________________________________________________________________________________
296 @short -
297 @descr -
299 @seealso -
301 @param -
303 @return -
305 @onerror -
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 /**_______________________________________________________________________________________________________
313 @short -
314 @descr -
316 @seealso -
318 @param -
320 @return -
322 @onerror -
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 /**_______________________________________________________________________________________________________
330 @short -
331 @descr -
333 @seealso -
335 @param -
337 @return -
339 @onerror -
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 /**_______________________________________________________________________________________________________
347 @short -
348 @descr -
350 @seealso -
352 @param -
354 @return -
356 @onerror -
359 virtual void SAL_CALL setStatusText(
360 const ::rtl::OUString& sStatusText
361 ) throw( ::com::sun::star::uno::RuntimeException );
363 /**_______________________________________________________________________________________________________
364 @short -
365 @descr -
367 @seealso -
369 @param -
371 @return -
373 @onerror -
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 /**_______________________________________________________________________________________________________
381 @short -
382 @descr -
384 @seealso -
386 @param -
388 @return -
390 @onerror -
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 /**_______________________________________________________________________________________________________
401 @short -
402 @descr -
404 @seealso -
406 @param -
408 @return -
410 @onerror -
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 /**_______________________________________________________________________________________________________
418 @short -
419 @descr -
421 @seealso -
423 @param -
425 @return -
427 @onerror -
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 /**_______________________________________________________________________________________________________
435 @short -
436 @descr -
438 @seealso -
440 @param -
442 @return -
444 @onerror -
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 /**_______________________________________________________________________________________________________
452 @short -
453 @descr -
455 @seealso -
457 @param -
459 @return -
461 @onerror -
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 //________________________________________________________________________________________________________
468 // XWindow
469 //________________________________________________________________________________________________________
471 /**_______________________________________________________________________________________________________
472 @short -
473 @descr -
475 @seealso -
477 @param -
479 @return -
481 @onerror -
484 virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw( ::com::sun::star::uno::RuntimeException );
486 //____________________________________________________________________________________________________________
487 // protected methods
488 //____________________________________________________________________________________________________________
490 protected:
491 using OComponentHelper::disposing;
492 /**_______________________________________________________________________________________________________
493 @short
494 @descr
496 @seealso
498 @param
500 @return
502 @onerror
505 virtual ::com::sun::star::awt::WindowDescriptor* impl_getWindowDescriptor(
506 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParentPeer
509 /**_______________________________________________________________________________________________________
510 @short
511 @descr
513 @seealso
515 @param
517 @return
519 @onerror
522 virtual void impl_paint(
523 sal_Int32 nX ,
524 sal_Int32 nY ,
525 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics
528 //____________________________________________________________________________________________________________
529 // private methods
530 //____________________________________________________________________________________________________________
532 private:
534 /**_______________________________________________________________________________________________________
535 @short
536 @descr
538 @seealso
540 @param
542 @return
544 @onerror
547 void impl_activateTabControllers();
549 /**_______________________________________________________________________________________________________
550 @short
551 @descr
553 @seealso
555 @param
557 @return
559 @onerror
562 void impl_cleanMemory();
564 //____________________________________________________________________________________________________________
565 // private variables
566 //____________________________________________________________________________________________________________
568 private:
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: */