• 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 
82  const char *password() const;
83 
87  void erase();
88 
89  static const int PassLen;
90 
98  void setMaxPasswordLength(int newLength);
99 
104  int maxPasswordLength() const;
105 
106 public slots:
110  virtual void insert( const TQString &);
111 
112 protected:
113  virtual void keyPressEvent(TQKeyEvent *);
114  virtual void focusInEvent(TQFocusEvent *e);
115  virtual bool event(TQEvent *e);
116 
117 private:
118  void init();
119 };
120 
121 
160 class TDEUI_EXPORT KPasswordDialog
161  : public KDialogBase
162 {
163  Q_OBJECT
164 
165 public:
169  enum Types {
173  Password,
174 
180  NewPassword
181  };
182 
197  KPasswordDialog(Types type, bool enableKeep, int extraBttn,
198  TQWidget *parent=0, const char *name=0);
199 
204  KPasswordDialog(int type, TQString prompt, bool enableKeep=false,
205  int extraBttn=0) KDE_DEPRECATED;
206  // note that this implicitly deprecates the 'prompt' variants of
207  // getPassword() below. i guess the above constructor needs to be extended.
208 
224  KPasswordDialog(Types type, bool enableKeep, int extraBttn, const TQString& iconName,
225  TQWidget *parent = 0, const char *name = 0);
226 
230  virtual ~KPasswordDialog();
231 
235  void setPrompt(TQString prompt);
236 
240  TQString prompt() const;
241 
245  void setKeepWarning(TQString warn);
246 
250  void addLine(TQString key, TQString value);
251 
256  void setAllowEmptyPasswords(bool allowed);
257 
262  bool allowEmptyPasswords() const;
263 
272  void setMinimumPasswordLength(int minLength);
273 
278  int minimumPasswordLength() const;
279 
287  void setMaximumPasswordLength(int maxLength);
288 
293  int maximumPasswordLength() const;
294 
303  void setReasonablePasswordLength(int reasonableLength);
304 
309  int reasonablePasswordLength() const;
310 
321  void setPasswordStrengthWarningLevel(int warningLevel);
322 
327  int passwordStrengthWarningLevel() const;
328 
333  const char *password() const { return m_pEdit->password(); }
334 
340  void clearPassword();
341 
345  bool keep() const { return m_Keep; }
346 
359  static int getPassword(TQCString &password, TQString prompt, int *keep=0L);
360 
371  static int getNewPassword(TQCString &password, TQString prompt);
372 
376  static void disableCoreDumps();
377 
378 protected slots:
379  void slotOk();
380  void slotCancel();
381  void slotKeep(bool);
382  void slotLayout();
383 
384 protected:
385 
391  virtual bool checkPassword(const char *) { return true; }
392 
393 private slots:
394  void enableOkBtn();
395 
396 private:
397  void init();
398  void erase();
399 
400  int m_Keep;
401  int m_Type;
402  int m_Row;
403  TQLabel *m_pHelpLbl;
404  TQLabel *m_keepWarnLbl;
405  TQGridLayout *m_pGrid;
406  TQWidget *m_pMain;
407  KPasswordEdit *m_pEdit;
408  KPasswordEdit *m_pEdit2;
409 
410 protected:
411  virtual void virtual_hook( int id, void* data );
412 private:
413  class KPasswordDialogPrivate;
414  KPasswordDialogPrivate* const d;
415 };
416 
417 
418 #endif // __KPassDlg_h_included__

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.1.2
This website is maintained by Timothy Pearson.