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 __FRAMEWORK_LOGINDIALOG_LOGINDIALOG_HXX_ 29 #define __FRAMEWORK_LOGINDIALOG_LOGINDIALOG_HXX_ 30 31 //_________________________________________________________________________________________________________________ 32 // my own includes 33 //_________________________________________________________________________________________________________________ 34 35 #ifndef __FRAMEWORK_THREADHELPER_THREADHELPBASE_HXX_ 36 #include <threadhelp/threadhelpbase.hxx> 37 #endif 38 #include <macros/generic.hxx> 39 #include <macros/debug.hxx> 40 #include <macros/xinterface.hxx> 41 #include <macros/xtypeprovider.hxx> 42 #include <macros/xserviceinfo.hxx> 43 44 #include <services/logindialog.hrc> 45 46 //_________________________________________________________________________________________________________________ 47 // interface includes 48 //_________________________________________________________________________________________________________________ 49 #include <com/sun/star/awt/XDialog.hpp> 50 #include <com/sun/star/lang/IllegalArgumentException.hpp> 51 #include <com/sun/star/beans/XPropertySetInfo.hpp> 52 #include <com/sun/star/beans/Property.hpp> 53 #include <com/sun/star/beans/PropertyValue.hpp> 54 #include <com/sun/star/lang/Locale.hpp> 55 #include <com/sun/star/util/XFlushable.hpp> 56 57 //_________________________________________________________________________________________________________________ 58 // other includes 59 //_________________________________________________________________________________________________________________ 60 #include <tools/config.hxx> 61 #include <cppuhelper/weak.hxx> 62 #include <cppuhelper/propshlp.hxx> 63 #include <vcl/dialog.hxx> 64 #include <vcl/fixed.hxx> 65 #include <vcl/edit.hxx> 66 #include <vcl/combobox.hxx> 67 68 #ifndef _SV_BUTTON_HXX 69 #include <vcl/button.hxx> 70 #endif 71 72 #ifndef _SV_BUTTON_HXX 73 #include <vcl/button.hxx> 74 #endif 75 #include <vcl/morebtn.hxx> 76 77 //_________________________________________________________________________________________________________________ 78 // namespace 79 //_________________________________________________________________________________________________________________ 80 81 namespace framework{ 82 83 #define ANY ::com::sun::star::uno::Any 84 #define EXCEPTION ::com::sun::star::uno::Exception 85 #define ILLEGALARGUMENTEXCEPTION ::com::sun::star::lang::IllegalArgumentException 86 #define IPROPERTYARRAYHELPER ::cppu::IPropertyArrayHelper 87 #define OBROADCASTHELPER ::cppu::OBroadcastHelper 88 #define OPROPERTYSETHELPER ::cppu::OPropertySetHelper 89 #define OUSTRING ::rtl::OUString 90 #define OWEAKOBJECT ::cppu::OWeakObject 91 #define PROPERTY ::com::sun::star::beans::Property 92 #define REFERENCE ::com::sun::star::uno::Reference 93 #define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException 94 #define SEQUENCE ::com::sun::star::uno::Sequence 95 #define XDIALOG ::com::sun::star::awt::XDialog 96 #define XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory 97 #define XPROPERTYSETINFO ::com::sun::star::beans::XPropertySetInfo 98 #define XSERVICEINFO ::com::sun::star::lang::XServiceInfo 99 #define XTYPEPROVIDER ::com::sun::star::lang::XTypeProvider 100 #define PROPERTYVALUE ::com::sun::star::beans::PropertyValue 101 #define LOCALE ::com::sun::star::lang::Locale 102 #define XFLUSHABLE ::com::sun::star::util::XFlushable 103 #define XFLUSHLISTENER ::com::sun::star::util::XFlushListener 104 105 //_________________________________________________________________________________________________________________ 106 // exported const 107 //_________________________________________________________________________________________________________________ 108 109 #ifdef WNT 110 #define ININAME DECLARE_ASCII("login.ini") 111 #elif defined UNIX 112 #define ININAME DECLARE_ASCII("loginrc") 113 #else 114 #error "name of login profile unknown!" 115 #endif 116 117 #define UNCPATHSEPERATOR sal_Unicode(0x002F) 118 #define MAX_SERVERHISTORY 10 119 120 // Use follow keys in follow order. 121 // [Global] 122 // UserName=as 123 // ActiveServer=2 124 // ConnectionType=https 125 // Language=en-US 126 // UseProxy=[browser|custom|none] 127 // SecurityProxy=so-webcache:3128 128 // dialog=[big|small] 129 // 130 // [DefaultPorts] 131 // https=8445 132 // http=8090 133 // 134 // [ServerHistory] 135 // Server_1=localhost 136 // Server_2=munch:7202 137 // Server_3=www.xxx.com:8000 138 139 #define SECTION_GLOBAL "Global" 140 #define SECTION_DEFAULTPORTS "DefaultPorts" 141 #define SECTION_SERVERHISTORY "ServerHistory" 142 143 #define SECTION_USERNAME SECTION_GLOBAL 144 #define SECTION_ACTIVESERVER SECTION_GLOBAL 145 #define SECTION_CONNECTIONTYPE SECTION_GLOBAL 146 #define SECTION_LANGUAGE SECTION_GLOBAL 147 #define SECTION_SECURITYPROXY SECTION_GLOBAL 148 #define SECTION_DIALOG SECTION_GLOBAL 149 #define SECTION_HTTP SECTION_DEFAULTPORTS 150 #define SECTION_HTTPS SECTION_DEFAULTPORTS 151 #define SECTION_SERVER_X SECTION_SERVERHISTORY 152 153 #define KEY_USERNAME "UserName" 154 #define KEY_ACTIVESERVER "ActiveServer" 155 #define KEY_CONNECTIONTYPE "ConnectionType" 156 #define KEY_LANGUAGE "Language" 157 #define KEY_SERVER_X "Server_" 158 #define KEY_SECURITYPROXY "SecurityProxy" 159 #define KEY_USESECURITYPROXY "UseProxy" 160 #define KEY_DIALOG "dialog" 161 #define KEY_HTTP "http" 162 #define KEY_HTTPS "https" 163 164 #define PROPERTYNAME_CONNECTIONTYPE DECLARE_ASCII("ConnectionType" ) 165 #define PROPERTYNAME_LANGUAGE DECLARE_ASCII("Language" ) 166 #define PROPERTYNAME_PARENTWINDOW DECLARE_ASCII("ParentWindow" ) 167 #define PROPERTYNAME_PASSWORD DECLARE_ASCII("Password" ) 168 #define PROPERTYNAME_SECURITYPROXY DECLARE_ASCII("SecurityProxy" ) 169 #define PROPERTYNAME_SERVER DECLARE_ASCII("Server" ) 170 #define PROPERTYNAME_SERVERHISTORY DECLARE_ASCII("ServerHistory" ) 171 #define PROPERTYNAME_USERNAME DECLARE_ASCII("UserName" ) 172 #define PROPERTYNAME_USEPROXY DECLARE_ASCII("UseProxy" ) 173 #define PROPERTYNAME_DIALOG DECLARE_ASCII("Dialog" ) 174 #define PROPERTYNAME_HTTP DECLARE_ASCII("http" ) 175 #define PROPERTYNAME_HTTPS DECLARE_ASCII("https" ) 176 177 #define PROPERTYHANDLE_CONNECTIONTYPE 1 178 #define PROPERTYHANDLE_LANGUAGE 2 179 #define PROPERTYHANDLE_PARENTWINDOW 3 180 #define PROPERTYHANDLE_PASSWORD 4 181 #define PROPERTYHANDLE_SERVER 5 182 #define PROPERTYHANDLE_SERVERHISTORY 6 183 #define PROPERTYHANDLE_USERNAME 7 184 #define PROPERTYHANDLE_SECURITYPROXY 8 185 #define PROPERTYHANDLE_USEPROXY 9 186 #define PROPERTYHANDLE_DIALOG 10 187 #define PROPERTYHANDLE_HTTP 11 188 #define PROPERTYHANDLE_HTTPS 12 189 190 #define PROPERTYCOUNT 12 191 192 //_________________________________________________________________________________________________________________ 193 // exported definitions 194 //_________________________________________________________________________________________________________________ 195 196 struct tIMPL_DialogData 197 { 198 OUSTRING sUserName ; 199 OUSTRING sPassword ; 200 SEQUENCE< OUSTRING > seqServerList ; 201 sal_Int32 nActiveServer ; 202 OUSTRING sConnectionType ; 203 LOCALE aLanguage ; 204 sal_Int32 nPortHttp ; 205 sal_Int32 nPortHttps ; 206 ANY aParentWindow ; 207 OUSTRING sSecurityProxy ; 208 OUSTRING sUseProxy ; 209 OUSTRING sDialog ; 210 sal_Bool bProxyChanged ; 211 212 // default ctor to initialize empty structure. 213 tIMPL_DialogData() 214 : sUserName ( OUSTRING() ) 215 , sPassword ( OUSTRING() ) 216 , seqServerList ( SEQUENCE< OUSTRING >() ) 217 , nActiveServer ( 1 ) 218 , sConnectionType ( OUSTRING() ) 219 , aLanguage ( OUSTRING(), OUSTRING(), OUSTRING() ) 220 , nPortHttp ( 0 ) 221 , nPortHttps ( 0 ) 222 , aParentWindow ( ) 223 , sSecurityProxy ( OUSTRING() ) 224 , sUseProxy ( OUSTRING() ) 225 , sDialog ( OUSTRING() ) 226 , bProxyChanged ( sal_False ) 227 { 228 } 229 230 // copy ctor to initialize structure with values from another one. 231 tIMPL_DialogData( const tIMPL_DialogData& aCopyDataSet ) 232 : sUserName ( aCopyDataSet.sUserName ) 233 , sPassword ( aCopyDataSet.sPassword ) 234 , seqServerList ( aCopyDataSet.seqServerList ) 235 , nActiveServer ( aCopyDataSet.nActiveServer ) 236 , sConnectionType ( aCopyDataSet.sConnectionType ) 237 , aLanguage ( aCopyDataSet.aLanguage ) 238 , nPortHttp ( aCopyDataSet.nPortHttp ) 239 , nPortHttps ( aCopyDataSet.nPortHttps ) 240 , aParentWindow ( aCopyDataSet.aParentWindow ) 241 , sSecurityProxy ( aCopyDataSet.sSecurityProxy ) 242 , sUseProxy ( aCopyDataSet.sUseProxy ) 243 , sDialog ( aCopyDataSet.sDialog ) 244 , bProxyChanged ( aCopyDataSet.bProxyChanged ) 245 { 246 } 247 248 // assignment operator to cop values from another struct to this one. 249 tIMPL_DialogData& operator=( const tIMPL_DialogData& aCopyDataSet ) 250 { 251 sUserName = aCopyDataSet.sUserName ; 252 sPassword = aCopyDataSet.sPassword ; 253 seqServerList = aCopyDataSet.seqServerList ; 254 nActiveServer = aCopyDataSet.nActiveServer ; 255 sConnectionType = aCopyDataSet.sConnectionType ; 256 aLanguage = aCopyDataSet.aLanguage ; 257 nPortHttp = aCopyDataSet.nPortHttp ; 258 nPortHttps = aCopyDataSet.nPortHttps ; 259 aParentWindow = aCopyDataSet.aParentWindow ; 260 sSecurityProxy = aCopyDataSet.sSecurityProxy ; 261 sUseProxy = aCopyDataSet.sUseProxy ; 262 sDialog = aCopyDataSet.sDialog ; 263 bProxyChanged = aCopyDataSet.bProxyChanged ; 264 return *this; 265 } 266 }; 267 268 /*-************************************************************************************************************//** 269 @short implements an "private inline" dialog class used by follow class LoginDialog to show the dialog 270 @descr This is a VCL- modal dialog and not threadsafe! We use it as private definition in the context of login dialog only! 271 272 @implements - 273 274 @base ModalDialog 275 *//*-*************************************************************************************************************/ 276 277 class cIMPL_Dialog : public ModalDialog 278 { 279 //------------------------------------------------------------------------------------------------------------- 280 // public methods 281 //------------------------------------------------------------------------------------------------------------- 282 283 public: 284 285 /*-****************************************************************************************************//** 286 @short default ctor 287 @descr This ctor initialize the dialog, load ressources but not set values on edits or check boxes! 288 These is implemented by setValues() on the same class. 289 You must give us a language identifier to describe which ressource should be used! 290 291 @seealso method setValues() 292 293 @param "aLanguage" , identifier to describe ressource language 294 @param "pParent" , parent window handle for dialog! If is it NULL -> no parent exist ... 295 @return - 296 297 @onerror - 298 *//*-*****************************************************************************************************/ 299 300 cIMPL_Dialog( ::com::sun::star::lang::Locale aLocale, Window* pParent ); 301 302 /*-****************************************************************************************************//** 303 @short default dtor 304 @descr This dtor deinitialize the dialog and free all used ressources. 305 But you can't get the values of the dialog. Use getValues() to do this. 306 307 @seealso method getValues() 308 309 @param - 310 @return - 311 312 @onerror - 313 *//*-*****************************************************************************************************/ 314 315 ~cIMPL_Dialog(); 316 317 /*-****************************************************************************************************//** 318 @short set new values on dialog to show 319 @descr Use this to initialize the dialg with new values for showing before execute. 320 321 @seealso method getValues() 322 323 @param "aDataSet"; struct of variables to set it on dialog controls 324 @return - 325 326 @onerror - 327 *//*-*****************************************************************************************************/ 328 329 void setValues( const tIMPL_DialogData& aDataSet ); 330 331 /*-****************************************************************************************************//** 332 @short get current values from dialog controls 333 @descr Use this if you will get all values of dialog after execute. 334 335 @seealso method setValues() 336 337 @param "aDataSet"; struct of variables filled by dialog 338 @return - 339 340 @onerror - 341 *//*-*****************************************************************************************************/ 342 343 tIMPL_DialogData getValues(); 344 345 /*-****************************************************************************************************/ 346 /* handler 347 */ 348 349 DECL_LINK( ClickHdl, void* ); 350 351 //------------------------------------------------------------------------------------------------------------- 352 // private methods 353 //------------------------------------------------------------------------------------------------------------- 354 355 private: 356 void setCustomSettings(); 357 358 void showDialogExpanded(); 359 void showDialogCollapsed(); 360 361 /*-****************************************************************************************************//** 362 @short get a host and port from a concated string form <host>:<port> 363 364 @param "aProxyHostPort" ; a string with the following format <host>:<port> 365 @param "aHost" ; a host string 366 @param "aPort" ; a port string 367 @return - 368 369 @onerror - 370 *//*-*****************************************************************************************************/ 371 372 void getProxyHostPort( const OUSTRING& aProxyHostPort, OUSTRING& aHost, OUSTRING& aPort ); 373 374 /*-****************************************************************************************************//** 375 @short get a ressource for given id from right ressource file 376 @descr This dialog need his own ressource. We can't use the global ressource manager! 377 We must use our own. 378 You must give us the ressource language. If no right ressource could be found - 379 any existing one is used automaticly! 380 381 @seealso method setValues() 382 383 @param "nId" ; id to convert it in right ressource id 384 @param "aLanguage" ; type of ressource language 385 @return - 386 387 @onerror - 388 *//*-*****************************************************************************************************/ 389 390 static ResId impl_getResId( sal_uInt16 nId , 391 ::com::sun::star::lang::Locale aLocale ); 392 393 //------------------------------------------------------------------------------------------------------------- 394 // private member 395 //------------------------------------------------------------------------------------------------------------- 396 397 private: 398 399 FixedImage m_imageHeader ; 400 FixedText m_textLoginText ; 401 FixedText m_textUserName ; 402 Edit m_editUserName ; 403 FixedText m_textPassword ; 404 Edit m_editPassword ; 405 FixedLine m_fixedLineServer ; 406 FixedText m_textServer ; 407 ComboBox m_comboServer ; 408 FixedLine m_fixedLineProxySettings ; 409 RadioButton m_radioNoProxy ; 410 RadioButton m_radioBrowserProxy ; 411 RadioButton m_radioCustomProxy ; 412 FixedText m_textSecurityProxy ; 413 FixedText m_textSecurityProxyHost ; 414 Edit m_editSecurityProxyHost ; 415 FixedText m_textSecurityProxyPort ; 416 Edit m_editSecurityProxyPort ; 417 FixedLine m_fixedLineButtons ; 418 OKButton m_buttonOK ; 419 CancelButton m_buttonCancel ; 420 PushButton m_buttonAdditionalSettings ; 421 Size m_expandedDialogSize ; 422 Size m_collapsedDialogSize ; 423 Point m_expOKButtonPos ; 424 Point m_expCancelButtonPos ; 425 Point m_expAdditionalButtonPos ; 426 Point m_colOKButtonPos ; 427 Point m_colCancelButtonPos ; 428 Point m_colAdditionalButtonPos ; 429 OUSTRING m_colButtonAddText ; 430 OUSTRING m_expButtonAddText ; 431 tIMPL_DialogData m_aDataSet ; 432 }; 433 434 /*-************************************************************************************************************//** 435 @short 436 437 @descr - 438 439 @implements XInterface 440 XTypeProvider 441 XServiceInfo 442 XDialog 443 444 @base ThreadHelpBase 445 OWeakObject 446 *//*-*************************************************************************************************************/ 447 448 class LoginDialog : public XTYPEPROVIDER , 449 public XSERVICEINFO , 450 public XDIALOG , 451 public XFLUSHABLE , 452 private ThreadHelpBase , // Order of baseclasses is neccessary for right initialization! 453 public OBROADCASTHELPER , 454 public OPROPERTYSETHELPER , 455 public OWEAKOBJECT 456 { 457 //------------------------------------------------------------------------------------------------------------- 458 // public methods 459 //------------------------------------------------------------------------------------------------------------- 460 461 public: 462 463 //--------------------------------------------------------------------------------------------------------- 464 // constructor / destructor 465 //--------------------------------------------------------------------------------------------------------- 466 467 /*-****************************************************************************************************//** 468 @short - 469 @descr - 470 471 @seealso - 472 473 @param - 474 @return - 475 476 @onerror - 477 *//*-*****************************************************************************************************/ 478 479 LoginDialog( const REFERENCE< XMULTISERVICEFACTORY >& sFactory ); 480 481 /*-****************************************************************************************************//** 482 @short - 483 @descr - 484 485 @seealso - 486 487 @param - 488 @return - 489 490 @onerror - 491 *//*-*****************************************************************************************************/ 492 493 virtual ~LoginDialog(); 494 495 //--------------------------------------------------------------------------------------------------------- 496 // XInterface, XTypeProvider, XServiceInfo 497 //--------------------------------------------------------------------------------------------------------- 498 499 DECLARE_XINTERFACE 500 DECLARE_XTYPEPROVIDER 501 DECLARE_XSERVICEINFO 502 503 //--------------------------------------------------------------------------------------------------------- 504 // XFlushable 505 //--------------------------------------------------------------------------------------------------------- 506 507 /*-****************************************************************************************************//** 508 @short write changed values to configuration 509 @descr Normaly the dialog returns with an OK or ERROR value. If OK occure - we flush data 510 auomaticly. But otherwise we do nothing. If user of this service wish to use property set 511 only without any UI(!) - he must call "flush()" explicitly to write data! 512 513 @seealso - 514 515 @param - 516 @return - 517 518 @onerror - 519 *//*-*****************************************************************************************************/ 520 521 virtual void SAL_CALL flush() throw( RUNTIMEEXCEPTION ); 522 virtual void SAL_CALL addFlushListener( const REFERENCE< XFLUSHLISTENER >& xListener ) throw( RUNTIMEEXCEPTION ); 523 virtual void SAL_CALL removeFlushListener( const REFERENCE< XFLUSHLISTENER >& xListener ) throw( RUNTIMEEXCEPTION ); 524 525 //--------------------------------------------------------------------------------------------------------- 526 // XDialog 527 //--------------------------------------------------------------------------------------------------------- 528 529 /*-****************************************************************************************************//** 530 @short set new title of dialog 531 @descr - 532 533 @seealso - 534 535 @param - 536 @return - 537 538 @onerror - 539 *//*-*****************************************************************************************************/ 540 541 virtual void SAL_CALL setTitle( const OUSTRING& sTitle ) throw( RUNTIMEEXCEPTION ); 542 543 /*-****************************************************************************************************//** 544 @short return the current title of this dialog 545 @descr - 546 547 @seealso - 548 549 @param - 550 @return - 551 552 @onerror - 553 *//*-*****************************************************************************************************/ 554 555 virtual OUSTRING SAL_CALL getTitle() throw( RUNTIMEEXCEPTION ); 556 557 /*-****************************************************************************************************//** 558 @short show the dialog and return user reaction 559 @descr If user close dialog with OK we return 1 else 560 user has cancelled this dialog and we return 0. 561 You can use this return value directly as boolean. 562 563 @seealso - 564 565 @param - 566 @return 1; if closed with OK 567 @return 0; if cancelled 568 569 @onerror We return 0(sal_False). 570 *//*-*****************************************************************************************************/ 571 572 virtual sal_Int16 SAL_CALL execute() throw( RUNTIMEEXCEPTION ); 573 574 /*-****************************************************************************************************//** 575 @short not implemented yet! 576 @descr - 577 578 @seealso - 579 580 @param - 581 @return - 582 583 @onerror - 584 *//*-*****************************************************************************************************/ 585 586 virtual void SAL_CALL endExecute() throw( RUNTIMEEXCEPTION ); 587 588 //------------------------------------------------------------------------------------------------------------- 589 // protected methods 590 //------------------------------------------------------------------------------------------------------------- 591 592 protected: 593 594 //--------------------------------------------------------------------------- 595 // OPropertySetHelper 596 //--------------------------------------------------------------------------- 597 598 /*-****************************************************************************************************//** 599 @short try to convert a property value 600 @descr This method is calling from helperclass "OPropertySetHelper". 601 Don't use this directly! 602 You must try to convert the value of given propertyhandle and 603 return results of this operation. This will be use to ask vetoable 604 listener. If no listener have a veto, we will change value realy! 605 ( in method setFastPropertyValue_NoBroadcast(...) ) 606 607 @seealso class OPropertySetHelper 608 @seealso method setFastPropertyValue_NoBroadcast() 609 @seealso method impl_tryToChangeProperty() 610 611 @param "aConvertedValue" new converted value of property 612 @param "aOldValue" old value of property 613 @param "nHandle" handle of property 614 @param "aValue" new value of property 615 @return sal_True if value will be changed, sal_FALSE otherway 616 617 @onerror IllegalArgumentException, if you call this with an invalid argument 618 *//*-*****************************************************************************************************/ 619 620 virtual sal_Bool SAL_CALL convertFastPropertyValue( ANY& aConvertedValue , 621 ANY& aOldValue , 622 sal_Int32 nHandle , 623 const ANY& aValue ) throw( ILLEGALARGUMENTEXCEPTION ); 624 625 /*-****************************************************************************************************//** 626 @short set value of a transient property 627 @descr This method is calling from helperclass "OPropertySetHelper". 628 Don't use this directly! 629 Handle and value are valid everyway! You must set the new value only. 630 After this, baseclass send messages to all listener automaticly. 631 632 @seealso OPropertySetHelper 633 634 @param "nHandle" handle of property to change 635 @param "aValue" new value of property 636 @return - 637 638 @onerror An exception is thrown. 639 *//*-*****************************************************************************************************/ 640 641 virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle , 642 const ANY& aValue ) throw( EXCEPTION ); 643 644 /*-****************************************************************************************************//** 645 @short get value of a transient property 646 @descr This method is calling from helperclass "OPropertySetHelper". 647 Don't use this directly! 648 649 @seealso OPropertySetHelper 650 651 @param "nHandle" handle of property to change 652 @param "aValue" current value of property 653 @return - 654 655 @onerror - 656 *//*-*****************************************************************************************************/ 657 658 virtual void SAL_CALL getFastPropertyValue( ANY& aValue , 659 sal_Int32 nHandle ) const; 660 661 /*-****************************************************************************************************//** 662 @short return structure and information about transient properties 663 @descr This method is calling from helperclass "OPropertySetHelper". 664 Don't use this directly! 665 666 @seealso OPropertySetHelper 667 668 @param - 669 @return structure with property-informations 670 671 @onerror - 672 *//*-*****************************************************************************************************/ 673 674 virtual IPROPERTYARRAYHELPER& SAL_CALL getInfoHelper(); 675 676 /*-****************************************************************************************************//** 677 @short return propertysetinfo 678 @descr You can call this method to get information about transient properties 679 of this object. 680 681 @seealso OPropertySetHelper 682 @seealso XPropertySet 683 @seealso XMultiPropertySet 684 685 @param - 686 @return reference to object with information [XPropertySetInfo] 687 688 @onerror - 689 *//*-*****************************************************************************************************/ 690 691 virtual REFERENCE< XPROPERTYSETINFO > SAL_CALL getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException); 692 693 //------------------------------------------------------------------------------------------------------------- 694 // private methods 695 //------------------------------------------------------------------------------------------------------------- 696 697 private: 698 699 /*-****************************************************************************************************//** 700 @short return table of all supported properties 701 @descr We need this table to initialize our helper baseclass OPropertySetHelper 702 703 @seealso - 704 705 @param - 706 @return - 707 708 @onerror - 709 *//*-*****************************************************************************************************/ 710 711 const SEQUENCE< PROPERTY > impl_getStaticPropertyDescriptor(); 712 713 /*-****************************************************************************************************//** 714 @short helper method to check if a property will change his value 715 @descr Is neccessary for vetoable listener mechanism of OPropertySethelper. 716 717 @seealso - 718 719 @param - 720 @return - 721 722 @onerror - 723 *//*-*****************************************************************************************************/ 724 725 sal_Bool impl_tryToChangeProperty( const OUSTRING& sProperty , 726 const ANY& aValue , 727 ANY& aOldValue , 728 ANY& aConvertedValue ) throw( ILLEGALARGUMENTEXCEPTION ); 729 730 sal_Bool impl_tryToChangeProperty( const SEQUENCE< OUSTRING >& seqProperty , 731 const ANY& aValue , 732 ANY& aOldValue , 733 ANY& aConvertedValue ) throw( ILLEGALARGUMENTEXCEPTION ); 734 735 sal_Bool impl_tryToChangeProperty( const sal_Int32& nProperty , 736 const ANY& aValue , 737 ANY& aOldValue , 738 ANY& aConvertedValue ) throw( ILLEGALARGUMENTEXCEPTION ); 739 740 sal_Bool impl_tryToChangeProperty( const LOCALE& aProperty , 741 const ANY& aValue , 742 ANY& aOldValue , 743 ANY& aConvertedValue ) throw( ILLEGALARGUMENTEXCEPTION ); 744 745 sal_Bool impl_tryToChangeProperty( const ANY& aProperty , 746 const ANY& aValue , 747 ANY& aOldValue , 748 ANY& aConvertedValue ) throw( ILLEGALARGUMENTEXCEPTION ); 749 750 /*-****************************************************************************************************//** 751 @short search and open profile 752 @descr This method search and open the ini file. It initialize some member too. 753 754 @seealso - 755 756 @param - 757 @return - 758 759 @onerror - 760 *//*-*****************************************************************************************************/ 761 762 void impl_openProfile(); 763 764 /*-****************************************************************************************************//** 765 @short close profile and free some member 766 @descr This method close current opened ini file and deinitialize some member too. 767 768 @seealso - 769 770 @param - 771 @return - 772 773 @onerror - 774 *//*-*****************************************************************************************************/ 775 776 void impl_closeProfile(); 777 778 /*-****************************************************************************************************//** 779 @short write profile and free some member 780 @descr This method writes current settings and deinitialize some member too. 781 782 @seealso - 783 784 @param - 785 @return - 786 787 @onerror - 788 *//*-*****************************************************************************************************/ 789 void impl_writeProfile(); 790 791 /*-****************************************************************************************************//** 792 @short check current server history 793 @descr Our current server history implementation can handle 10 elements as maximum. 794 If more then 10 elements exist; old ones will be deleted. 795 796 @seealso - 797 798 @param "seqHistory"; current history 799 @return Sequence< OUString >; checked and repaired history 800 801 @onerror - 802 *//*-*****************************************************************************************************/ 803 804 void impl_addServerToHistory( SEQUENCE< OUSTRING >& seqHistory , 805 sal_Int32& nActiveServer , 806 const OUSTRING& sServer ); 807 808 /*-****************************************************************************************************//** 809 @short helper methods to read/write properties from/to ini file 810 @descr Using of Config-Class isn't easy everytime :-( 811 Thats the reason for these helper. State of operation isn't realy important .. 812 but we assert impossible cases or occured errors! 813 814 @seealso - 815 816 @param - 817 @return - 818 819 @onerror Assertions are shown. 820 *//*-*****************************************************************************************************/ 821 822 void impl_writeUserName ( const OUSTRING& sUserName ); 823 void impl_writeActiveServer ( sal_Int32 nActiveServer ); 824 void impl_writeServerHistory ( const SEQUENCE< OUSTRING >& lHistory ); 825 void impl_writeConnectionType ( const OUSTRING& sConnectionType ); 826 void impl_writeLanguage ( const LOCALE& aLanguage ); 827 void impl_writePortHttp ( sal_Int32 nPort ); 828 void impl_writePortHttps ( sal_Int32 nPort ); 829 void impl_writeSecurityProxy ( const OUSTRING& sSecurityProxy ); 830 void impl_writeUseProxy ( const OUSTRING& sUseProxy ); 831 void impl_writeDialog ( const OUSTRING& sDialog ); 832 833 OUSTRING impl_readUserName ( ); 834 sal_Int32 impl_readActiveServer ( ); 835 SEQUENCE< OUSTRING > impl_readServerHistory ( ); 836 OUSTRING impl_readConnectionType ( ); 837 LOCALE impl_readLanguage ( ); 838 sal_Int32 impl_readPortHttp ( ); 839 sal_Int32 impl_readPortHttps ( ); 840 OUSTRING impl_readSecurityProxy ( ); 841 OUSTRING impl_readUseProxy ( ); 842 OUSTRING impl_readDialog ( ); 843 844 //------------------------------------------------------------------------------------------------------------- 845 // debug methods 846 // (should be private everyway!) 847 //------------------------------------------------------------------------------------------------------------- 848 849 /*-****************************************************************************************************//** 850 @short debug-method to check incoming parameter of some other mehods of this class 851 @descr The following methods are used to check parameters for other methods 852 of this class. The return value is used directly for an ASSERT(...). 853 854 @seealso ASSERTs in implementation! 855 856 @param references to checking variables 857 @return sal_False on invalid parameter<BR> 858 sal_True otherway 859 860 @onerror - 861 *//*-*****************************************************************************************************/ 862 863 #ifdef ENABLE_ASSERTIONS 864 865 private: 866 867 sal_Bool impldbg_checkParameter_LoginDialog ( const REFERENCE< XMULTISERVICEFACTORY >& xFactory ); 868 sal_Bool impldbg_checkParameter_setTitle ( const OUSTRING& sTitle ); 869 870 #endif // #ifdef ENABLE_ASSERTIONS 871 872 //------------------------------------------------------------------------------------------------------------- 873 // variables 874 // (should be private everyway!) 875 //------------------------------------------------------------------------------------------------------------- 876 877 private: 878 879 REFERENCE< XMULTISERVICEFACTORY > m_xFactory ; /// reference to factory, which has created this instance 880 OUSTRING m_sININame ; /// full qualified path to profile UNC-notation 881 Config* m_pINIManager ; /// manager for full access to ini file 882 sal_Bool m_bInExecuteMode ; /// protection against setting of properties during showing of dialog 883 cIMPL_Dialog* m_pDialog ; /// VCL dialog 884 tIMPL_DialogData m_aPropertySet ; 885 886 }; // class LoginDialog 887 888 } // namespace framework 889 890 #endif // #ifndef __FRAMEWORK_LOGINDIALOG_LOGINDIALOG_HXX_ 891