1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_HXX 29 #define _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_HXX 30 31 //____________________________________________________________________________________________________________ 32 // includes of other projects 33 //____________________________________________________________________________________________________________ 34 35 #include <com/sun/star/lang/XServiceName.hpp> 36 #include <com/sun/star/lang/XServiceInfo.hpp> 37 #include <com/sun/star/container/XContainer.hpp> 38 #include <com/sun/star/container/XIndexContainer.hpp> 39 #include <com/sun/star/container/XNameReplace.hpp> 40 #include <com/sun/star/container/XContainerListener.hpp> 41 #include <com/sun/star/container/XSet.hpp> 42 #include <com/sun/star/container/ContainerEvent.hpp> 43 #include <com/sun/star/container/XIndexReplace.hpp> 44 #include <com/sun/star/container/XNameContainer.hpp> 45 #include <tools/list.hxx> 46 47 //____________________________________________________________________________________________________________ 48 // includes of my own project 49 //____________________________________________________________________________________________________________ 50 #include "basecontrol.hxx" 51 52 //____________________________________________________________________________________________________________ 53 // "namespaces" 54 //____________________________________________________________________________________________________________ 55 56 namespace unocontrols{ 57 58 #define UNO3_REFERENCE ::com::sun::star::uno::Reference 59 #define UNO3_XCONTROL ::com::sun::star::awt::XControl 60 #define UNO3_OUSTRING ::rtl::OUString 61 #define UNO3_XCONTROLMODEL ::com::sun::star::awt::XControlModel 62 #define UNO3_XCONTROLCONTAINER ::com::sun::star::awt::XControlContainer 63 #define UNO3_XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory 64 #define UNO3_TYPE ::com::sun::star::uno::Type 65 #define UNO3_RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException 66 #define UNO3_XTOOLKIT ::com::sun::star::awt::XToolkit 67 #define UNO3_XWINDOWPEER ::com::sun::star::awt::XWindowPeer 68 #define UNO3_EVENTOBJECT ::com::sun::star::lang::EventObject 69 #define UNO3_SEQUENCE ::com::sun::star::uno::Sequence 70 #define UNO3_XCONTAINERLISTENER ::com::sun::star::container::XContainerListener 71 #define UNO3_ANY ::com::sun::star::uno::Any 72 #define UNO3_XTABCONTROLLER ::com::sun::star::awt::XTabController 73 #define UNO3_WINDOWDESCRIPTOR ::com::sun::star::awt::WindowDescriptor 74 #define UNO3_XGRAPHICS ::com::sun::star::awt::XGraphics 75 #define UNO3_OMULTITYPEINTERFACECONTAINERHELPER ::cppu::OMultiTypeInterfaceContainerHelper 76 #define UNO3_ILLEGALARGUMENTEXCEPTION ::com::sun::star::lang::IllegalArgumentException 77 78 //____________________________________________________________________________________________________________ 79 // structs, types, forwards 80 //____________________________________________________________________________________________________________ 81 82 struct IMPL_ControlInfo 83 { 84 UNO3_REFERENCE< UNO3_XCONTROL > xControl ; 85 UNO3_OUSTRING sName ; 86 }; 87 88 // makro define a list-class for struct IMPL_ControlInfo! 89 class IMPL_ControlInfoList ; 90 DECLARE_LIST( IMPL_ControlInfoList, IMPL_ControlInfo* ) 91 92 //____________________________________________________________________________________________________________ 93 // classes 94 //____________________________________________________________________________________________________________ 95 96 class BaseContainerControl : public UNO3_XCONTROLMODEL 97 , public UNO3_XCONTROLCONTAINER 98 , public BaseControl 99 { 100 101 //____________________________________________________________________________________________________________ 102 // public methods 103 //____________________________________________________________________________________________________________ 104 105 public: 106 107 //________________________________________________________________________________________________________ 108 // construct/destruct 109 //________________________________________________________________________________________________________ 110 111 /**_______________________________________________________________________________________________________ 112 @short - 113 @descr - 114 115 @seealso - 116 117 @param - 118 119 @return - 120 121 @onerror - 122 */ 123 124 BaseContainerControl( const UNO3_REFERENCE< UNO3_XMULTISERVICEFACTORY >& xFactory ); 125 126 /**_______________________________________________________________________________________________________ 127 @short - 128 @descr - 129 130 @seealso - 131 132 @param - 133 134 @return - 135 136 @onerror - 137 */ 138 139 virtual ~BaseContainerControl(); 140 141 //________________________________________________________________________________________________________ 142 // XInterface 143 //________________________________________________________________________________________________________ 144 145 /**_______________________________________________________________________________________________________ 146 @short give answer, if interface is supported 147 @descr The interfaces are searched by type. 148 149 @seealso XInterface 150 151 @param "rType" is the type of searched interface. 152 153 @return Any information about found interface 154 155 @onerror A RuntimeException is thrown. 156 */ 157 158 virtual UNO3_ANY SAL_CALL queryInterface( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION ); 159 160 //________________________________________________________________________________________________________ 161 // XTypeProvider 162 //________________________________________________________________________________________________________ 163 164 /**_______________________________________________________________________________________________________ 165 @short get information about supported interfaces 166 @descr - 167 168 @seealso XTypeProvider 169 170 @param - 171 172 @return Sequence of types of all supported interfaces 173 174 @onerror A RuntimeException is thrown. 175 */ 176 177 virtual UNO3_SEQUENCE< UNO3_TYPE > SAL_CALL getTypes() throw( UNO3_RUNTIMEEXCEPTION ); 178 179 //________________________________________________________________________________________________________ 180 // XAggregation 181 //________________________________________________________________________________________________________ 182 183 /**_______________________________________________________________________________________________________ 184 @short - 185 @descr - 186 187 @seealso - 188 189 @param - 190 191 @return - 192 193 @onerror - 194 */ 195 196 virtual UNO3_ANY SAL_CALL queryAggregation( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION ); 197 198 //________________________________________________________________________________________________________ 199 // XControl 200 //________________________________________________________________________________________________________ 201 202 /**_______________________________________________________________________________________________________ 203 @short - 204 @descr - 205 206 @seealso - 207 208 @param - 209 210 @return - 211 212 @onerror - 213 */ 214 215 virtual void SAL_CALL createPeer( const UNO3_REFERENCE< UNO3_XTOOLKIT >& xToolkit , 216 const UNO3_REFERENCE< UNO3_XWINDOWPEER >& xParent ) throw( UNO3_RUNTIMEEXCEPTION ); 217 218 /**_______________________________________________________________________________________________________ 219 @short - 220 @descr - 221 222 @seealso - 223 224 @param - 225 226 @return - 227 228 @onerror - 229 */ 230 231 virtual sal_Bool SAL_CALL setModel( const UNO3_REFERENCE< UNO3_XCONTROLMODEL >& xModel ) throw( UNO3_RUNTIMEEXCEPTION ); 232 233 /**_______________________________________________________________________________________________________ 234 @short - 235 @descr - 236 237 @seealso - 238 239 @param - 240 241 @return - 242 243 @onerror - 244 */ 245 246 virtual UNO3_REFERENCE< UNO3_XCONTROLMODEL > SAL_CALL getModel() throw( UNO3_RUNTIMEEXCEPTION ); 247 248 //________________________________________________________________________________________________________ 249 // XComponent 250 //________________________________________________________________________________________________________ 251 252 /**_______________________________________________________________________________________________________ 253 @short - 254 @descr - 255 256 @seealso - 257 258 @param - 259 260 @return - 261 262 @onerror - 263 */ 264 265 virtual void SAL_CALL dispose() throw( UNO3_RUNTIMEEXCEPTION ); 266 267 //________________________________________________________________________________________________________ 268 // XEventListener 269 //________________________________________________________________________________________________________ 270 271 /**_______________________________________________________________________________________________________ 272 @short - 273 @descr - 274 275 @seealso - 276 277 @param - 278 279 @return - 280 281 @onerror - 282 */ 283 284 virtual void SAL_CALL disposing( const UNO3_EVENTOBJECT& rEvent ) throw( UNO3_RUNTIMEEXCEPTION ); 285 286 //________________________________________________________________________________________________________ 287 // XControlContainer 288 //________________________________________________________________________________________________________ 289 290 /**_______________________________________________________________________________________________________ 291 @short - 292 @descr - 293 294 @seealso - 295 296 @param - 297 298 @return - 299 300 @onerror - 301 */ 302 303 virtual void SAL_CALL addControl( const UNO3_OUSTRING& sName , 304 const UNO3_REFERENCE< UNO3_XCONTROL >& xControl ) throw( UNO3_RUNTIMEEXCEPTION ); 305 306 /**_______________________________________________________________________________________________________ 307 @short - 308 @descr - 309 310 @seealso - 311 312 @param - 313 314 @return - 315 316 @onerror - 317 */ 318 319 virtual void SAL_CALL addContainerListener( const UNO3_REFERENCE< UNO3_XCONTAINERLISTENER >& xListener ) throw( UNO3_RUNTIMEEXCEPTION ); 320 321 /**_______________________________________________________________________________________________________ 322 @short - 323 @descr - 324 325 @seealso - 326 327 @param - 328 329 @return - 330 331 @onerror - 332 */ 333 334 virtual void SAL_CALL removeControl( const UNO3_REFERENCE< UNO3_XCONTROL >& xControl ) throw( UNO3_RUNTIMEEXCEPTION ); 335 336 /**_______________________________________________________________________________________________________ 337 @short - 338 @descr - 339 340 @seealso - 341 342 @param - 343 344 @return - 345 346 @onerror - 347 */ 348 349 virtual void SAL_CALL removeContainerListener( const UNO3_REFERENCE< UNO3_XCONTAINERLISTENER >& xListener ) throw( UNO3_RUNTIMEEXCEPTION ); 350 351 /**_______________________________________________________________________________________________________ 352 @short - 353 @descr - 354 355 @seealso - 356 357 @param - 358 359 @return - 360 361 @onerror - 362 */ 363 364 virtual void SAL_CALL setStatusText( const UNO3_OUSTRING& sStatusText ) throw( UNO3_RUNTIMEEXCEPTION ); 365 366 /**_______________________________________________________________________________________________________ 367 @short - 368 @descr - 369 370 @seealso - 371 372 @param - 373 374 @return - 375 376 @onerror - 377 */ 378 379 virtual UNO3_REFERENCE< UNO3_XCONTROL > SAL_CALL getControl( const UNO3_OUSTRING& sName) throw( UNO3_RUNTIMEEXCEPTION ); 380 381 /**_______________________________________________________________________________________________________ 382 @short - 383 @descr - 384 385 @seealso - 386 387 @param - 388 389 @return - 390 391 @onerror - 392 */ 393 394 virtual UNO3_SEQUENCE< UNO3_REFERENCE< UNO3_XCONTROL > > SAL_CALL getControls() throw( UNO3_RUNTIMEEXCEPTION ); 395 396 //________________________________________________________________________________________________________ 397 // XUnoControlContainer 398 //________________________________________________________________________________________________________ 399 400 /**_______________________________________________________________________________________________________ 401 @short - 402 @descr - 403 404 @seealso - 405 406 @param - 407 408 @return - 409 410 @onerror - 411 */ 412 413 virtual void SAL_CALL addTabController( const UNO3_REFERENCE< UNO3_XTABCONTROLLER >& xTabController ) throw( UNO3_RUNTIMEEXCEPTION ); 414 415 /**_______________________________________________________________________________________________________ 416 @short - 417 @descr - 418 419 @seealso - 420 421 @param - 422 423 @return - 424 425 @onerror - 426 */ 427 428 virtual void SAL_CALL removeTabController( const UNO3_REFERENCE< UNO3_XTABCONTROLLER >& xTabController ) throw( UNO3_RUNTIMEEXCEPTION ); 429 430 /**_______________________________________________________________________________________________________ 431 @short - 432 @descr - 433 434 @seealso - 435 436 @param - 437 438 @return - 439 440 @onerror - 441 */ 442 443 virtual void SAL_CALL setTabControllers( const UNO3_SEQUENCE< UNO3_REFERENCE< UNO3_XTABCONTROLLER > >& xTabControllers ) throw( UNO3_RUNTIMEEXCEPTION ); 444 445 /**_______________________________________________________________________________________________________ 446 @short - 447 @descr - 448 449 @seealso - 450 451 @param - 452 453 @return - 454 455 @onerror - 456 */ 457 458 virtual UNO3_SEQUENCE< UNO3_REFERENCE< UNO3_XTABCONTROLLER > > SAL_CALL getTabControllers() throw( UNO3_RUNTIMEEXCEPTION ); 459 460 //________________________________________________________________________________________________________ 461 // XWindow 462 //________________________________________________________________________________________________________ 463 464 /**_______________________________________________________________________________________________________ 465 @short - 466 @descr - 467 468 @seealso - 469 470 @param - 471 472 @return - 473 474 @onerror - 475 */ 476 477 virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw( UNO3_RUNTIMEEXCEPTION ); 478 479 //____________________________________________________________________________________________________________ 480 // protected methods 481 //____________________________________________________________________________________________________________ 482 483 protected: 484 using OComponentHelper::disposing; 485 /**_______________________________________________________________________________________________________ 486 @short 487 @descr 488 489 @seealso 490 491 @param 492 493 @return 494 495 @onerror 496 */ 497 498 virtual UNO3_WINDOWDESCRIPTOR* impl_getWindowDescriptor( const UNO3_REFERENCE< UNO3_XWINDOWPEER >& xParentPeer ); 499 500 /**_______________________________________________________________________________________________________ 501 @short 502 @descr 503 504 @seealso 505 506 @param 507 508 @return 509 510 @onerror 511 */ 512 513 virtual void impl_paint( sal_Int32 nX , 514 sal_Int32 nY , 515 const UNO3_REFERENCE< UNO3_XGRAPHICS >& xGraphics ); 516 517 //____________________________________________________________________________________________________________ 518 // private methods 519 //____________________________________________________________________________________________________________ 520 521 private: 522 523 /**_______________________________________________________________________________________________________ 524 @short 525 @descr 526 527 @seealso 528 529 @param 530 531 @return 532 533 @onerror 534 */ 535 536 void impl_activateTabControllers(); 537 538 /**_______________________________________________________________________________________________________ 539 @short 540 @descr 541 542 @seealso 543 544 @param 545 546 @return 547 548 @onerror 549 */ 550 551 void impl_cleanMemory(); 552 553 //____________________________________________________________________________________________________________ 554 // private variables 555 //____________________________________________________________________________________________________________ 556 557 private: 558 559 IMPL_ControlInfoList* m_pControlInfoList ; /// list of pointer of "struct IMPL_ControlInfo" to hold child-controls 560 UNO3_SEQUENCE< UNO3_REFERENCE< UNO3_XTABCONTROLLER > > m_xTabControllerList ; /// list of references of XTabController to hold tab-order in this container 561 UNO3_OMULTITYPEINTERFACECONTAINERHELPER m_aListeners ; 562 563 }; // class BaseContainerControl 564 565 } // namespace unocontrols 566 567 #endif // ifndef _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_HXX 568