PasswordRecord Class Reference

A window that displays all the information associated with a decrypted password record. More...

#include <passwordrecord.h>

Inheritance diagram for PasswordRecord:

YAPETUI::BaseWindow

List of all members.

Public Member Functions

bool entryChanged () const
 Indicates whether or not the record has been changed.
YAPET::PartDecgetEncEntry () const
 Returns the password record.
 PasswordRecord (YAPET::Key &k, YAPET::PartDec *pe) throw (YAPETUI::UIException)
 Constructor.
void refresh () throw (YAPETUI::UIException)
void resize () throw (YAPETUI::UIException)
void run () throw (YAPETUI::UIException)
 Shows the dialog and handles user input.
 ~PasswordRecord ()

Private Types

enum  { HEIGHT = 14 }

Private Member Functions

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

Private Attributes

YAPETUI::Buttoncancelbutton
YAPETUI::InputWidgetcomment
YAPET::PartDecencentry
YAPETUI::InputWidgethost
YAPET::Keykey
YAPETUI::InputWidgetname
YAPETUI::Buttonokbutton
YAPETUI::InputWidgetpassword
YAPETUI::InputWidgetusername
WINDOW * window


Detailed Description

A window that displays all the information associated with a decrypted password record. The window allows edition of the informations. If the information are edited, a call to entryChanged() yields true if the record has been edited.

To display an existing record, provide a valid pointer to PartDec object when constructing the object. If the record has been changed, getEncEntry() will return the pointer to the PartDec object holding the altered record.

To display a window for creating a new password record, pass NULL to the PartDec pointer argument when constructing. The new record can be obtained by calling getEncEntry().

In any case, the memory occupied by the pointer returned by getEncEntry() has to be freed by the caller. The class does not take care of this.

Definition at line 72 of file passwordrecord.h.


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
HEIGHT 

Definition at line 74 of file passwordrecord.h.


Constructor & Destructor Documentation

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

Definition at line 89 of file passwordrecord.h.

PasswordRecord::PasswordRecord ( YAPET::Key k,
YAPET::PartDec pe 
) throw (YAPETUI::UIException)

Depending on the value passed in pe, either an empty record is showed or the decrypted password record including the password stored in the record in plain text is showed.

Parameters:
k the key used to decrypt/encrypt the password record.
pe pointer to a PartDec which will be displayed, or NULL in order to obtain a new password record.

Definition at line 75 of file passwordrecord.cc.

References createWindow().

PasswordRecord::~PasswordRecord (  ) 

Definition at line 89 of file passwordrecord.cc.

References cancelbutton, comment, host, name, okbutton, password, username, and window.


Member Function Documentation

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

Definition at line 31 of file passwordrecord.cc.

References cancelbutton, comment, YAPET::COMMENT_SIZE, getHeight(), YAPETUI::Button::getLength(), getStartX(), getStartY(), getWidth(), host, YAPET::HOST_SIZE, name, YAPET::NAME_SIZE, okbutton, password, YAPET::PASSWORD_SIZE, refresh(), username, YAPET::USERNAME_SIZE, and window.

Referenced by PasswordRecord(), and resize().

bool PasswordRecord::entryChanged (  )  const [inline]

Indicates whether or not the record has been changed.

Returns:
true if the record has been changed, false otherwise.

Definition at line 157 of file passwordrecord.h.

References comment, host, YAPETUI::InputWidget::isTextChanged(), name, password, and username.

Referenced by MainWindow::addNewRecord(), MainWindow::editSelectedRecord(), and run().

YAPET::PartDec* PasswordRecord::getEncEntry (  )  const [inline]

Returns the new or altered password record as PartDec object. The caller is responsible for freeing the memory associated with the pointer returned.

It returns NULL if the dialog has been canceled.

Returns:
pointer to the new or altered password record, or NULL if the dialog has been canceled. The caller is responsible for freeing the memory associated with the pointer returned.

Definition at line 148 of file passwordrecord.h.

References encentry.

Referenced by MainWindow::addNewRecord(), and MainWindow::editSelectedRecord().

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

Definition at line 96 of file passwordrecord.h.

References HEIGHT.

Referenced by createWindow(), and getStartY().

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

Definition at line 100 of file passwordrecord.h.

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

Referenced by createWindow().

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

Definition at line 104 of file passwordrecord.h.

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

Referenced by createWindow().

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

Definition at line 92 of file passwordrecord.h.

References YAPETUI::BaseWindow::maxX().

Referenced by createWindow(), and getStartX().

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

Definition at line 90 of file passwordrecord.h.

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

Implements YAPETUI::BaseWindow.

Definition at line 227 of file passwordrecord.cc.

References box(), cancelbutton, comment, YAPET::Crypt::decrypt(), encentry, YAPET::PartDec::getEncRecord(), host, key, YAPETUI::MESSAGEBOX, name, okbutton, password, YAPETUI::Button::refresh(), YAPETUI::InputWidget::refresh(), YAPETUI::MessageBox::run(), YAPETUI::Colors::setcolor(), YAPETUI::InputWidget::setText(), username, YAPET::YAPETException::what(), and window.

Referenced by createWindow().

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

Implements YAPETUI::BaseWindow.

Definition at line 202 of file passwordrecord.cc.

References cancelbutton, comment, createWindow(), host, name, okbutton, password, username, and window.

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

Shows the dialog and handles user input.

Call getEncEntry() for obtaining the encrypted password record.

Definition at line 102 of file passwordrecord.cc.

References cancelbutton, YAPET::PasswordRecord::comment, comment, YAPET::COMMENT_SIZE, encentry, entryChanged(), YAPETUI::Button::focus(), YAPETUI::InputWidget::focus(), YAPETUI::InputWidget::getText(), YAPET::PasswordRecord::host, host, YAPET::HOST_SIZE, key, YAPET::PasswordRecord::name, name, YAPET::NAME_SIZE, okbutton, YAPET::PasswordRecord::password, password, YAPET::PASSWORD_SIZE, YAPETUI::BaseWindow::resizeAll(), YAPETUI::MessageBox::run(), YAPET::PasswordRecord::username, username, YAPET::USERNAME_SIZE, and YAPET::YAPETException::what().

Referenced by MainWindow::addNewRecord(), and MainWindow::editSelectedRecord().


Member Data Documentation

YAPETUI::Button* PasswordRecord::cancelbutton [private]

Definition at line 85 of file passwordrecord.h.

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

YAPETUI::InputWidget* PasswordRecord::comment [private]

Definition at line 83 of file passwordrecord.h.

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

YAPET::PartDec* PasswordRecord::encentry [private]

Definition at line 87 of file passwordrecord.h.

Referenced by getEncEntry(), refresh(), and run().

YAPETUI::InputWidget* PasswordRecord::host [private]

Definition at line 80 of file passwordrecord.h.

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

YAPET::Key* PasswordRecord::key [private]

Definition at line 86 of file passwordrecord.h.

Referenced by refresh(), and run().

YAPETUI::InputWidget* PasswordRecord::name [private]

Definition at line 79 of file passwordrecord.h.

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

YAPETUI::Button* PasswordRecord::okbutton [private]

Definition at line 84 of file passwordrecord.h.

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

YAPETUI::InputWidget* PasswordRecord::password [private]

Definition at line 82 of file passwordrecord.h.

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

YAPETUI::InputWidget* PasswordRecord::username [private]

Definition at line 81 of file passwordrecord.h.

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

WINDOW* PasswordRecord::window [private]

Definition at line 78 of file passwordrecord.h.

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


The documentation for this class was generated from the following files:
Generated on Wed Feb 27 16:15:42 2008 for YAPET by  doxygen 1.5.4