#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. | |
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 PasswordRecord & | operator= (const PasswordRecord &) |
PasswordRecord (const PasswordRecord &) | |
Private Attributes | |
YAPETUI::Button * | cancelbutton |
YAPETUI::InputWidget * | comment |
YAPET::PartDec * | encentry |
YAPETUI::InputWidget * | host |
YAPET::Key * | key |
YAPETUI::InputWidget * | name |
YAPETUI::Button * | okbutton |
YAPETUI::InputWidget * | password |
YAPETUI::InputWidget * | username |
WINDOW * | window |
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 73 of file passwordrecord.h.
anonymous enum [private] |
PasswordRecord::PasswordRecord | ( | const PasswordRecord & | ) | [inline, private] |
Definition at line 90 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.
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 77 of file passwordrecord.cc.
PasswordRecord::~PasswordRecord | ( | ) |
Definition at line 91 of file passwordrecord.cc.
References cancelbutton, comment, host, name, okbutton, password, username, and window.
void PasswordRecord::createWindow | ( | ) | throw (YAPETUI::UIException) [private] |
Definition at line 33 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 resize().
bool PasswordRecord::entryChanged | ( | ) | const [inline] |
Indicates whether or not the record has been changed.
true
if the record has been changed, false
otherwise. Definition at line 158 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.
NULL
if the dialog has been canceled. The caller is responsible for freeing the memory associated with the pointer returned. Definition at line 149 of file passwordrecord.h.
References encentry.
Referenced by MainWindow::addNewRecord(), and MainWindow::editSelectedRecord().
int PasswordRecord::getHeight | ( | ) | const [inline, private] |
Definition at line 97 of file passwordrecord.h.
References HEIGHT.
Referenced by createWindow(), and getStartY().
int PasswordRecord::getStartX | ( | ) | const [inline, private] |
Definition at line 101 of file passwordrecord.h.
References getWidth(), and YAPETUI::BaseWindow::maxX().
Referenced by createWindow().
int PasswordRecord::getStartY | ( | ) | const [inline, private] |
Definition at line 105 of file passwordrecord.h.
References getHeight(), and YAPETUI::BaseWindow::maxY().
Referenced by createWindow().
int PasswordRecord::getWidth | ( | ) | const [inline, private] |
Definition at line 93 of file passwordrecord.h.
References YAPETUI::BaseWindow::maxX().
Referenced by createWindow(), and getStartX().
const PasswordRecord& PasswordRecord::operator= | ( | const PasswordRecord & | ) | [inline, private] |
Definition at line 91 of file passwordrecord.h.
void PasswordRecord::refresh | ( | ) | throw (YAPETUI::UIException) [virtual] |
Implements YAPETUI::BaseWindow.
Definition at line 229 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 204 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 104 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().
YAPETUI::Button* PasswordRecord::cancelbutton [private] |
Definition at line 86 of file passwordrecord.h.
Referenced by createWindow(), refresh(), resize(), run(), and ~PasswordRecord().
YAPETUI::InputWidget* PasswordRecord::comment [private] |
Definition at line 84 of file passwordrecord.h.
Referenced by createWindow(), entryChanged(), refresh(), resize(), run(), and ~PasswordRecord().
YAPET::PartDec* PasswordRecord::encentry [private] |
YAPETUI::InputWidget* PasswordRecord::host [private] |
Definition at line 81 of file passwordrecord.h.
Referenced by createWindow(), entryChanged(), refresh(), resize(), run(), and ~PasswordRecord().
YAPET::Key* PasswordRecord::key [private] |
YAPETUI::InputWidget* PasswordRecord::name [private] |
Definition at line 80 of file passwordrecord.h.
Referenced by createWindow(), entryChanged(), refresh(), resize(), run(), and ~PasswordRecord().
YAPETUI::Button* PasswordRecord::okbutton [private] |
Definition at line 85 of file passwordrecord.h.
Referenced by createWindow(), refresh(), resize(), run(), and ~PasswordRecord().
YAPETUI::InputWidget* PasswordRecord::password [private] |
Definition at line 83 of file passwordrecord.h.
Referenced by createWindow(), entryChanged(), refresh(), resize(), run(), and ~PasswordRecord().
YAPETUI::InputWidget* PasswordRecord::username [private] |
Definition at line 82 of file passwordrecord.h.
Referenced by createWindow(), entryChanged(), refresh(), resize(), run(), and ~PasswordRecord().
WINDOW* PasswordRecord::window [private] |
Definition at line 79 of file passwordrecord.h.
Referenced by createWindow(), refresh(), resize(), and ~PasswordRecord().