diff options
Diffstat (limited to 'src/stamps/StampsModel.h')
| -rw-r--r-- | src/stamps/StampsModel.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/stamps/StampsModel.h b/src/stamps/StampsModel.h new file mode 100644 index 0000000..cee158c --- /dev/null +++ b/src/stamps/StampsModel.h @@ -0,0 +1,36 @@ +/* + * StampsModel.h + * + * Created on: Mar 29, 2012 + * Author: Simon + */ + +#ifndef STAMPSMODEL_H_ +#define STAMPSMODEL_H_ + +#include <vector> +#include <math.h> +#include "search/Save.h" + +class StampsView; +class StampsModel { + Save * stamp; + std::vector<std::string> stampIDs; + std::vector<Save*> stampsList; + std::vector<StampsView*> observers; + int currentPage; + void notifyStampsListChanged(); + void notifyPageChanged(); +public: + StampsModel(); + int GetPageCount() { return max(1, (int)(ceil(stampIDs.size()/16))); } + int GetPageNum() { return currentPage; } + void AddObserver(StampsView * observer); + std::vector<Save *> GetStampsList(); + void UpdateStampsList(int pageNumber); + Save * GetStamp(); + void SetStamp(Save * newStamp); + virtual ~StampsModel(); +}; + +#endif /* STAMPSMODEL_H_ */ |
