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 // MARKER(update_precomp.py): autogen include statement, do not remove 29 #include "precompiled_ucbhelper.hxx" 30 31 /************************************************************************** 32 TODO 33 ************************************************************************** 34 35 *************************************************************************/ 36 #include <osl/mutex.hxx> 37 #include <cppuhelper/typeprovider.hxx> 38 #include <ucbhelper/interactionrequest.hxx> 39 40 using namespace com::sun::star; 41 using namespace ucbhelper; 42 43 //========================================================================= 44 //========================================================================= 45 // 46 // InteractionRequest Implementation. 47 // 48 //========================================================================= 49 //========================================================================= 50 51 namespace ucbhelper 52 { 53 54 struct InteractionRequest_Impl 55 { 56 rtl::Reference< InteractionContinuation > m_xSelection; 57 com::sun::star::uno::Any m_aRequest; 58 com::sun::star::uno::Sequence< 59 com::sun::star::uno::Reference< 60 com::sun::star::task::XInteractionContinuation > > m_aContinuations; 61 62 InteractionRequest_Impl() {} 63 InteractionRequest_Impl( const uno::Any & rRequest ) 64 : m_aRequest( rRequest ) {} 65 }; 66 67 } 68 69 //========================================================================= 70 InteractionRequest::InteractionRequest() 71 : m_pImpl( new InteractionRequest_Impl ) 72 { 73 } 74 75 //========================================================================= 76 InteractionRequest::InteractionRequest( const uno::Any & rRequest ) 77 : m_pImpl( new InteractionRequest_Impl( rRequest ) ) 78 { 79 } 80 81 //========================================================================= 82 // virtual 83 InteractionRequest::~InteractionRequest() 84 { 85 delete m_pImpl; 86 } 87 88 //========================================================================= 89 void InteractionRequest::setRequest( const uno::Any & rRequest ) 90 { 91 m_pImpl->m_aRequest = rRequest; 92 } 93 94 //========================================================================= 95 void InteractionRequest::setContinuations( 96 const uno::Sequence< uno::Reference< 97 task::XInteractionContinuation > > & rContinuations ) 98 { 99 m_pImpl->m_aContinuations = rContinuations; 100 } 101 102 //========================================================================= 103 rtl::Reference< InteractionContinuation > 104 InteractionRequest::getSelection() const 105 { 106 return m_pImpl->m_xSelection; 107 } 108 109 //========================================================================= 110 void InteractionRequest::setSelection( 111 const rtl::Reference< InteractionContinuation > & rxSelection ) 112 { 113 m_pImpl->m_xSelection = rxSelection; 114 } 115 116 //========================================================================= 117 // 118 // XInterface methods. 119 // 120 //========================================================================= 121 122 // virtual 123 void SAL_CALL InteractionRequest::acquire() 124 throw() 125 { 126 OWeakObject::acquire(); 127 } 128 129 //========================================================================= 130 // virtual 131 void SAL_CALL InteractionRequest::release() 132 throw() 133 { 134 OWeakObject::release(); 135 } 136 137 //========================================================================= 138 // virtual 139 uno::Any SAL_CALL 140 InteractionRequest::queryInterface( const uno::Type & rType ) 141 throw ( uno::RuntimeException ) 142 { 143 uno::Any aRet = cppu::queryInterface( rType, 144 static_cast< lang::XTypeProvider * >( this ), 145 static_cast< task::XInteractionRequest * >( this ) ); 146 147 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); 148 } 149 150 //========================================================================= 151 // 152 // XTypeProvider methods. 153 // 154 //========================================================================= 155 156 // virtual 157 uno::Sequence< sal_Int8 > SAL_CALL InteractionRequest::getImplementationId() 158 throw( uno::RuntimeException ) 159 { 160 static cppu::OImplementationId* pId = NULL; 161 if ( !pId ) 162 { 163 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 164 if ( !pId ) 165 { 166 static cppu::OImplementationId id( sal_False ); 167 pId = &id; 168 } 169 } 170 return (*pId).getImplementationId(); 171 } 172 173 //========================================================================= 174 // virtual 175 uno::Sequence< uno::Type > SAL_CALL InteractionRequest::getTypes() 176 throw( uno::RuntimeException ) 177 { 178 static cppu::OTypeCollection* pCollection = 0; 179 if ( !pCollection ) 180 { 181 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 182 if ( !pCollection ) 183 { 184 static cppu::OTypeCollection collection( 185 getCppuType( static_cast< 186 uno::Reference< lang::XTypeProvider > * >( 0 ) ), 187 getCppuType( static_cast< 188 uno::Reference< task::XInteractionRequest > * >( 0 ) ) ); 189 pCollection = &collection; 190 } 191 } 192 return (*pCollection).getTypes(); 193 } 194 195 //========================================================================= 196 // 197 // XInteractionRequest methods. 198 // 199 //========================================================================= 200 201 // virtual 202 uno::Any SAL_CALL InteractionRequest::getRequest() 203 throw( uno::RuntimeException ) 204 { 205 return m_pImpl->m_aRequest; 206 } 207 208 //========================================================================= 209 // virtual 210 uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL 211 InteractionRequest::getContinuations() 212 throw( uno::RuntimeException ) 213 { 214 return m_pImpl->m_aContinuations; 215 } 216 217 //========================================================================= 218 //========================================================================= 219 // 220 // InteractionContinuation Implementation. 221 // 222 //========================================================================= 223 //========================================================================= 224 225 namespace ucbhelper 226 { 227 228 struct InteractionContinuation_Impl 229 { 230 InteractionRequest * m_pRequest; 231 232 InteractionContinuation_Impl( InteractionRequest * pRequest ) 233 : m_pRequest( pRequest ) {} 234 }; 235 236 } 237 238 //========================================================================= 239 InteractionContinuation::InteractionContinuation( 240 InteractionRequest * pRequest ) 241 : m_pImpl( new InteractionContinuation_Impl( pRequest ) ) 242 { 243 } 244 245 //========================================================================= 246 // virtual 247 InteractionContinuation::~InteractionContinuation() 248 { 249 delete m_pImpl; 250 } 251 252 //========================================================================= 253 void InteractionContinuation::recordSelection() 254 { 255 m_pImpl->m_pRequest->setSelection( this ); 256 } 257 258 //========================================================================= 259 //========================================================================= 260 // 261 // InteractionAbort Implementation. 262 // 263 //========================================================================= 264 //========================================================================= 265 266 //========================================================================= 267 // 268 // XInterface methods. 269 // 270 //========================================================================= 271 272 // virtual 273 void SAL_CALL InteractionAbort::acquire() 274 throw() 275 { 276 OWeakObject::acquire(); 277 } 278 279 //========================================================================= 280 // virtual 281 void SAL_CALL InteractionAbort::release() 282 throw() 283 { 284 OWeakObject::release(); 285 } 286 287 //========================================================================= 288 // virtual 289 uno::Any SAL_CALL 290 InteractionAbort::queryInterface( const uno::Type & rType ) 291 throw ( uno::RuntimeException ) 292 { 293 uno::Any aRet = cppu::queryInterface( rType, 294 static_cast< lang::XTypeProvider * >( this ), 295 static_cast< task::XInteractionContinuation * >( this ), 296 static_cast< task::XInteractionAbort * >( this ) ); 297 298 return aRet.hasValue() 299 ? aRet : InteractionContinuation::queryInterface( rType ); 300 } 301 302 //========================================================================= 303 // 304 // XTypeProvider methods. 305 // 306 //========================================================================= 307 308 // virtual 309 uno::Sequence< sal_Int8 > SAL_CALL InteractionAbort::getImplementationId() 310 throw( uno::RuntimeException ) 311 { 312 static cppu::OImplementationId* pId = NULL; 313 if ( !pId ) 314 { 315 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 316 if ( !pId ) 317 { 318 static cppu::OImplementationId id( sal_False ); 319 pId = &id; 320 } 321 } 322 return (*pId).getImplementationId(); 323 } 324 325 //========================================================================= 326 // virtual 327 uno::Sequence< uno::Type > SAL_CALL InteractionAbort::getTypes() 328 throw( uno::RuntimeException ) 329 { 330 static cppu::OTypeCollection* pCollection = 0; 331 if ( !pCollection ) 332 { 333 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 334 if ( !pCollection ) 335 { 336 static cppu::OTypeCollection collection( 337 getCppuType( static_cast< 338 uno::Reference< lang::XTypeProvider > * >( 0 ) ), 339 getCppuType( static_cast< 340 uno::Reference< task::XInteractionAbort > * >( 0 ) ) ); 341 pCollection = &collection; 342 } 343 } 344 return (*pCollection).getTypes(); 345 } 346 347 //========================================================================= 348 // 349 // XInteractionContinuation methods. 350 // 351 //========================================================================= 352 353 // virtual 354 void SAL_CALL InteractionAbort::select() 355 throw( uno::RuntimeException ) 356 { 357 recordSelection(); 358 } 359 360 //========================================================================= 361 //========================================================================= 362 // 363 // InteractionRetry Implementation. 364 // 365 //========================================================================= 366 //========================================================================= 367 368 //========================================================================= 369 // 370 // XInterface methods. 371 // 372 //========================================================================= 373 374 // virtual 375 void SAL_CALL InteractionRetry::acquire() 376 throw() 377 { 378 OWeakObject::acquire(); 379 } 380 381 //========================================================================= 382 // virtual 383 void SAL_CALL InteractionRetry::release() 384 throw() 385 { 386 OWeakObject::release(); 387 } 388 389 //========================================================================= 390 // virtual 391 uno::Any SAL_CALL 392 InteractionRetry::queryInterface( const uno::Type & rType ) 393 throw ( uno::RuntimeException ) 394 { 395 uno::Any aRet = cppu::queryInterface( rType, 396 static_cast< lang::XTypeProvider * >( this ), 397 static_cast< task::XInteractionContinuation * >( this ), 398 static_cast< task::XInteractionRetry * >( this ) ); 399 400 return aRet.hasValue() 401 ? aRet : InteractionContinuation::queryInterface( rType ); 402 } 403 404 //========================================================================= 405 // 406 // XTypeProvider methods. 407 // 408 //========================================================================= 409 410 // virtual 411 uno::Sequence< sal_Int8 > SAL_CALL InteractionRetry::getImplementationId() 412 throw( uno::RuntimeException ) 413 { 414 static cppu::OImplementationId* pId = NULL; 415 if ( !pId ) 416 { 417 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 418 if ( !pId ) 419 { 420 static cppu::OImplementationId id( sal_False ); 421 pId = &id; 422 } 423 } 424 return (*pId).getImplementationId(); 425 } 426 427 //========================================================================= 428 // virtual 429 uno::Sequence< uno::Type > SAL_CALL InteractionRetry::getTypes() 430 throw( uno::RuntimeException ) 431 { 432 static cppu::OTypeCollection* pCollection = 0; 433 if ( !pCollection ) 434 { 435 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 436 if ( !pCollection ) 437 { 438 static cppu::OTypeCollection collection( 439 getCppuType( static_cast< 440 uno::Reference< lang::XTypeProvider > * >( 0 ) ), 441 getCppuType( static_cast< 442 uno::Reference< task::XInteractionRetry > * >( 0 ) ) ); 443 pCollection = &collection; 444 } 445 } 446 return (*pCollection).getTypes(); 447 } 448 449 //========================================================================= 450 // 451 // XInteractionContinuation methods. 452 // 453 //========================================================================= 454 455 // virtual 456 void SAL_CALL InteractionRetry::select() 457 throw( uno::RuntimeException ) 458 { 459 recordSelection(); 460 } 461 462 //========================================================================= 463 //========================================================================= 464 // 465 // InteractionApprove Implementation. 466 // 467 //========================================================================= 468 //========================================================================= 469 470 //========================================================================= 471 // 472 // XInterface methods. 473 // 474 //========================================================================= 475 476 // virtual 477 void SAL_CALL InteractionApprove::acquire() 478 throw() 479 { 480 OWeakObject::acquire(); 481 } 482 483 //========================================================================= 484 // virtual 485 void SAL_CALL InteractionApprove::release() 486 throw() 487 { 488 OWeakObject::release(); 489 } 490 491 //========================================================================= 492 // virtual 493 uno::Any SAL_CALL 494 InteractionApprove::queryInterface( const uno::Type & rType ) 495 throw ( uno::RuntimeException ) 496 { 497 uno::Any aRet = cppu::queryInterface( rType, 498 static_cast< lang::XTypeProvider * >( this ), 499 static_cast< task::XInteractionContinuation * >( this ), 500 static_cast< task::XInteractionApprove * >( this ) ); 501 502 return aRet.hasValue() 503 ? aRet : InteractionContinuation::queryInterface( rType ); 504 } 505 506 //========================================================================= 507 // 508 // XTypeProvider methods. 509 // 510 //========================================================================= 511 512 // virtual 513 uno::Sequence< sal_Int8 > SAL_CALL InteractionApprove::getImplementationId() 514 throw( uno::RuntimeException ) 515 { 516 static cppu::OImplementationId* pId = NULL; 517 if ( !pId ) 518 { 519 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 520 if ( !pId ) 521 { 522 static cppu::OImplementationId id( sal_False ); 523 pId = &id; 524 } 525 } 526 return (*pId).getImplementationId(); 527 } 528 529 //========================================================================= 530 // virtual 531 uno::Sequence< uno::Type > SAL_CALL InteractionApprove::getTypes() 532 throw( uno::RuntimeException ) 533 { 534 static cppu::OTypeCollection* pCollection = 0; 535 if ( !pCollection ) 536 { 537 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 538 if ( !pCollection ) 539 { 540 static cppu::OTypeCollection collection( 541 getCppuType( static_cast< 542 uno::Reference< lang::XTypeProvider > * >( 0 ) ), 543 getCppuType( static_cast< 544 uno::Reference< task::XInteractionApprove > * >( 0 ) ) ); 545 pCollection = &collection; 546 } 547 } 548 return (*pCollection).getTypes(); 549 } 550 551 //========================================================================= 552 // 553 // XInteractionContinuation methods. 554 // 555 //========================================================================= 556 557 // virtual 558 void SAL_CALL InteractionApprove::select() 559 throw( uno::RuntimeException ) 560 { 561 recordSelection(); 562 } 563 564 //========================================================================= 565 //========================================================================= 566 // 567 // InteractionDisapprove Implementation. 568 // 569 //========================================================================= 570 //========================================================================= 571 572 //========================================================================= 573 // 574 // XInterface methods. 575 // 576 //========================================================================= 577 578 // virtual 579 void SAL_CALL InteractionDisapprove::acquire() 580 throw() 581 { 582 OWeakObject::acquire(); 583 } 584 585 //========================================================================= 586 // virtual 587 void SAL_CALL InteractionDisapprove::release() 588 throw() 589 { 590 OWeakObject::release(); 591 } 592 593 //========================================================================= 594 // virtual 595 uno::Any SAL_CALL 596 InteractionDisapprove::queryInterface( const uno::Type & rType ) 597 throw ( uno::RuntimeException ) 598 { 599 uno::Any aRet = cppu::queryInterface( rType, 600 static_cast< lang::XTypeProvider * >( this ), 601 static_cast< task::XInteractionContinuation * >( this ), 602 static_cast< task::XInteractionDisapprove * >( this ) ); 603 604 return aRet.hasValue() 605 ? aRet : InteractionContinuation::queryInterface( rType ); 606 } 607 608 //========================================================================= 609 // 610 // XTypeProvider methods. 611 // 612 //========================================================================= 613 614 // virtual 615 uno::Sequence< sal_Int8 > SAL_CALL InteractionDisapprove::getImplementationId() 616 throw( uno::RuntimeException ) 617 { 618 static cppu::OImplementationId* pId = NULL; 619 if ( !pId ) 620 { 621 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 622 if ( !pId ) 623 { 624 static cppu::OImplementationId id( sal_False ); 625 pId = &id; 626 } 627 } 628 return (*pId).getImplementationId(); 629 } 630 631 //========================================================================= 632 // virtual 633 uno::Sequence< uno::Type > SAL_CALL InteractionDisapprove::getTypes() 634 throw( uno::RuntimeException ) 635 { 636 static cppu::OTypeCollection* pCollection = 0; 637 if ( !pCollection ) 638 { 639 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 640 if ( !pCollection ) 641 { 642 static cppu::OTypeCollection collection( 643 getCppuType( static_cast< 644 uno::Reference< lang::XTypeProvider > * >( 0 ) ), 645 getCppuType( static_cast< 646 uno::Reference< task::XInteractionDisapprove > * >( 0 ) ) ); 647 pCollection = &collection; 648 } 649 } 650 return (*pCollection).getTypes(); 651 } 652 653 //========================================================================= 654 // 655 // XInteractionContinuation methods. 656 // 657 //========================================================================= 658 659 // virtual 660 void SAL_CALL InteractionDisapprove::select() 661 throw( uno::RuntimeException ) 662 { 663 recordSelection(); 664 } 665 666 //========================================================================= 667 //========================================================================= 668 // 669 // InteractionSupplyAuthentication Implementation. 670 // 671 //========================================================================= 672 //========================================================================= 673 674 //========================================================================= 675 // 676 // XInterface methods. 677 // 678 //========================================================================= 679 680 // virtual 681 void SAL_CALL InteractionSupplyAuthentication::acquire() 682 throw() 683 { 684 OWeakObject::acquire(); 685 } 686 687 //========================================================================= 688 // virtual 689 void SAL_CALL InteractionSupplyAuthentication::release() 690 throw() 691 { 692 OWeakObject::release(); 693 } 694 695 //========================================================================= 696 // virtual 697 uno::Any SAL_CALL 698 InteractionSupplyAuthentication::queryInterface( const uno::Type & rType ) 699 throw ( uno::RuntimeException ) 700 { 701 uno::Any aRet = cppu::queryInterface( rType, 702 static_cast< lang::XTypeProvider * >( this ), 703 static_cast< task::XInteractionContinuation * >( this ), 704 static_cast< ucb::XInteractionSupplyAuthentication * >( this ), 705 static_cast< ucb::XInteractionSupplyAuthentication2 * >( this )); 706 707 return aRet.hasValue() 708 ? aRet : InteractionContinuation::queryInterface( rType ); 709 } 710 711 //========================================================================= 712 // 713 // XTypeProvider methods. 714 // 715 //========================================================================= 716 717 // virtual 718 uno::Sequence< sal_Int8 > SAL_CALL 719 InteractionSupplyAuthentication::getImplementationId() 720 throw( uno::RuntimeException ) 721 { 722 static cppu::OImplementationId* pId = NULL; 723 if ( !pId ) 724 { 725 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 726 if ( !pId ) 727 { 728 static cppu::OImplementationId id( sal_False ); 729 pId = &id; 730 } 731 } 732 return (*pId).getImplementationId(); 733 } 734 735 //========================================================================= 736 // virtual 737 uno::Sequence< uno::Type > SAL_CALL InteractionSupplyAuthentication::getTypes() 738 throw( uno::RuntimeException ) 739 { 740 static cppu::OTypeCollection* pCollection = 0; 741 if ( !pCollection ) 742 { 743 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 744 if ( !pCollection ) 745 { 746 static cppu::OTypeCollection collection( 747 getCppuType( static_cast< 748 uno::Reference< lang::XTypeProvider > * >( 0 ) ), 749 getCppuType( static_cast< 750 uno::Reference< 751 ucb::XInteractionSupplyAuthentication2 > * >( 0 ) ) ); 752 pCollection = &collection; 753 } 754 } 755 return (*pCollection).getTypes(); 756 } 757 758 //========================================================================= 759 // 760 // XInteractionContinuation methods. 761 // 762 //========================================================================= 763 764 // virtual 765 void SAL_CALL InteractionSupplyAuthentication::select() 766 throw( uno::RuntimeException ) 767 { 768 recordSelection(); 769 } 770 771 //========================================================================= 772 // 773 // XInteractionSupplyAuthentication methods. 774 // 775 //========================================================================= 776 777 // virtual 778 sal_Bool SAL_CALL 779 InteractionSupplyAuthentication::canSetRealm() 780 throw( uno::RuntimeException ) 781 { 782 return m_bCanSetRealm; 783 } 784 785 //========================================================================= 786 // virtual 787 void SAL_CALL 788 InteractionSupplyAuthentication::setRealm( const rtl::OUString& Realm ) 789 throw( uno::RuntimeException ) 790 { 791 OSL_ENSURE( m_bCanSetPassword, 792 "InteractionSupplyAuthentication::setRealm - Not supported!" ); 793 794 if ( m_bCanSetRealm ) 795 m_aRealm = Realm; 796 } 797 798 //========================================================================= 799 // virtual 800 sal_Bool SAL_CALL 801 InteractionSupplyAuthentication::canSetUserName() 802 throw( uno::RuntimeException ) 803 { 804 return m_bCanSetUserName; 805 } 806 807 //========================================================================= 808 // virtual 809 void SAL_CALL 810 InteractionSupplyAuthentication::setUserName( const rtl::OUString& UserName ) 811 throw( uno::RuntimeException ) 812 { 813 OSL_ENSURE( m_bCanSetUserName, 814 "InteractionSupplyAuthentication::setUserName - Not supported!" ); 815 816 if ( m_bCanSetUserName ) 817 m_aUserName = UserName; 818 } 819 820 //========================================================================= 821 // virtual 822 sal_Bool SAL_CALL 823 InteractionSupplyAuthentication::canSetPassword() 824 throw( uno::RuntimeException ) 825 { 826 return m_bCanSetPassword; 827 } 828 829 //========================================================================= 830 // virtual 831 void SAL_CALL 832 InteractionSupplyAuthentication::setPassword( const rtl::OUString& Password ) 833 throw( uno::RuntimeException ) 834 { 835 OSL_ENSURE( m_bCanSetPassword, 836 "InteractionSupplyAuthentication::setPassword - Not supported!" ); 837 838 if ( m_bCanSetPassword ) 839 m_aPassword = Password; 840 } 841 842 //========================================================================= 843 // virtual 844 uno::Sequence< ucb::RememberAuthentication > SAL_CALL 845 InteractionSupplyAuthentication::getRememberPasswordModes( 846 ucb::RememberAuthentication& Default ) 847 throw( uno::RuntimeException ) 848 { 849 Default = m_eDefaultRememberPasswordMode; 850 return m_aRememberPasswordModes; 851 } 852 853 //========================================================================= 854 // virtual 855 void SAL_CALL 856 InteractionSupplyAuthentication::setRememberPassword( 857 ucb::RememberAuthentication Remember ) 858 throw( uno::RuntimeException ) 859 { 860 m_eRememberPasswordMode = Remember; 861 } 862 863 //========================================================================= 864 // virtual 865 sal_Bool SAL_CALL 866 InteractionSupplyAuthentication::canSetAccount() 867 throw( uno::RuntimeException ) 868 { 869 return m_bCanSetAccount; 870 } 871 872 //========================================================================= 873 // virtual 874 void SAL_CALL 875 InteractionSupplyAuthentication::setAccount( const rtl::OUString& Account ) 876 throw( uno::RuntimeException ) 877 { 878 OSL_ENSURE( m_bCanSetAccount, 879 "InteractionSupplyAuthentication::setAccount - Not supported!" ); 880 881 if ( m_bCanSetAccount ) 882 m_aAccount = Account; 883 } 884 885 //========================================================================= 886 // virtual 887 uno::Sequence< ucb::RememberAuthentication > SAL_CALL 888 InteractionSupplyAuthentication::getRememberAccountModes( 889 ucb::RememberAuthentication& Default ) 890 throw( uno::RuntimeException ) 891 { 892 Default = m_eDefaultRememberAccountMode; 893 return m_aRememberAccountModes; 894 } 895 896 //========================================================================= 897 // virtual 898 void SAL_CALL InteractionSupplyAuthentication::setRememberAccount( 899 ucb::RememberAuthentication Remember ) 900 throw( uno::RuntimeException ) 901 { 902 m_eRememberAccountMode = Remember; 903 } 904 905 //========================================================================= 906 // 907 // XInteractionSupplyAuthentication2 methods. 908 // 909 //========================================================================= 910 911 // virtual 912 ::sal_Bool SAL_CALL 913 InteractionSupplyAuthentication::canUseSystemCredentials( 914 ::sal_Bool& Default ) 915 throw ( uno::RuntimeException ) 916 { 917 Default = m_bDefaultUseSystemCredentials; 918 return m_bCanUseSystemCredentials; 919 } 920 921 //========================================================================= 922 // virtual 923 void SAL_CALL InteractionSupplyAuthentication::setUseSystemCredentials( 924 ::sal_Bool UseSystemCredentials ) 925 throw ( uno::RuntimeException ) 926 { 927 if ( m_bCanUseSystemCredentials ) 928 m_bUseSystemCredentials = UseSystemCredentials; 929 } 930 931 932 //========================================================================= 933 //========================================================================= 934 // 935 // InteractionSupplyName Implementation. 936 // 937 //========================================================================= 938 //========================================================================= 939 940 //========================================================================= 941 // 942 // XInterface methods. 943 // 944 //========================================================================= 945 946 // virtual 947 void SAL_CALL InteractionSupplyName::acquire() 948 throw() 949 { 950 OWeakObject::acquire(); 951 } 952 953 //========================================================================= 954 // virtual 955 void SAL_CALL InteractionSupplyName::release() 956 throw() 957 { 958 OWeakObject::release(); 959 } 960 961 //========================================================================= 962 // virtual 963 uno::Any SAL_CALL 964 InteractionSupplyName::queryInterface( const uno::Type & rType ) 965 throw ( uno::RuntimeException ) 966 { 967 uno::Any aRet = cppu::queryInterface( rType, 968 static_cast< lang::XTypeProvider * >( this ), 969 static_cast< task::XInteractionContinuation * >( this ), 970 static_cast< ucb::XInteractionSupplyName * >( this ) ); 971 972 return aRet.hasValue() 973 ? aRet : InteractionContinuation::queryInterface( rType ); 974 } 975 976 //========================================================================= 977 // 978 // XTypeProvider methods. 979 // 980 //========================================================================= 981 982 // virtual 983 uno::Sequence< sal_Int8 > SAL_CALL InteractionSupplyName::getImplementationId() 984 throw( uno::RuntimeException ) 985 { 986 static cppu::OImplementationId* pId = NULL; 987 if ( !pId ) 988 { 989 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 990 if ( !pId ) 991 { 992 static cppu::OImplementationId id( sal_False ); 993 pId = &id; 994 } 995 } 996 return (*pId).getImplementationId(); 997 } 998 999 //========================================================================= 1000 // virtual 1001 uno::Sequence< uno::Type > SAL_CALL InteractionSupplyName::getTypes() 1002 throw( uno::RuntimeException ) 1003 { 1004 static cppu::OTypeCollection* pCollection = 0; 1005 if ( !pCollection ) 1006 { 1007 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 1008 if ( !pCollection ) 1009 { 1010 static cppu::OTypeCollection collection( 1011 getCppuType( static_cast< 1012 uno::Reference< lang::XTypeProvider > * >( 0 ) ), 1013 getCppuType( static_cast< 1014 uno::Reference< ucb::XInteractionSupplyName > * >( 0 ) ) ); 1015 pCollection = &collection; 1016 } 1017 } 1018 return (*pCollection).getTypes(); 1019 } 1020 1021 //========================================================================= 1022 // 1023 // XInteractionContinuation methods. 1024 // 1025 //========================================================================= 1026 1027 // virtual 1028 void SAL_CALL InteractionSupplyName::select() 1029 throw( uno::RuntimeException ) 1030 { 1031 recordSelection(); 1032 } 1033 1034 //========================================================================= 1035 // 1036 // XInteractionSupplyName methods. 1037 // 1038 //========================================================================= 1039 1040 // virtual 1041 void SAL_CALL 1042 InteractionSupplyName::setName( const rtl::OUString& Name ) 1043 throw( uno::RuntimeException ) 1044 { 1045 m_aName = Name; 1046 } 1047 1048 //========================================================================= 1049 //========================================================================= 1050 // 1051 // InteractionReplaceExistingData Implementation. 1052 // 1053 //========================================================================= 1054 //========================================================================= 1055 1056 //========================================================================= 1057 // 1058 // XInterface methods. 1059 // 1060 //========================================================================= 1061 1062 // virtual 1063 void SAL_CALL InteractionReplaceExistingData::acquire() 1064 throw() 1065 { 1066 OWeakObject::acquire(); 1067 } 1068 1069 //========================================================================= 1070 // virtual 1071 void SAL_CALL InteractionReplaceExistingData::release() 1072 throw() 1073 { 1074 OWeakObject::release(); 1075 } 1076 1077 //========================================================================= 1078 // virtual 1079 uno::Any SAL_CALL 1080 InteractionReplaceExistingData::queryInterface( const uno::Type & rType ) 1081 throw ( uno::RuntimeException ) 1082 { 1083 uno::Any aRet = cppu::queryInterface( rType, 1084 static_cast< lang::XTypeProvider * >( this ), 1085 static_cast< task::XInteractionContinuation * >( this ), 1086 static_cast< ucb::XInteractionReplaceExistingData * >( this ) ); 1087 1088 return aRet.hasValue() 1089 ? aRet : InteractionContinuation::queryInterface( rType ); 1090 } 1091 1092 //========================================================================= 1093 // 1094 // XTypeProvider methods. 1095 // 1096 //========================================================================= 1097 1098 // virtual 1099 uno::Sequence< sal_Int8 > SAL_CALL 1100 InteractionReplaceExistingData::getImplementationId() 1101 throw( uno::RuntimeException ) 1102 { 1103 static cppu::OImplementationId* pId = NULL; 1104 if ( !pId ) 1105 { 1106 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 1107 if ( !pId ) 1108 { 1109 static cppu::OImplementationId id( sal_False ); 1110 pId = &id; 1111 } 1112 } 1113 return (*pId).getImplementationId(); 1114 } 1115 1116 //========================================================================= 1117 // virtual 1118 uno::Sequence< uno::Type > SAL_CALL InteractionReplaceExistingData::getTypes() 1119 throw( uno::RuntimeException ) 1120 { 1121 static cppu::OTypeCollection* pCollection = 0; 1122 if ( !pCollection ) 1123 { 1124 osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); 1125 if ( !pCollection ) 1126 { 1127 static cppu::OTypeCollection collection( 1128 getCppuType( static_cast< 1129 uno::Reference< lang::XTypeProvider > * >( 0 ) ), 1130 getCppuType( static_cast< 1131 uno::Reference< 1132 ucb::XInteractionReplaceExistingData > * >( 0 ) ) ); 1133 pCollection = &collection; 1134 } 1135 } 1136 return (*pCollection).getTypes(); 1137 } 1138 1139 //========================================================================= 1140 // 1141 // XInteractionContinuation methods. 1142 // 1143 //========================================================================= 1144 1145 // virtual 1146 void SAL_CALL InteractionReplaceExistingData::select() 1147 throw( uno::RuntimeException ) 1148 { 1149 recordSelection(); 1150 } 1151 1152