diff options
Diffstat (limited to 'src/loanview.h')
-rw-r--r-- | src/loanview.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/loanview.h b/src/loanview.h new file mode 100644 index 0000000..59e4df4 --- /dev/null +++ b/src/loanview.h @@ -0,0 +1,72 @@ +/*************************************************************************** + copyright : (C) 2005-2007 by Robby Stephenson + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of version 2 of the GNU General Public License as * + * published by the Free Software Foundation; * + * * + ***************************************************************************/ + +#ifndef TELLICO_LOANVIEW_H +#define TELLICO_LOANVIEW_H + +#include "gui/listview.h" +#include "observer.h" +#include "borroweritem.h" + +#include <qdict.h> + +namespace Tellico { + namespace Data { + class Borrower; + } + +/** + * @author Robby Stephenson + */ +class LoanView : public GUI::ListView, public Observer { +Q_OBJECT + +public: + LoanView(QWidget* parent, const char* name=0); + + virtual bool isSelectable(GUI::ListViewItem*) const; + + virtual void addCollection(Data::CollPtr coll); + + virtual void addField(Data::CollPtr, Data::FieldPtr); + virtual void modifyField(Data::CollPtr, Data::FieldPtr, Data::FieldPtr); + virtual void removeField(Data::CollPtr, Data::FieldPtr); + + virtual void addBorrower(Data::BorrowerPtr); + virtual void modifyBorrower(Data::BorrowerPtr); + +private slots: + /** + * Handles the appearance of the popup menu. + * + * @param item A pointer to the item underneath the mouse + * @param point The location point + * @param col The column number, not currently used + */ + void contextMenuRequested(QListViewItem* item, const QPoint& point, int col); + void slotExpanded(QListViewItem* item); + void slotCollapsed(QListViewItem* item); + void slotCheckIn(); + void slotModifyLoan(); + +private: + virtual void setSorting(int column, bool ascending = true); + void resetComparisons(); + + bool m_notSortedYet; + QDict<BorrowerItem> m_itemDict; +}; + +} // end namespace + +#endif |