PasswordDialog Class Reference

Shows a dialog for entering the password. More...

#include <passworddialog.h>

Inheritance diagram for PasswordDialog:

YAPETUI::BaseWindow

List of all members.

Public Member Functions

YAPET::KeygetKey () const
 Returns the key generated from the password.
 PasswordDialog (PWTYPE pt, std::string fn) throw (YAPETUI::UIException)
 Constructor.
void refresh () throw (YAPETUI::UIException)
void resize () throw (YAPETUI::UIException)
void run () throw (YAPETUI::UIException)
 Displays the password dialog.
 ~PasswordDialog ()

Private Types

enum  { HEIGHT_NEW = 9, HEIGHT_EX = 7 }

Private Member Functions

void createWindow () throw (YAPETUI::UIException)
int getHeight () const
int getStartX () const
int getStartY () const
int getWidth () const
const PasswordDialogoperator= (const PasswordDialog &)
 PasswordDialog (const PasswordDialog &)

Private Attributes

YAPETUI::Buttoncancelbutton
std::string filename
YAPET::Keykey
YAPETUI::Buttonokbutton
YAPETUI::PasswordWidgetpwidget1
YAPETUI::PasswordWidgetpwidget2
PWTYPE pwtype
WINDOW * window


Detailed Description

Depending on the PWTYPE, it shows either one or two password input widgets. If PWTYPE is NEW_PW, it shows two input widgets, one for the password and the other to confirm the password. If the passwords matches and the user doesn't cancel the dialog, a Key is generated and put on the heap. The pointer to the key can be obtained by calling getKey(). The memory occupied by this key is NOT freed by this class.

If PWTYPE is EXISTING_PW, only one widget for entering the password is displayed. The same rules as for NEW_PW apply in regard to the key.

Definition at line 82 of file passworddialog.h.


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
HEIGHT_NEW 
HEIGHT_EX 

Definition at line 84 of file passworddialog.h.


Constructor & Destructor Documentation

PasswordDialog::PasswordDialog ( const PasswordDialog  )  [inline, private]

Definition at line 99 of file passworddialog.h.

PasswordDialog::PasswordDialog ( PWTYPE  pt,
std::string  fn 
) throw (YAPETUI::UIException)

Sets up the dialog, but does not show it. Use run() to display the dialog to the user.

Parameters:
pt the type of the dialog. NEW_PW for asking for a new password with confirmation, or EXISTING_PW for asking for an existing password.
fn the filename of the file for which the password is asked.

Definition at line 52 of file passworddialog.cc.

PasswordDialog::~PasswordDialog (  ) 

Definition at line 64 of file passworddialog.cc.

References cancelbutton, NEW_PW, okbutton, pwidget1, pwidget2, pwtype, and window.


Member Function Documentation

void PasswordDialog::createWindow (  )  throw (YAPETUI::UIException) [private]

int PasswordDialog::getHeight (  )  const [inline, private]

Definition at line 106 of file passworddialog.h.

References HEIGHT_EX, HEIGHT_NEW, NEW_PW, and pwtype.

Referenced by createWindow(), and getStartY().

YAPET::Key* PasswordDialog::getKey (  )  const [inline]

Use this function to get the key generated from the password entered. If the dialog has been canceled or the passwords do not match in case of entering a fresh password, NULL is returned.

The caller is responsible for freeing the memory occupied by the key.

Returns:
the pointer to the key or NULL if no key was/could be generated. The memory occupied by the key has to be freed by the caller.

Definition at line 160 of file passworddialog.h.

References key.

Referenced by MainWindow::changePassword(), MainWindow::createFile(), MainWindow::lockScreen(), and MainWindow::openFile().

int PasswordDialog::getStartX (  )  const [inline, private]

Definition at line 113 of file passworddialog.h.

References getWidth(), and YAPETUI::BaseWindow::maxX().

Referenced by createWindow().

int PasswordDialog::getStartY (  )  const [inline, private]

Definition at line 117 of file passworddialog.h.

References getHeight(), and YAPETUI::BaseWindow::maxY().

Referenced by createWindow().

int PasswordDialog::getWidth (  )  const [inline, private]

Definition at line 102 of file passworddialog.h.

References YAPETUI::BaseWindow::maxX().

Referenced by createWindow(), and getStartX().

const PasswordDialog& PasswordDialog::operator= ( const PasswordDialog  )  [inline, private]

Definition at line 100 of file passworddialog.h.

void PasswordDialog::refresh (  )  throw (YAPETUI::UIException) [virtual]

void PasswordDialog::resize (  )  throw (YAPETUI::UIException) [virtual]

void PasswordDialog::run (  )  throw (YAPETUI::UIException)


Member Data Documentation

Definition at line 93 of file passworddialog.h.

Referenced by createWindow(), refresh(), resize(), run(), and ~PasswordDialog().

std::string PasswordDialog::filename [private]

Definition at line 97 of file passworddialog.h.

Referenced by refresh().

Definition at line 95 of file passworddialog.h.

Referenced by getKey(), and run().

Definition at line 92 of file passworddialog.h.

Referenced by createWindow(), refresh(), resize(), run(), and ~PasswordDialog().

Definition at line 90 of file passworddialog.h.

Referenced by createWindow(), refresh(), resize(), run(), and ~PasswordDialog().

Definition at line 91 of file passworddialog.h.

Referenced by createWindow(), refresh(), resize(), run(), and ~PasswordDialog().

Definition at line 94 of file passworddialog.h.

Referenced by createWindow(), getHeight(), refresh(), resize(), run(), and ~PasswordDialog().

WINDOW* PasswordDialog::window [private]

Definition at line 89 of file passworddialog.h.

Referenced by createWindow(), refresh(), resize(), and ~PasswordDialog().


The documentation for this class was generated from the following files:

Generated on Thu Jun 11 19:13:03 2009 for YAPET by  doxygen 1.5.8