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