• 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
27class TQLabel;
28class TQGridLayout;
29class TQWidget;
30
38class TDEUI_EXPORT KPasswordEdit
39 : public TQLineEdit
40{
41 TQ_OBJECT
42
43public:
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) TDE_DEPRECATED;
71
75 ~KPasswordEdit();
76
80 TQString password() const;
81
85 void erase();
86
87 static const int PassLen;
88
96 void setMaxPasswordLength(int newLength);
97
102 int maxPasswordLength() const;
103
104public slots:
108 virtual void insert( const TQString &);
109
110protected:
111 virtual void keyPressEvent(TQKeyEvent *);
112 virtual void focusInEvent(TQFocusEvent *e);
113 virtual bool event(TQEvent *e);
114
115private:
116 void init();
117};
118
119
150class TDEUI_EXPORT KPasswordDialog
151 : public KDialogBase
152{
153 TQ_OBJECT
154
155public:
159 enum Types {
163 Password,
164
170 NewPassword
171 };
172
187 KPasswordDialog(Types type, bool enableKeep, int extraBttn,
188 TQWidget *parent=0, const char *name=0);
189
194 KPasswordDialog(int type, TQString prompt, bool enableKeep=false,
195 int extraBttn=0) TDE_DEPRECATED;
196 // note that this implicitly deprecates the 'prompt' variants of
197 // getPassword() below. i guess the above constructor needs to be extended.
198
214 KPasswordDialog(Types type, bool enableKeep, int extraBttn, const TQString& iconName,
215 TQWidget *parent = 0, const char *name = 0);
216
220 virtual ~KPasswordDialog();
221
225 void setPrompt(TQString prompt);
226
230 TQString prompt() const;
231
235 void setKeepWarning(TQString warn);
236
240 void addLine(TQString key, TQString value);
241
246 void setAllowEmptyPasswords(bool allowed);
247
252 bool allowEmptyPasswords() const;
253
262 void setMinimumPasswordLength(int minLength);
263
268 int minimumPasswordLength() const;
269
277 void setMaximumPasswordLength(int maxLength);
278
283 int maximumPasswordLength() const;
284
293 void setReasonablePasswordLength(int reasonableLength);
294
299 int reasonablePasswordLength() const;
300
311 void setPasswordStrengthWarningLevel(int warningLevel);
312
317 int passwordStrengthWarningLevel() const;
318
322 TQString password() const { return m_pEdit->password(); }
323
329 void clearPassword();
330
334 bool keep() const { return m_Keep; }
335
348 static int getPassword(TQString &password, TQString prompt, int *keep=0L);
349
360 static int getNewPassword(TQString &password, TQString prompt);
361
365 static void disableCoreDumps();
366
367protected slots:
368 void slotOk();
369 void slotCancel();
370 void slotKeep(bool);
371 void slotLayout();
372
373protected:
374
380 virtual bool checkPassword(const TQString&) { return true; }
381
382private slots:
383 void enableOkBtn();
384
385private:
386 void init();
387 void erase();
388
389 int m_Keep;
390 int m_Type;
391 int m_Row;
392 TQLabel *m_pHelpLbl;
393 TQLabel *m_keepWarnLbl;
394 TQGridLayout *m_pGrid;
395 TQWidget *m_pMain;
396 KPasswordEdit *m_pEdit;
397 KPasswordEdit *m_pEdit2;
398
399protected:
400 virtual void virtual_hook( int id, void* data );
401private:
402 class KPasswordDialogPrivate;
403 KPasswordDialogPrivate* const d;
404};
405
406
407#endif // __KPassDlg_h_included__
KDialogBase
A dialog base class with standard buttons and predefined layouts.
Definition: kdialogbase.h:192
KPasswordDialog
A password input dialog.
Definition: kpassdlg.h:152
KPasswordDialog::password
TQString password() const
Returns the password entered.
Definition: kpassdlg.h:322
KPasswordDialog::keep
bool keep() const
Returns true if the user wants to keep the password.
Definition: kpassdlg.h:334
KPasswordDialog::checkPassword
virtual bool checkPassword(const TQString &)
Virtual function that can be overridden to provide password checking in derived classes.
Definition: kpassdlg.h:380
KPasswordDialog::Types
Types
This enum distinguishes the two operation modes of this dialog:
Definition: kpassdlg.h:159
KPasswordDialog::Password
@ Password
The user is asked to enter a password.
Definition: kpassdlg.h:163
KPasswordEdit
A safe password input widget.
Definition: kpassdlg.h:40

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