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