KDEUI
#include <kpassworddialog.h>
Public Types | |
enum | ErrorType { UnknownError = 0, UsernameError, PasswordError, FatalError, DomainError } |
enum | KPasswordDialogFlag { NoFlags = 0x00, ShowKeepPassword = 0x01, ShowUsernameLine = 0x02, UsernameReadOnly = 0x04, ShowAnonymousLoginCheckBox = 0x08, ShowDomainLine = 0x10, DomainReadOnly = 0x20 } |
Public Types inherited from KDialog | |
enum | ButtonCode { None = 0x00000000, Help = 0x00000001, Default = 0x00000002, Ok = 0x00000004, Apply = 0x00000008, Try = 0x00000010, Cancel = 0x00000020, Close = 0x00000040, No = 0x00000080, Yes = 0x00000100, Reset = 0x00000200, Details = 0x00000400, User1 = 0x00001000, User2 = 0x00002000, User3 = 0x00004000, NoDefault = 0x00008000 } |
enum | ButtonPopupMode { InstantPopup = 0, DelayedPopup = 1 } |
enum | CaptionFlag { NoCaptionFlags = 0, AppNameCaption = 1, ModifiedCaption = 2, HIGCompliantCaption = AppNameCaption } |
Signals | |
void | gotPassword (const QString &password, bool keep) |
void | gotUsernameAndPassword (const QString &username, const QString &password, bool keep) |
Signals inherited from KDialog | |
void | aboutToShowDetails () |
void | applyClicked () |
void | buttonClicked (KDialog::ButtonCode button) |
void | cancelClicked () |
void | closeClicked () |
void | defaultClicked () |
void | finished () |
void | helpClicked () |
void | hidden () |
void | layoutHintChanged () |
void | noClicked () |
void | okClicked () |
void | resetClicked () |
void | tryClicked () |
void | user1Clicked () |
void | user2Clicked () |
void | user3Clicked () |
void | yesClicked () |
Protected Member Functions | |
virtual bool | checkPassword () |
Protected Member Functions inherited from KDialog | |
KDialog (KDialogPrivate &dd, QWidget *parent, Qt::WindowFlags flags=0) | |
virtual void | closeEvent (QCloseEvent *e) |
virtual void | hideEvent (QHideEvent *) |
virtual void | keyPressEvent (QKeyEvent *) |
Additional Inherited Members | |
Public Slots inherited from KDialog | |
void | delayedDestruct () |
void | enableButton (ButtonCode id, bool state) |
void | enableButtonApply (bool state) |
void | enableButtonCancel (bool state) |
void | enableButtonOk (bool state) |
void | enableLinkedHelp (bool state) |
bool | isDetailsWidgetVisible () const |
virtual void | setCaption (const QString &caption) |
virtual void | setCaption (const QString &caption, bool modified) |
void | setDetailsWidget (QWidget *detailsWidget) |
void | setDetailsWidgetVisible (bool visible) |
void | setHelp (const QString &anchor, const QString &appname=QString()) |
void | setHelpLinkText (const QString &text) |
virtual void | setPlainCaption (const QString &caption) |
Static Public Member Functions inherited from KDialog | |
static bool | avoidArea (QWidget *widget, const QRect &area, int screen=-1) |
static void | centerOnScreen (QWidget *widget, int screen=-1) |
static int | groupSpacingHint () |
static QString | makeStandardCaption (const QString &userCaption, QWidget *window=0, CaptionFlags flags=HIGCompliantCaption) |
static int | marginHint () |
static void | resizeLayout (QWidget *widget, int margin, int spacing) |
static void | resizeLayout (QLayout *lay, int margin, int spacing) |
static void | setAllowEmbeddingInGraphicsView (bool allowEmbedding) |
static int | spacingHint () |
Protected Slots inherited from KDialog | |
virtual void | slotButtonClicked (int button) |
void | updateGeometry () |
Protected Attributes inherited from KDialog | |
KDialogPrivate *const | d_ptr |
Detailed Description
A dialog for requesting a password and optionaly a login from the end user.
Usage Example
Requesting a simple password, assynchronous
Requesting a login and a password, synchronous
dialog for requesting login and password from the end user
Definition at line 56 of file kpassworddialog.h.
Member Enumeration Documentation
Definition at line 97 of file kpassworddialog.h.
Definition at line 62 of file kpassworddialog.h.
Constructor & Destructor Documentation
|
explicit |
create a password dialog
- Parameters
-
parent the parent widget (default:NULL). flags a set of KPasswordDialogFlag flags otherButtons buttons to show in the dialog besides Ok and Cancel. Useful for adding application-specific buttons like "ignore" or "skip".
Definition at line 65 of file kpassworddialog.cpp.
KPasswordDialog::~KPasswordDialog | ( | ) |
Destructor.
Definition at line 78 of file kpassworddialog.cpp.
Member Function Documentation
void KPasswordDialog::accept | ( | ) |
Definition at line 379 of file kpassworddialog.cpp.
Adds a comment line to the dialog.
This function allows you to add one additional comment line to this widget. Calling this function after a comment has already been added will not have any effect.
- Parameters
-
label label for comment (ex:"Command:") comment the actual comment text.
Definition at line 222 of file kpassworddialog.cpp.
bool KPasswordDialog::anonymousMode | ( | ) | const |
- Returns
- anonymous mode has been selected.
- Since
- 4.1
Definition at line 206 of file kpassworddialog.cpp.
|
protectedvirtual |
Virtual function that can be overridden to provide password checking in derived classes.
It should return true
if the password is valid, false
otherwise.
Definition at line 411 of file kpassworddialog.cpp.
QString KPasswordDialog::domain | ( | ) | const |
Returns the domain entered by the user.
- Returns
- the domain name
- Since
- 4.1
Definition at line 187 of file kpassworddialog.cpp.
emitted when the dialog has been accepted
- Parameters
-
password the entered password keep true if the "remember password" checkbox was checked, false otherwise. false if ShowKeepPassword was not set in the constructor
|
signal |
emitted when the dialog has been accepted, and ShowUsernameLine was set on the constructor
- Parameters
-
username the entered username password the entered password keep true if the "remember password" checkbox was checked, false otherwise. false if ShowKeepPassword was not set in the constructor
bool KPasswordDialog::keepPassword | ( | ) | const |
Determines whether supplied authorization should persist even after the application has been closed.
this is set with the check password checkbox is the ShowKeepCheckBox flag is set in the constructor, if it is not set, this function return false
- Returns
- true to keep the password
Definition at line 217 of file kpassworddialog.cpp.
QString KPasswordDialog::password | ( | ) | const |
Returns the password entered by the user.
- Returns
- the password
Definition at line 177 of file kpassworddialog.cpp.
QPixmap KPasswordDialog::pixmap | ( | ) | const |
Definition at line 148 of file kpassworddialog.cpp.
QString KPasswordDialog::prompt | ( | ) | const |
Returns the prompt.
Definition at line 311 of file kpassworddialog.cpp.
void KPasswordDialog::setAnonymousMode | ( | bool | anonymous | ) |
set anonymous mode (all other fields will be grayed out)
- Since
- 4.1
Definition at line 192 of file kpassworddialog.cpp.
void KPasswordDialog::setDomain | ( | const QString & | domain | ) |
void KPasswordDialog::setKeepPassword | ( | bool | b | ) |
Check or uncheck the "keep password" checkbox.
This can be used to check it before showing the dialog, to tell the user that the password is stored already (e.g. in the wallet). enableKeep must have been set to true in the constructor.
has only effect if ShowKeepCheckBox is set in the constructor
Definition at line 212 of file kpassworddialog.cpp.
Presets a number of login+password pairs that the user can choose from.
The passwords can be empty if you simply want to offer usernames to choose from.
This require the flag ShowUnernameLine to be set in the constructoe, and not the flag UsernameReadOnly
- Parameters
-
knownLogins map of known logins: the keys are usernames, the values are passwords.
Definition at line 330 of file kpassworddialog.cpp.
void KPasswordDialog::setPassword | ( | const QString & | password | ) |
Presets the password.
- Parameters
-
password the password to set
Definition at line 316 of file kpassworddialog.cpp.
void KPasswordDialog::setPixmap | ( | const QPixmap & | pixmap | ) |
set an image that appears next to the prompt.
Definition at line 136 of file kpassworddialog.cpp.
void KPasswordDialog::setPrompt | ( | const QString & | prompt | ) |
Sets the prompt to show to the user.
- Parameters
-
prompt instructional text to be shown.
Definition at line 304 of file kpassworddialog.cpp.
void KPasswordDialog::setUsername | ( | const QString & | user | ) |
set the default username.
Definition at line 158 of file kpassworddialog.cpp.
void KPasswordDialog::setUsernameReadOnly | ( | bool | readOnly | ) |
Sets the username field read-only and sets the focus to the password field.
this can also be set by passing UsernameReadOnly as flag in the constructor
- Parameters
-
readOnly true to set the user field to read-only
Definition at line 321 of file kpassworddialog.cpp.
void KPasswordDialog::showErrorMessage | ( | const QString & | message, |
const ErrorType | type = PasswordError |
||
) |
Shows an error message in the dialog box.
Prevents having to show a dialog-on-a-dialog.
- Parameters
-
message the error message to show
Definition at line 264 of file kpassworddialog.cpp.
QString KPasswordDialog::username | ( | ) | const |
Returns the username entered by the user.
- Returns
- the user name
Definition at line 172 of file kpassworddialog.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.