This repository has been archived on 2024-03-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
kpasman/kpasman/kpasmanview.h
2014-11-26 08:33:20 -06:00

88 lines
2.7 KiB
C++

#ifndef KPASMANVIEW_H
#define KPASMANVIEW_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
// include files for Qt
#include <qlistview.h>
#include <qwidget.h>
class KpasmanDoc;
/** The KpasmanView class provides the view widget for the KpasmanApp instance.
* The View instance inherits QWidget as a base class and represents the view object of a KTMainWindow. As KpasmanView is part of the
* docuement-view model, it needs a reference to the document object connected with it by the KpasmanApp class to manipulate and display
* the document structure provided by the KpasmanDoc class.
*
* @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
* @version KDevelop version 0.4 code generation
*/
class KpasmanView : public QListView
{
Q_OBJECT
public:
/** Constructor for the main view */
KpasmanView(QWidget* parent = 0, const char* name=0);
/** Destructor for the main view */
~KpasmanView();
/** returns a pointer to the document connected to the view instance. Mind that this method requires a KpasmanApp instance as a parent
* widget to get to the window document pointer by calling the KpasmanApp::getDocument() method.
*
* @see KpasmanApp#getDocument
*/
KpasmanDoc* getDocument() const;
/** handy helper to flag the doc when things change */
void setDocDirty(bool dirty);
/** hides or unhides the password column */
void hidePassword(bool mode);
/** returns password column state */
bool isPasswordHidden() {return m_bPWHidden;};
/** locks/unlocks the window */
void lockWindow(bool mode);
/** returns if window is locked */
bool isLocked() {return m_bLocked;};
/** adds a new entry, returns true if something added */
bool addEntry();
/** edits an entry, returns true if something changed */
bool editEntry();
/** deletes an entry, returns true if something deleted */
bool deleteEntry();
public slots:
/** adds a new entry, returns true if something added */
bool slotAddEntry() {return addEntry();};
/** edits an entry, returns true if something changed */
bool slotEditEntry() {return editEntry();};
/** deletes an entry, returns true if something deleted */
bool slotDeleteEntry() {return deleteEntry();};
protected:
/** catches our doubleclick to edit an entry */
void mouseDoubleClickEvent(QMouseEvent* event);
/** catches our rightmouse click */
void mousePressEvent(QMouseEvent* event);
private:
/** stores password column number */
int m_iPWColumn;
/** stores whether or not the password column is "hidden" */
bool m_bPWHidden;
/** stores password column sizing for "unhiding" */
int m_iPWSize;
/** stores if the window is locked */
bool m_bLocked;
/** stores if passwords were visible before we locked */
bool m_bLockPasswords;
};
#endif // KPASMANVIEW_H