20#ifndef __KPassDlg_h_included__
21#define __KPassDlg_h_included__
24#include <tqlineedit.h>
25#include <kdialogbase.h>
44 enum EchoModes { OneStar, ThreeStars, NoEcho };
57 KPasswordEdit(EchoMode echoMode, TQWidget *parent,
const char *name);
64 KPasswordEdit(EchoModes echoMode, TQWidget *parent,
const char *name);
70 KPasswordEdit(TQWidget *parent,
const char *name,
int echoMode) TDE_DEPRECATED;
87 static const int PassLen;
108 virtual void insert(
const TQString &);
111 virtual void keyPressEvent(TQKeyEvent *);
112 virtual void focusInEvent(TQFocusEvent *e);
113 virtual bool event(TQEvent *e);
188 TQWidget *parent=0,
const char *name=0);
195 int extraBttn=0) TDE_DEPRECATED;
214 KPasswordDialog(Types type,
bool enableKeep,
int extraBttn, const TQString& iconName,
215 TQWidget *parent = 0, const
char *name = 0);
225 void setPrompt(TQString prompt);
230 TQString prompt() const;
235 void setKeepWarning(TQString warn);
240 void addLine(TQString key, TQString value);
246 void setAllowEmptyPasswords(
bool allowed);
252 bool allowEmptyPasswords() const;
262 void setMinimumPasswordLength(
int minLength);
268 int minimumPasswordLength() const;
277 void setMaximumPasswordLength(
int maxLength);
283 int maximumPasswordLength() const;
293 void setReasonablePasswordLength(
int reasonableLength);
299 int reasonablePasswordLength() const;
311 void setPasswordStrengthWarningLevel(
int warningLevel);
317 int passwordStrengthWarningLevel() const;
322 TQString
password()
const {
return m_pEdit->password(); }
329 void clearPassword();
334 bool keep()
const {
return m_Keep; }
348 static int getPassword(TQString &password, TQString prompt,
int *keep=0L);
360 static int getNewPassword(TQString &password, TQString prompt);
365 static void disableCoreDumps();
393 TQLabel *m_keepWarnLbl;
394 TQGridLayout *m_pGrid;
400 virtual void virtual_hook(
int id,
void* data );
402 class KPasswordDialogPrivate;
403 KPasswordDialogPrivate*
const d;
KDialogBase(TQWidget *parent=0, const char *name=0, bool modal=true, const TQString &caption=TQString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
Constructor for the standard mode where you must specify the main widget with setMainWidget() .
TQString password() const
Returns the password entered.
bool keep() const
Returns true if the user wants to keep the password.
KPasswordDialog(Types type, bool enableKeep, int extraBttn, TQWidget *parent=0, const char *name=0)
Constructs a password dialog.
virtual bool checkPassword(const TQString &)
Virtual function that can be overridden to provide password checking in derived classes.
Types
This enum distinguishes the two operation modes of this dialog:
@ NewPassword
The user is asked to enter a password and to confirm it a second time.
@ Password
The user is asked to enter a password.
A safe password input widget.
int maxPasswordLength() const
Returns the current maximum password length.
KPasswordEdit(TQWidget *parent=0, const char *name=0)
Constructs a password input widget using the user's global "echo mode" setting.
void setMaxPasswordLength(int newLength)
Set the current maximum password length.
TQString password() const
Returns the password.
void erase()
Erases the current password.
virtual void insert(const TQString &)
Reimplementation.