KWidgetsAddons

knewpassworddialog.h
1 // vi: ts=8 sts=4 sw=4
2 /* This file is part of the KDE libraries
3  Copyright (C) 1998 Pietro Iglio <[email protected]>
4  Copyright (C) 1999,2000 Geert Jansen <[email protected]>
5  Copyright (C) 2004,2005 Andrew Coles <[email protected]>
6  Copyright (C) 2006,2007 Olivier Goffart <ogoffart @ kde.org>
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public
10  License version 2 as published by the Free Software Foundation.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 #ifndef KNEWPASSWORDDIALOG_H
23 #define KNEWPASSWORDDIALOG_H
24 
25 #include <QDialog>
26 
27 #include <kwidgetsaddons_export.h>
28 
29 class QWidget;
30 
68 class KWIDGETSADDONS_EXPORT KNewPasswordDialog
69  : public QDialog
70 {
71  Q_OBJECT
72 
73 public:
79  explicit KNewPasswordDialog(QWidget *parent = nullptr);
80 
84  ~KNewPasswordDialog() override;
85 
89  void setPrompt(const QString &prompt);
90 
94  QString prompt() const;
95 
100  void setIcon(const QIcon &icon);
101 
106  QIcon icon() const;
107 
108 #if KWIDGETSADDONS_ENABLE_DEPRECATED_SINCE(5, 63)
109 
116  KWIDGETSADDONS_DEPRECATED_VERSION(5, 63, "Use KNewPasswordDialog::setIcon(const QIcon &)")
117  void setPixmap(const QPixmap &);
118 
123  KWIDGETSADDONS_DEPRECATED_VERSION(5, 63, "Use KNewPasswordDialog::icon()")
124  QPixmap pixmap() const;
125 #endif
126 
132  void setAllowEmptyPasswords(bool allowed);
133 
139  bool allowEmptyPasswords() const;
140 
148  void setMinimumPasswordLength(int minLength);
149 
153  int minimumPasswordLength() const;
154 
160  void setMaximumPasswordLength(int maxLength);
161 
165  int maximumPasswordLength() const;
166 
176  void setReasonablePasswordLength(int reasonableLength);
177 
181  int reasonablePasswordLength() const;
182 
192  void setPasswordStrengthWarningLevel(int warningLevel);
193 
197  int passwordStrengthWarningLevel() const;
198 
207  void setBackgroundWarningColor(const QColor &color);
208 
213  QColor backgroundWarningColor() const;
214 
221  QString password() const;
222 
232  void setRevealPasswordAvailable(bool reveal);
233 
238  bool isRevealPasswordAvailable() const;
239 
243  void accept() override;
244 
245 protected:
246 
252  virtual bool checkPassword(const QString &);
253 
261  bool checkAndGetPassword(QString *pwd);
262 
263 Q_SIGNALS:
264 
268  void newPassword(const QString &password);
269 
270 private:
271  class KNewPasswordDialogPrivate;
272  KNewPasswordDialogPrivate *const d;
273 
274  Q_PRIVATE_SLOT(d, void _k_passwordStatusChanged())
275 };
276 
277 #endif // KNEWPASSWORDDIALOG_H
278 
A password input dialog.
virtual void accept()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jul 3 2020 22:43:15 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.