diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-02 16:01:28 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-02 16:01:28 (GMT) |
| commit | efddc12e5d2aadc5eee1927245ad38b9dee89aed (patch) | |
| tree | cf7ad38119f0734609944158e33bbb944925c777 /src/stamps/StampsModel.h | |
| parent | 289556ac7078963b6af361f5812dd62e6712359f (diff) | |
| download | powder-efddc12e5d2aadc5eee1927245ad38b9dee89aed.zip powder-efddc12e5d2aadc5eee1927245ad38b9dee89aed.tar.gz | |
Stamps browser, placement + clipboard sampling and placement - No clipboard or stamp thumbnail generation, needs thumbnail generator from SaveLoader
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_ */ |
