• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • dialogs
kpassworddialog.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2000 David Faure <faure@kde.org>
3 Copyright (C) 2000 Dawit Alemayehu <adawit@kde.org>
4 Copyright (C) 2007 Olivier Goffart <ogoffart at kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public
16 License along with this library; see the file COPYING.LIB. If
17 not, write to the Free Software Foundation, Inc., 51 Franklin Street,
18 Fifth Floor, Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KPASSWORDDIALOG_H
22#define KPASSWORDDIALOG_H
23
24#include <kdialog.h>
25#include <QtCore/QFlags>
26
56class KDEUI_EXPORT KPasswordDialog : public KDialog
57{
58 Q_OBJECT
59
60public:
61
62 enum KPasswordDialogFlag
63 {
64 NoFlags = 0x00,
69 ShowKeepPassword = 0x01,
74 ShowUsernameLine = 0x02,
78 UsernameReadOnly = 0x04,
83 ShowAnonymousLoginCheckBox = 0x08,
88 ShowDomainLine = 0x10,
93 DomainReadOnly = 0x20
94 };
95 Q_DECLARE_FLAGS(KPasswordDialogFlags, KPasswordDialogFlag)
96
97 enum ErrorType
98 {
99 UnknownError = 0,
100
104 UsernameError,
105
109 PasswordError,
110
114 FatalError,
115
120 DomainError
121 };
122
132 explicit KPasswordDialog( QWidget *parent = 0L,
133 const KPasswordDialogFlags& flags = 0,
134 const KDialog::ButtonCodes otherButtons = 0);
135
139 ~KPasswordDialog();
140
145 void setPrompt( const QString& prompt );
146
150 QString prompt() const;
151
155 void setPixmap(const QPixmap&);
159 QPixmap pixmap() const;
160
171 void addCommentLine( const QString& label, const QString& comment );
172
178 void showErrorMessage( const QString& message, const ErrorType type = PasswordError );
179
184 QString password() const;
185
189 void setUsername(const QString&);
190
195 QString username() const;
196
201 void setDomain(const QString&);
202
208 QString domain() const;
209
214 void setAnonymousMode(bool anonymous);
215
220 bool anonymousMode() const;
221
231 bool keepPassword() const;
232
241 void setKeepPassword( bool b );
242
251 void setUsernameReadOnly( bool readOnly );
252
257 void setPassword( const QString& password );
258
266 void setKnownLogins( const QMap<QString, QString>& knownLogins );
267
271 void accept();
272
273Q_SIGNALS:
279 void gotPassword( const QString& password , bool keep );
280
287 void gotUsernameAndPassword( const QString& username, const QString& password , bool keep );
288
289protected:
295 virtual bool checkPassword();
296
297
298private:
299 Q_PRIVATE_SLOT(d, void actuallyAccept())
300 Q_PRIVATE_SLOT(d, void activated( const QString& userName ))
301 Q_PRIVATE_SLOT(d, void updateFields())
302
303private:
304 class KPasswordDialogPrivate;
305 friend class KPasswordDialogPrivate;
306 KPasswordDialogPrivate* const d;
307
308 Q_DISABLE_COPY(KPasswordDialog)
309};
310
311Q_DECLARE_OPERATORS_FOR_FLAGS(KPasswordDialog::KPasswordDialogFlags)
312
313#endif
KDialog
A dialog base class with standard buttons and predefined layouts.
Definition: kdialog.h:129
KPasswordDialog
A dialog for requesting a password and optionaly a login from the end user.
Definition: kpassworddialog.h:57
KPasswordDialog::KPasswordDialogFlag
KPasswordDialogFlag
Definition: kpassworddialog.h:63
KPasswordDialog::gotUsernameAndPassword
void gotUsernameAndPassword(const QString &username, const QString &password, bool keep)
emitted when the dialog has been accepted, and ShowUsernameLine was set on the constructor
KPasswordDialog::ErrorType
ErrorType
Definition: kpassworddialog.h:98
KPasswordDialog::PasswordError
@ PasswordError
Incorrect password.
Definition: kpassworddialog.h:109
KPasswordDialog::UsernameError
@ UsernameError
A problem with the user name as entered.
Definition: kpassworddialog.h:104
KPasswordDialog::FatalError
@ FatalError
Error preventing further attempts, will result in disabling most of the interface.
Definition: kpassworddialog.h:114
KPasswordDialog::gotPassword
void gotPassword(const QString &password, bool keep)
emitted when the dialog has been accepted
QMap
QWidget
kdialog.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal