• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

  • tdeui
kpassdlg.h
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 __KPassDlg_h_included__
22 #define __KPassDlg_h_included__
23 
24 #include <tqstring.h>
25 #include <tqlineedit.h>
26 #include <kdialogbase.h>
27 
28 class TQLabel;
29 class TQGridLayout;
30 class TQWidget;
31 
39 class TDEUI_EXPORT KPasswordEdit
40  : public TQLineEdit
41 {
42  Q_OBJECT
43 
44 public:
45  enum EchoModes { OneStar, ThreeStars, NoEcho };
46 
50  KPasswordEdit(TQWidget *parent=0, const char *name=0);
51  // KDE4: either of the two must go! add default values for parameters
52 
58  KPasswordEdit(EchoMode echoMode, TQWidget *parent, const char *name);
59 
65  KPasswordEdit(EchoModes echoMode, TQWidget *parent, const char *name);
66 
71  KPasswordEdit(TQWidget *parent, const char *name, int echoMode) KDE_DEPRECATED;
72 
76  ~KPasswordEdit();
77 
81  TQString password() const;
82 
86  void erase();
87 
88  static const int PassLen;
89 
97  void setMaxPasswordLength(int newLength);
98 
103  int maxPasswordLength() const;
104 
105 public slots:
109  virtual void insert( const TQString &);
110 
111 protected:
112  virtual void keyPressEvent(TQKeyEvent *);
113  virtual void focusInEvent(TQFocusEvent *e);
114  virtual bool event(TQEvent *e);
115 
116 private:
117  void init();
118 };
119 
120 
151 class TDEUI_EXPORT KPasswordDialog
152  : public KDialogBase
153 {
154  Q_OBJECT
155 
156 public:
160  enum Types {
164  Password,
165 
171  NewPassword
172  };
173 
188  KPasswordDialog(Types type, bool enableKeep, int extraBttn,
189  TQWidget *parent=0, const char *name=0);
190 
195  KPasswordDialog(int type, TQString prompt, bool enableKeep=false,
196  int extraBttn=0) KDE_DEPRECATED;
197  // note that this implicitly deprecates the 'prompt' variants of
198  // getPassword() below. i guess the above constructor needs to be extended.
199 
215  KPasswordDialog(Types type, bool enableKeep, int extraBttn, const TQString& iconName,
216  TQWidget *parent = 0, const char *name = 0);
217 
221  virtual ~KPasswordDialog();
222 
226  void setPrompt(TQString prompt);
227 
231  TQString prompt() const;
232 
236  void setKeepWarning(TQString warn);
237 
241  void addLine(TQString key, TQString value);
242 
247  void setAllowEmptyPasswords(bool allowed);
248 
253  bool allowEmptyPasswords() const;
254 
263  void setMinimumPasswordLength(int minLength);
264 
269  int minimumPasswordLength() const;
270 
278  void setMaximumPasswordLength(int maxLength);
279 
284  int maximumPasswordLength() const;
285 
294  void setReasonablePasswordLength(int reasonableLength);
295 
300  int reasonablePasswordLength() const;
301 
312  void setPasswordStrengthWarningLevel(int warningLevel);
313 
318  int passwordStrengthWarningLevel() const;
319 
323  TQString password() const { return m_pEdit->password(); }
324 
330  void clearPassword();
331 
335  bool keep() const { return m_Keep; }
336 
349  static int getPassword(TQString &password, TQString prompt, int *keep=0L);
350 
361  static int getNewPassword(TQString &password, TQString prompt);
362 
366  static void disableCoreDumps();
367 
368 protected slots:
369  void slotOk();
370  void slotCancel();
371  void slotKeep(bool);
372  void slotLayout();
373 
374 protected:
375 
381  virtual bool checkPassword(const TQString&) { return true; }
382 
383 private slots:
384  void enableOkBtn();
385 
386 private:
387  void init();
388  void erase();
389 
390  int m_Keep;
391  int m_Type;
392  int m_Row;
393  TQLabel *m_pHelpLbl;
394  TQLabel *m_keepWarnLbl;
395  TQGridLayout *m_pGrid;
396  TQWidget *m_pMain;
397  KPasswordEdit *m_pEdit;
398  KPasswordEdit *m_pEdit2;
399 
400 protected:
401  virtual void virtual_hook( int id, void* data );
402 private:
403  class KPasswordDialogPrivate;
404  KPasswordDialogPrivate* const d;
405 };
406 
407 
408 #endif // __KPassDlg_h_included__
KDialogBase::slotOk
virtual void slotOk()
Activated when the Ok button has been clicked.
Definition: kdialogbase.cpp:1164
KPasswordEdit
A safe password input widget.
Definition: kpassdlg.h:39
KPasswordDialog::keep
bool keep() const
Returns true if the user wants to keep the password.
Definition: kpassdlg.h:335
KPasswordDialog::checkPassword
virtual bool checkPassword(const TQString &)
Virtual function that can be overridden to provide password checking in derived classes.
Definition: kpassdlg.h:381
KDialogBase
A dialog base class with standard buttons and predefined layouts.
Definition: kdialogbase.h:191
KPasswordDialog::Password
The user is asked to enter a password.
Definition: kpassdlg.h:164
KPasswordDialog
A password input dialog.
Definition: kpassdlg.h:151
KDialogBase::slotCancel
virtual void slotCancel()
Activated when the Cancel button has been clicked.
Definition: kdialogbase.cpp:1215
KPasswordDialog::password
TQString password() const
Returns the password entered.
Definition: kpassdlg.h:323
KPasswordDialog::Types
Types
This enum distinguishes the two operation modes of this dialog:
Definition: kpassdlg.h:160

tdeui

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

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.8.13
This website is maintained by Timothy Pearson.