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

tdeui

  • tdeui
kpassdlg.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1998 Pietro Iglio <iglio@fub.it>
3  Copyright (C) 1999,2000 Geert Jansen <jansen@kde.org>
4  Copyright (C) 2004,2005 Andrew Coles <andrew_coles@yahoo.co.uk>
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 License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 #ifndef __KPassDlg_h_included__
21 #define __KPassDlg_h_included__
22 
23 #include <tqstring.h>
24 #include <tqlineedit.h>
25 #include <kdialogbase.h>
26 
27 class TQLabel;
28 class TQGridLayout;
29 class TQWidget;
30 
38 class TDEUI_EXPORT KPasswordEdit
39  : public TQLineEdit
40 {
41  Q_OBJECT
42 
43 public:
44  enum EchoModes { OneStar, ThreeStars, NoEcho };
45 
49  KPasswordEdit(TQWidget *parent=0, const char *name=0);
50  // KDE4: either of the two must go! add default values for parameters
51 
57  KPasswordEdit(EchoMode echoMode, TQWidget *parent, const char *name);
58 
64  KPasswordEdit(EchoModes echoMode, TQWidget *parent, const char *name);
65 
70  KPasswordEdit(TQWidget *parent, const char *name, int echoMode) KDE_DEPRECATED;
71 
75  ~KPasswordEdit();
76 
81  const char *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 
159 class TDEUI_EXPORT KPasswordDialog
160  : public KDialogBase
161 {
162  Q_OBJECT
163 
164 public:
168  enum Types {
172  Password,
173 
179  NewPassword
180  };
181 
196  KPasswordDialog(Types type, bool enableKeep, int extraBttn,
197  TQWidget *parent=0, const char *name=0);
198 
203  KPasswordDialog(int type, TQString prompt, bool enableKeep=false,
204  int extraBttn=0) KDE_DEPRECATED;
205  // note that this implicitly deprecates the 'prompt' variants of
206  // getPassword() below. i guess the above constructor needs to be extended.
207 
223  KPasswordDialog(Types type, bool enableKeep, int extraBttn, const TQString& iconName,
224  TQWidget *parent = 0, const char *name = 0);
225 
229  virtual ~KPasswordDialog();
230 
234  void setPrompt(TQString prompt);
235 
239  TQString prompt() const;
240 
244  void setKeepWarning(TQString warn);
245 
249  void addLine(TQString key, TQString value);
250 
255  void setAllowEmptyPasswords(bool allowed);
256 
261  bool allowEmptyPasswords() const;
262 
271  void setMinimumPasswordLength(int minLength);
272 
277  int minimumPasswordLength() const;
278 
286  void setMaximumPasswordLength(int maxLength);
287 
292  int maximumPasswordLength() const;
293 
302  void setReasonablePasswordLength(int reasonableLength);
303 
308  int reasonablePasswordLength() const;
309 
320  void setPasswordStrengthWarningLevel(int warningLevel);
321 
326  int passwordStrengthWarningLevel() const;
327 
332  const char *password() const { return m_pEdit->password(); }
333 
339  void clearPassword();
340 
344  bool keep() const { return m_Keep; }
345 
358  static int getPassword(TQCString &password, TQString prompt, int *keep=0L);
359 
370  static int getNewPassword(TQCString &password, TQString prompt);
371 
375  static void disableCoreDumps();
376 
377 protected slots:
378  void slotOk();
379  void slotCancel();
380  void slotKeep(bool);
381  void slotLayout();
382 
383 protected:
384 
390  virtual bool checkPassword(const char *) { return true; }
391 
392 private slots:
393  void enableOkBtn();
394 
395 private:
396  void init();
397  void erase();
398 
399  int m_Keep;
400  int m_Type;
401  int m_Row;
402  TQLabel *m_pHelpLbl;
403  TQLabel *m_keepWarnLbl;
404  TQGridLayout *m_pGrid;
405  TQWidget *m_pMain;
406  KPasswordEdit *m_pEdit;
407  KPasswordEdit *m_pEdit2;
408 
409 protected:
410  virtual void virtual_hook( int id, void* data );
411 private:
412  class KPasswordDialogPrivate;
413  KPasswordDialogPrivate* const d;
414 };
415 
416 
417 #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:38
KPasswordDialog::password
const char * password() const
Returns the password entered.
Definition: kpassdlg.h:332
KDialogBase
A dialog base class with standard buttons and predefined layouts.
Definition: kdialogbase.h:191
KPasswordDialog::keep
bool keep() const
Returns true if the user wants to keep the password.
Definition: kpassdlg.h:344
KPasswordDialog::Password
The user is asked to enter a password.
Definition: kpassdlg.h:172
KPasswordDialog
A password input dialog.
Definition: kpassdlg.h:159
KDialogBase::slotCancel
virtual void slotCancel()
Activated when the Cancel button has been clicked.
Definition: kdialogbase.cpp:1215
KPasswordDialog::checkPassword
virtual bool checkPassword(const char *)
Virtual function that can be overridden to provide password checking in derived classes.
Definition: kpassdlg.h:390
KPasswordDialog::Types
Types
This enum distinguishes the two operation modes of this dialog:
Definition: kpassdlg.h:168

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
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.8.8
This website is maintained by Timothy Pearson.