A window that displays all the information associated with a decrypted password record. More...
#include <passwordrecord.h>


Public Member Functions | |
| bool | entryChanged () const |
| Indicates whether or not the record has been changed. | |
| YAPET::PartDec * | getEncEntry () 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 PasswordRecord & | operator= (const PasswordRecord &) |
| PasswordRecord (const PasswordRecord &) | |
Private Attributes | |
| YAPET::UI::Button * | cancelbutton |
| YAPET::UI::InputWidget * | comment |
| bool | commentchanged |
| YAPET::PartDec * | encentry |
| YAPET::UI::InputWidget * | host |
| bool | hostchanged |
| YAPET::Key * | key |
| YAPET::UI::InputWidget * | name |
| bool | namechanged |
| YAPET::UI::Button * | okbutton |
| YAPET::UI::InputWidget * | password |
| bool | passwordchanged |
| YAPET::UI::Button * | pwgenbutton |
| 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::InputWidget * | username |
| bool | usernamechanged |
| WINDOW * | window |
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.
anonymous enum [private] |
Definition at line 78 of file passwordrecord.h.
| 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.
| 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().

| PasswordRecord::~PasswordRecord | ( | ) |
Definition at line 183 of file passwordrecord.cc.
References cancelbutton, comment, host, name, okbutton, password, pwgenbutton, username, and window.
| 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().


| bool PasswordRecord::entryChanged | ( | ) | const |
Indicates whether or not the record has been changed.
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().


| 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.
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().

| int PasswordRecord::getHeight | ( | ) | const [inline, protected] |
Definition at line 118 of file passwordrecord.h.
Referenced by createWindow(), and getStartY().

| 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().


| int PasswordRecord::getStartY | ( | ) | const [inline, protected] |
Definition at line 126 of file passwordrecord.h.
References getHeight(), and YAPET::UI::BaseWindow::maxY().
Referenced by createWindow().


| int PasswordRecord::getWidth | ( | ) | const [inline, protected] |
Definition at line 114 of file passwordrecord.h.
References YAPET::UI::BaseWindow::maxX().
Referenced by createWindow(), and getStartX().


| const PasswordRecord& PasswordRecord::operator= | ( | const PasswordRecord & | ) | [inline, private] |
Definition at line 108 of file passwordrecord.h.
| void PasswordRecord::refresh | ( | ) | throw (YAPET::UI::UIException) [virtual] |
Implements YAPET::UI::BaseWindow.
Definition at line 467 of file passwordrecord.cc.
References box(), cancelbutton, comment, commentchanged, host, hostchanged, YAPET::UI::MESSAGEBOX, name, namechanged, okbutton, password, passwordchanged, pwgenbutton, readonly, YAPET::UI::Button::refresh(), YAPET::UI::InputWidget::refresh(), s_comment, s_host, s_name, s_password, s_username, YAPET::UI::Colors::setcolor(), YAPET::UI::InputWidget::setText(), YAPET::UI::InputWidget::setTextChanged(), username, usernamechanged, and window.
Referenced by createWindow(), run(), and sureToCancel().


| 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.

| void PasswordRecord::run | ( | ) | throw (YAPET::UI::UIException) |
Shows the dialog and handles user input.
Call getEncEntry() for obtaining the encrypted password record.
Definition at line 199 of file passwordrecord.cc.
References cancelbutton, YAPET::PasswordRecord::comment, comment, commentchanged, encentry, entryChanged(), YAPET::UI::Button::focus(), YAPET::UI::InputWidget::focus(), PWGenDialog::getPassword(), YAPET::UI::InputWidget::getText(), YAPET::PasswordRecord::host, host, hostchanged, PWGenDialog::isCanceled(), YAPET::UI::InputWidget::isTextChanged(), key, KEY_CTRL_E, KEY_ESC, YAPET::PasswordRecord::name, name, namechanged, okbutton, YAPET::PasswordRecord::password, password, passwordchanged, pwgenbutton, refresh(), YAPET::UI::BaseWindow::refreshAll(), YAPET::UI::BaseWindow::resizeAll(), PWGenDialog::run(), YAPET::UI::MessageBox::run(), s_comment, s_host, s_name, s_password, s_username, setReadonly(), YAPET::UI::InputWidget::setText(), YAPET::UI::InputWidget::setTextChanged(), sureToCancel(), YAPET::PasswordRecord::username, username, usernamechanged, and YAPET::YAPETException::what().
Referenced by MainWindow::addNewRecord(), and MainWindow::editSelectedRecord().


| 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().


| 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().


YAPET::UI::Button* PasswordRecord::cancelbutton [private] |
Definition at line 89 of file passwordrecord.h.
Referenced by createWindow(), refresh(), resize(), run(), and ~PasswordRecord().
YAPET::UI::InputWidget* PasswordRecord::comment [private] |
Definition at line 87 of file passwordrecord.h.
Referenced by createWindow(), entryChanged(), refresh(), resize(), run(), setReadonly(), and ~PasswordRecord().
bool PasswordRecord::commentchanged [private] |
Definition at line 104 of file passwordrecord.h.
YAPET::PartDec* PasswordRecord::encentry [private] |
Definition at line 94 of file passwordrecord.h.
Referenced by getEncEntry(), run(), and sureToCancel().
YAPET::UI::InputWidget* PasswordRecord::host [private] |
Definition at line 84 of file passwordrecord.h.
Referenced by createWindow(), entryChanged(), refresh(), resize(), run(), setReadonly(), and ~PasswordRecord().
bool PasswordRecord::hostchanged [private] |
Definition at line 101 of file passwordrecord.h.
YAPET::Key* PasswordRecord::key [private] |
Definition at line 93 of file passwordrecord.h.
Referenced by run().
YAPET::UI::InputWidget* PasswordRecord::name [private] |
Definition at line 83 of file passwordrecord.h.
Referenced by createWindow(), entryChanged(), refresh(), resize(), run(), setReadonly(), and ~PasswordRecord().
bool PasswordRecord::namechanged [private] |
Definition at line 100 of file passwordrecord.h.
YAPET::UI::Button* PasswordRecord::okbutton [private] |
Definition at line 88 of file passwordrecord.h.
Referenced by createWindow(), refresh(), resize(), run(), and ~PasswordRecord().
YAPET::UI::InputWidget* PasswordRecord::password [private] |
Definition at line 86 of file passwordrecord.h.
Referenced by createWindow(), entryChanged(), refresh(), resize(), run(), setReadonly(), and ~PasswordRecord().
bool PasswordRecord::passwordchanged [private] |
Definition at line 103 of file passwordrecord.h.
YAPET::UI::Button* PasswordRecord::pwgenbutton [private] |
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.
YAPET::UI::secstring PasswordRecord::s_host [private] |
Definition at line 96 of file passwordrecord.h.
YAPET::UI::secstring PasswordRecord::s_name [private] |
Definition at line 95 of file passwordrecord.h.
Definition at line 98 of file passwordrecord.h.
Definition at line 97 of file passwordrecord.h.
YAPET::UI::InputWidget* PasswordRecord::username [private] |
Definition at line 85 of file passwordrecord.h.
Referenced by createWindow(), entryChanged(), refresh(), resize(), run(), setReadonly(), and ~PasswordRecord().
bool PasswordRecord::usernamechanged [private] |
Definition at line 102 of file passwordrecord.h.
WINDOW* PasswordRecord::window [private] |
Definition at line 82 of file passwordrecord.h.
Referenced by createWindow(), refresh(), resize(), and ~PasswordRecord().
1.7.1