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

KDE3Support

  • kde3support
  • kdeui
k3passworddialog.h
Go to the documentation of this file.
1// vi: ts=8 sts=4 sw=4
2/* This file is part of the KDE libraries
3 Copyright (C) 1998 Pietro Iglio <iglio@fub.it>
4 Copyright (C) 1999,2000 Geert Jansen <jansen@kde.org>
5 Copyright (C) 2004,2005 Andrew Coles <andrew_coles@yahoo.co.uk>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License version 2 as published by the Free Software Foundation.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21#ifndef K3PASSWORDDIALOG_H
22#define K3PASSWORDDIALOG_H
23
24#include <kde3support_export.h>
25#include <kdialog.h>
26
27#include <QtGui/QLineEdit>
28
29class QLabel;
30class QGridLayout;
31class QWidget;
32
41class KDE3SUPPORT_EXPORT K3PasswordEdit
42 : public QLineEdit
43{
44 Q_OBJECT
45
46public:
47 enum EchoModes { OneStar, ThreeStars, NoEcho };
48
52 explicit K3PasswordEdit(QWidget *parent=0);
53 // KDE4: either of the two must go! add default values for parameters
54
59 explicit K3PasswordEdit(EchoMode echoMode, QWidget *parent = 0);
60
65 explicit K3PasswordEdit(EchoModes echoMode, QWidget *parent = 0);
66
70 ~K3PasswordEdit();
71
76 const char *password() const;
77
81 void erase();
82
83 static const int PassLen;
84
93 void setMaxPasswordLength(int newLength);
94
98 int maxPasswordLength() const;
99
100public Q_SLOTS:
104 virtual void insert( const QString &);
105
106protected:
107 virtual void keyPressEvent(QKeyEvent *);
108 virtual void focusInEvent(QFocusEvent *e);
109 virtual bool event(QEvent *e);
110
111private:
112 void init();
113 void showPass();
114
115 char *m_Password;
116 int m_EchoMode, m_Length;
117};
118
119
159class KDE3SUPPORT_EXPORT K3PasswordDialog
160 : public KDialog
161{
162 Q_OBJECT
163
164public:
168 enum Types {
172 Password,
173
179 NewPassword
180 };
181
193 K3PasswordDialog(Types type, bool enableKeep, ButtonCodes extraBttn, QWidget *parent=0);
194
195
209 K3PasswordDialog(Types type, bool enableKeep, ButtonCodes extraBttn, const QString& iconName,
210 QWidget *parent = 0);
211
215 virtual ~K3PasswordDialog();
216
220 void setPrompt(const QString &prompt);
221
225 QString prompt() const;
226
230 void addLine(const QString &key, const QString &value);
231
235 void setAllowEmptyPasswords(bool allowed);
236
240 bool allowEmptyPasswords() const;
241
249 void setMinimumPasswordLength(int minLength);
250
254 int minimumPasswordLength() const;
255
262 void setMaximumPasswordLength(int maxLength);
263
267 int maximumPasswordLength() const;
268
276 void setReasonablePasswordLength(int reasonableLength);
277
281 int reasonablePasswordLength() const;
282
292 void setPasswordStrengthWarningLevel(int warningLevel);
293
297 int passwordStrengthWarningLevel() const;
298
303 const char *password() const;
304
309 void clearPassword();
310
314 bool keep() const;
315
330 static int getPassword(QWidget *parent, QByteArray &password, const QString &caption, const QString &prompt, bool *keep = 0L);
331
337 static KDE_DEPRECATED int getPassword(QWidget *parent, QByteArray &password, const QString &prompt, int *keep = 0L);
338
351 static int getNewPassword(QWidget *parent, QByteArray &password, const QString &caption, const QString &prompt);
352
358 static KDE_DEPRECATED int getNewPassword(QWidget *parent, QByteArray &password, const QString &prompt);
359
363 static void disableCoreDumps();
364
365 virtual void accept();
366
367protected Q_SLOTS:
368 void slotKeep(bool);
369
370protected:
371
377 virtual bool checkPassword(const char *password);
378
379
380private Q_SLOTS:
381 void enableOkBtn();
382
383private:
384 void init();
385 void erase();
386
387 int m_Keep, m_Type, m_Row;
388 QLabel *m_pHelpLbl;
389 QGridLayout *m_pGrid;
390 QWidget *m_pMain;
391 K3PasswordEdit *m_pEdit, *m_pEdit2;
392
393private:
394 class K3PasswordDialogPrivate;
395 K3PasswordDialogPrivate* const d;
396};
397
398#endif // K3PasswordDialog_H
399
K3PasswordDialog
A password input dialog.
Definition: k3passworddialog.h:161
K3PasswordDialog::Types
Types
This enum distinguishes the two operation modes of this dialog:
Definition: k3passworddialog.h:168
K3PasswordDialog::Password
@ Password
The user is asked to enter a password.
Definition: k3passworddialog.h:172
K3PasswordEdit
A safe password input widget.
Definition: k3passworddialog.h:43
K3PasswordEdit::EchoModes
EchoModes
Definition: k3passworddialog.h:47
K3PasswordEdit::PassLen
static const int PassLen
Definition: k3passworddialog.h:83
KDialog
QEvent
QLabel
QLineEdit
QWidget
kde3support_export.h
kdialog.h
insert
const KShortcut & insert()
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.

KDE3Support

Skip menu "KDE3Support"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • 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