00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __tdeio_pass_dlg_h__
00021 #define __tdeio_pass_dlg_h__
00022
00023 #include <kdialogbase.h>
00024
00025 class TQGridLayout;
00026
00027 namespace TDEIO {
00028
00036 class TDEIO_EXPORT PasswordDialog : public KDialogBase
00037 {
00038 Q_OBJECT
00039
00040 public:
00051 PasswordDialog( const TQString& prompt, const TQString& user,
00052 bool enableKeep = false, bool modal=true,
00053 TQWidget* parent=0, const char* name=0 );
00054
00058 ~PasswordDialog();
00059
00064 void setPrompt( const TQString& prompt );
00065
00076 void addCommentLine( const TQString& label, const TQString comment );
00077
00082 TQString password() const;
00083
00088 TQString username() const;
00089
00095 bool keepPassword() const;
00096
00103 void setKeepPassword( bool b );
00104
00111 void setUserReadOnly( bool readOnly );
00112
00116 KDE_DEPRECATED void setEnableUserField( bool enable, bool=false ) {
00117 setUserReadOnly( !enable );
00118 };
00119
00125 void setPassword( const TQString& password );
00126
00134 void setKnownLogins( const TQMap<TQString, TQString>& knownLogins );
00135
00152 static int getNameAndPassword( TQString& user, TQString& pass, bool* keep,
00153 const TQString& prompt = TQString::null,
00154 bool readOnly = false,
00155 const TQString& caption = TQString::null,
00156 const TQString& comment = TQString::null,
00157 const TQString& label = TQString::null );
00158
00159 private slots:
00160 void slotKeep( bool );
00161 void slotActivated( const TQString& userName );
00162
00163 private:
00164 void init( const TQString&, const TQString&, bool );
00165
00166 protected:
00167 virtual void virtual_hook( int id, void* data );
00168 private:
00169 struct PasswordDialogPrivate;
00170 PasswordDialogPrivate* d;
00171 };
00172
00173 }
00174
00175 #endif