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

kdeui

  • kdeui
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 KDEUI_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 { return m_Password; }
83 
87  void erase();
88 
89  static const int PassLen;
90 
100  void setMaxPasswordLength(int newLength);
101 
106  int maxPasswordLength() const;
107 
108 public slots:
112  virtual void insert( const TQString &);
113 
114 protected:
115  virtual void keyPressEvent(TQKeyEvent *);
116  virtual void focusInEvent(TQFocusEvent *e);
117  virtual bool event(TQEvent *e);
118 
119 private:
120  void init();
121  void showPass();
122 
123  char *m_Password;
124  int m_EchoMode, m_Length;
125 };
126 
127 
166 class KDEUI_EXPORT KPasswordDialog
167  : public KDialogBase
168 {
169  Q_OBJECT
170 
171 public:
175  enum Types {
179  Password,
180 
186  NewPassword
187  };
188 
203  KPasswordDialog(Types type, bool enableKeep, int extraBttn,
204  TQWidget *parent=0, const char *name=0);
205 
210  KPasswordDialog(int type, TQString prompt, bool enableKeep=false,
211  int extraBttn=0) KDE_DEPRECATED;
212  // note that this implicitly deprecates the 'prompt' variants of
213  // getPassword() below. i guess the above constructor needs to be extended.
214 
230  KPasswordDialog(Types type, bool enableKeep, int extraBttn, const TQString& iconName,
231  TQWidget *parent = 0, const char *name = 0);
232 
236  virtual ~KPasswordDialog();
237 
241  void setPrompt(TQString prompt);
242 
246  TQString prompt() const;
247 
251  void setKeepWarning(TQString warn);
252 
256  void addLine(TQString key, TQString value);
257 
262  void setAllowEmptyPasswords(bool allowed);
263 
268  bool allowEmptyPasswords() const;
269 
278  void setMinimumPasswordLength(int minLength);
279 
284  int minimumPasswordLength() const;
285 
293  void setMaximumPasswordLength(int maxLength);
294 
299  int maximumPasswordLength() const;
300 
309  void setReasonablePasswordLength(int reasonableLength);
310 
315  int reasonablePasswordLength() const;
316 
327  void setPasswordStrengthWarningLevel(int warningLevel);
328 
333  int passwordStrengthWarningLevel() const;
334 
339  const char *password() const { return m_pEdit->password(); }
340 
346  void clearPassword();
347 
351  bool keep() const { return m_Keep; }
352 
365  static int getPassword(TQCString &password, TQString prompt, int *keep=0L);
366 
377  static int getNewPassword(TQCString &password, TQString prompt);
378 
382  static void disableCoreDumps();
383 
384 protected slots:
385  void slotOk();
386  void slotCancel();
387  void slotKeep(bool);
388  void slotLayout();
389 
390 protected:
391 
397  virtual bool checkPassword(const char *) { return true; }
398 
399 private slots:
400  void enableOkBtn();
401 
402 private:
403  void init();
404  void erase();
405 
406  int m_Keep, m_Type, m_Row;
407  TQLabel *m_pHelpLbl;
408  TQLabel *m_keepWarnLbl;
409  TQGridLayout *m_pGrid;
410  TQWidget *m_pMain;
411  KPasswordEdit *m_pEdit, *m_pEdit2;
412 
413 protected:
414  virtual void virtual_hook( int id, void* data );
415 private:
416  class KPasswordDialogPrivate;
417  KPasswordDialogPrivate* const d;
418 };
419 
420 
421 #endif // __KPassDlg_h_included__

kdeui

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

kdeui

Skip menu "kdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeui by doxygen 1.8.3.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |