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

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • 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 
56 class KDEUI_EXPORT KPasswordDialog : public KDialog
57 {
58  Q_OBJECT
59 
60 public:
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 
273 Q_SIGNALS:
279  void gotPassword( const QString& password , bool keep );
280 
287  void gotUsernameAndPassword( const QString& username, const QString& password , bool keep );
288 
289 protected:
295  virtual bool checkPassword();
296 
297 
298 private:
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 
303 private:
304  class KPasswordDialogPrivate;
305  friend class KPasswordDialogPrivate;
306  KPasswordDialogPrivate* const d;
307 
308  Q_DISABLE_COPY(KPasswordDialog)
309 };
310 
311 Q_DECLARE_OPERATORS_FOR_FLAGS(KPasswordDialog::KPasswordDialogFlags)
312 
313 #endif
kdialog.h
QWidget
KPasswordDialog::UsernameError
A problem with the user name as entered.
Definition: kpassworddialog.h:104
KPasswordDialog::PasswordError
Incorrect password.
Definition: kpassworddialog.h:109
KStandardShortcut::label
QString label(StandardShortcut id)
Returns a localized label for user-visible display.
Definition: kstandardshortcut.cpp:267
QMap< QString, QString >
KDialog
A dialog base class with standard buttons and predefined layouts.
Definition: kdialog.h:128
KPasswordDialog::FatalError
Error preventing further attempts, will result in disabling most of the interface.
Definition: kpassworddialog.h:114
KFontUtils::NoFlags
Definition: kfontutils.h:36
QString
QDialog::accept
virtual void accept()
QPixmap
KPasswordDialog::ErrorType
ErrorType
Definition: kpassworddialog.h:97
KPasswordDialog
A dialog for requesting a password and optionaly a login from the end user.
Definition: kpassworddialog.h:56
KPasswordDialog::KPasswordDialogFlag
KPasswordDialogFlag
Definition: kpassworddialog.h:62
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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