Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes

PasswordRecord Class Reference

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

#include <passwordrecord.h>

Inheritance diagram for PasswordRecord:
Inheritance graph
[legend]
Collaboration diagram for PasswordRecord:
Collaboration graph
[legend]

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.
bool getReadonly () const
 PasswordRecord (YAPET::Key &k, YAPET::PartDec *pe, bool ro=false) throw (YAPET::UI::UIException)
 Constructor.
void refresh () throw (YAPET::UI::UIException)
void resize () throw (YAPET::UI::UIException)
void run () throw (YAPET::UI::UIException)
 Shows the dialog and handles user input.
void setReadonly (bool ro)
 ~PasswordRecord ()

Protected Member Functions

void createWindow () throw (YAPET::UI::UIException)
int getHeight () const
int getStartX () const
int getStartY () const
int getWidth () const
bool sureToCancel () throw (YAPET::UI::UIException)
 Asks the user whether or not he want to cancel.

Private Types

enum  { HEIGHT = 14 }

Private Member Functions

const PasswordRecordoperator= (const PasswordRecord &)
 PasswordRecord (const PasswordRecord &)

Private Attributes

YAPET::UI::Buttoncancelbutton
YAPET::UI::InputWidgetcomment
bool commentchanged
YAPET::PartDecencentry
YAPET::UI::InputWidgethost
bool hostchanged
YAPET::Keykey
YAPET::UI::InputWidgetname
bool namechanged
YAPET::UI::Buttonokbutton
YAPET::UI::InputWidgetpassword
bool passwordchanged
YAPET::UI::Buttonpwgenbutton
bool readonly
YAPET::UI::secstring s_comment
YAPET::UI::secstring s_host
YAPET::UI::secstring s_name
YAPET::UI::secstring s_password
YAPET::UI::secstring s_username
YAPET::UI::InputWidgetusername
bool usernamechanged
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 76 of file passwordrecord.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
HEIGHT 

Definition at line 78 of file passwordrecord.h.


Constructor & Destructor Documentation

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

Definition at line 107 of file passwordrecord.h.

PasswordRecord::PasswordRecord ( YAPET::Key k,
YAPET::PartDec pe,
bool  ro = false 
) throw (YAPET::UI::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 123 of file passwordrecord.cc.

References YAPET::Crypt::decrypt(), YAPET::UI::MessageBox::run(), and YAPET::YAPETException::what().

Here is the call graph for this function:

PasswordRecord::~PasswordRecord (  ) 

Definition at line 183 of file passwordrecord.cc.

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


Member Function Documentation

void PasswordRecord::createWindow (  )  throw (YAPET::UI::UIException) [protected]

Definition at line 40 of file passwordrecord.cc.

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

Referenced by resize().

Here is the call graph for this function:

Here is the caller graph for this function:

bool PasswordRecord::entryChanged (  )  const

Indicates whether or not the record has been changed.

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

Definition at line 540 of file passwordrecord.cc.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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 173 of file passwordrecord.h.

References encentry.

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

Here is the caller graph for this function:

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

Definition at line 118 of file passwordrecord.h.

Referenced by createWindow(), and getStartY().

Here is the caller graph for this function:

bool PasswordRecord::getReadonly (  )  const [inline]

Definition at line 188 of file passwordrecord.h.

References readonly.

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

Definition at line 122 of file passwordrecord.h.

References getWidth(), and YAPET::UI::BaseWindow::maxX().

Referenced by createWindow().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 126 of file passwordrecord.h.

References getHeight(), and YAPET::UI::BaseWindow::maxY().

Referenced by createWindow().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 114 of file passwordrecord.h.

References YAPET::UI::BaseWindow::maxX().

Referenced by createWindow(), and getStartX().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 108 of file passwordrecord.h.

void PasswordRecord::refresh (  )  throw (YAPET::UI::UIException) [virtual]
void PasswordRecord::resize (  )  throw (YAPET::UI::UIException) [virtual]

Implements YAPET::UI::BaseWindow.

Definition at line 437 of file passwordrecord.cc.

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

Here is the call graph for this function:

void PasswordRecord::run (  )  throw (YAPET::UI::UIException)
void PasswordRecord::setReadonly ( bool  ro  ) 

Definition at line 549 of file passwordrecord.cc.

References comment, host, name, password, pwgenbutton, readonly, YAPET::UI::Button::setReadonly(), YAPET::UI::InputWidget::setReadonly(), and username.

Referenced by run().

Here is the call graph for this function:

Here is the caller graph for this function:

bool PasswordRecord::sureToCancel (  )  throw (YAPET::UI::UIException) [protected]

Ask the user whether or not he want to cancel, but only if fields have been changed.

Definition at line 94 of file passwordrecord.cc.

References YAPET::UI::ANSWER_OK, encentry, entryChanged(), YAPET::UI::DialogBox::getAnswer(), refresh(), and YAPET::UI::DialogBox::run().

Referenced by run().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 89 of file passwordrecord.h.

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

Definition at line 104 of file passwordrecord.h.

Referenced by refresh(), and run().

Definition at line 94 of file passwordrecord.h.

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

Definition at line 101 of file passwordrecord.h.

Referenced by refresh(), and run().

Definition at line 93 of file passwordrecord.h.

Referenced by run().

Definition at line 100 of file passwordrecord.h.

Referenced by refresh(), and run().

Definition at line 88 of file passwordrecord.h.

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

Definition at line 103 of file passwordrecord.h.

Referenced by refresh(), and run().

Definition at line 91 of file passwordrecord.h.

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

bool PasswordRecord::readonly [private]

Definition at line 105 of file passwordrecord.h.

Referenced by createWindow(), getReadonly(), refresh(), and setReadonly().

Definition at line 99 of file passwordrecord.h.

Referenced by refresh(), and run().

Definition at line 96 of file passwordrecord.h.

Referenced by refresh(), and run().

Definition at line 95 of file passwordrecord.h.

Referenced by refresh(), and run().

Definition at line 98 of file passwordrecord.h.

Referenced by refresh(), and run().

Definition at line 97 of file passwordrecord.h.

Referenced by refresh(), and run().

Definition at line 102 of file passwordrecord.h.

Referenced by refresh(), and run().

WINDOW* PasswordRecord::window [private]

Definition at line 82 of file passwordrecord.h.

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


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