bump product version to 4.1.6.2
[LibreOffice.git] / UnoControls / inc / basecontainercontrol.hxx
bloba6a0906bdb08ab393e310f7ae93a9ddb91ffd2c2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
33 #include <vector>
35 #include "basecontrol.hxx"
37 //____________________________________________________________________________________________________________
38 // "namespaces"
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 ;
50 OUString sName ;
53 class BaseContainerControl : public ::com::sun::star::awt::XControlModel
54 , public ::com::sun::star::awt::XControlContainer
55 , public BaseControl
58 //____________________________________________________________________________________________________________
59 // public methods
60 //____________________________________________________________________________________________________________
62 public:
64 //________________________________________________________________________________________________________
65 // construct/destruct
66 //________________________________________________________________________________________________________
68 /**_______________________________________________________________________________________________________
69 @short -
70 @descr -
72 @seealso -
74 @param -
76 @return -
78 @onerror -
81 BaseContainerControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
83 /**_______________________________________________________________________________________________________
84 @short -
85 @descr -
87 @seealso -
89 @param -
91 @return -
93 @onerror -
96 virtual ~BaseContainerControl();
98 //________________________________________________________________________________________________________
99 // XInterface
100 //________________________________________________________________________________________________________
102 /**_______________________________________________________________________________________________________
103 @short give answer, if interface is supported
104 @descr The interfaces are searched by type.
106 @seealso XInterface
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 //________________________________________________________________________________________________________
120 // XTypeProvider
121 //________________________________________________________________________________________________________
123 /**_______________________________________________________________________________________________________
124 @short get information about supported interfaces
125 @descr -
127 @seealso XTypeProvider
129 @param -
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 //________________________________________________________________________________________________________
140 // XAggregation
141 //________________________________________________________________________________________________________
143 /**_______________________________________________________________________________________________________
144 @short -
145 @descr -
147 @seealso -
149 @param -
151 @return -
153 @onerror -
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 //________________________________________________________________________________________________________
161 // XControl
162 //________________________________________________________________________________________________________
164 /**_______________________________________________________________________________________________________
165 @short -
166 @descr -
168 @seealso -
170 @param -
172 @return -
174 @onerror -
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 /**_______________________________________________________________________________________________________
183 @short -
184 @descr -
186 @seealso -
188 @param -
190 @return -
192 @onerror -
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 /**_______________________________________________________________________________________________________
200 @short -
201 @descr -
203 @seealso -
205 @param -
207 @return -
209 @onerror -
212 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel()
213 throw( ::com::sun::star::uno::RuntimeException );
215 //________________________________________________________________________________________________________
216 // XComponent
217 //________________________________________________________________________________________________________
219 /**_______________________________________________________________________________________________________
220 @short -
221 @descr -
223 @seealso -
225 @param -
227 @return -
229 @onerror -
232 virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
234 //________________________________________________________________________________________________________
235 // XEventListener
236 //________________________________________________________________________________________________________
238 /**_______________________________________________________________________________________________________
239 @short -
240 @descr -
242 @seealso -
244 @param -
246 @return -
248 @onerror -
251 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& rEvent ) throw( ::com::sun::star::uno::RuntimeException );
253 //________________________________________________________________________________________________________
254 // XControlContainer
255 //________________________________________________________________________________________________________
257 /**_______________________________________________________________________________________________________
258 @short -
259 @descr -
261 @seealso -
263 @param -
265 @return -
267 @onerror -
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 /**_______________________________________________________________________________________________________
276 @short -
277 @descr -
279 @seealso -
281 @param -
283 @return -
285 @onerror -
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 /**_______________________________________________________________________________________________________
293 @short -
294 @descr -
296 @seealso -
298 @param -
300 @return -
302 @onerror -
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 /**_______________________________________________________________________________________________________
310 @short -
311 @descr -
313 @seealso -
315 @param -
317 @return -
319 @onerror -
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 /**_______________________________________________________________________________________________________
327 @short -
328 @descr -
330 @seealso -
332 @param -
334 @return -
336 @onerror -
339 virtual void SAL_CALL setStatusText(
340 const OUString& sStatusText
341 ) throw( ::com::sun::star::uno::RuntimeException );
343 /**_______________________________________________________________________________________________________
344 @short -
345 @descr -
347 @seealso -
349 @param -
351 @return -
353 @onerror -
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 /**_______________________________________________________________________________________________________
361 @short -
362 @descr -
364 @seealso -
366 @param -
368 @return -
370 @onerror -
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 /**_______________________________________________________________________________________________________
381 @short -
382 @descr -
384 @seealso -
386 @param -
388 @return -
390 @onerror -
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 /**_______________________________________________________________________________________________________
398 @short -
399 @descr -
401 @seealso -
403 @param -
405 @return -
407 @onerror -
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 /**_______________________________________________________________________________________________________
415 @short -
416 @descr -
418 @seealso -
420 @param -
422 @return -
424 @onerror -
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 /**_______________________________________________________________________________________________________
432 @short -
433 @descr -
435 @seealso -
437 @param -
439 @return -
441 @onerror -
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 //________________________________________________________________________________________________________
448 // XWindow
449 //________________________________________________________________________________________________________
451 /**_______________________________________________________________________________________________________
452 @short -
453 @descr -
455 @seealso -
457 @param -
459 @return -
461 @onerror -
464 virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw( ::com::sun::star::uno::RuntimeException );
466 //____________________________________________________________________________________________________________
467 // protected methods
468 //____________________________________________________________________________________________________________
470 protected:
471 using OComponentHelper::disposing;
472 /**_______________________________________________________________________________________________________
473 @short
474 @descr
476 @seealso
478 @param
480 @return
482 @onerror
485 virtual ::com::sun::star::awt::WindowDescriptor* impl_getWindowDescriptor(
486 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParentPeer
489 /**_______________________________________________________________________________________________________
490 @short
491 @descr
493 @seealso
495 @param
497 @return
499 @onerror
502 virtual void impl_paint(
503 sal_Int32 nX ,
504 sal_Int32 nY ,
505 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics
508 //____________________________________________________________________________________________________________
509 // private methods
510 //____________________________________________________________________________________________________________
512 private:
514 /**_______________________________________________________________________________________________________
515 @short
516 @descr
518 @seealso
520 @param
522 @return
524 @onerror
527 void impl_activateTabControllers();
529 /**_______________________________________________________________________________________________________
530 @short
531 @descr
533 @seealso
535 @param
537 @return
539 @onerror
542 void impl_cleanMemory();
544 //____________________________________________________________________________________________________________
545 // private variables
546 //____________________________________________________________________________________________________________
548 private:
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: */