/* * StampsModel.h * * Created on: Mar 29, 2012 * Author: Simon */ #ifndef STAMPSMODEL_H_ #define STAMPSMODEL_H_ #include #include #include #include "client/SaveFile.h" class LocalBrowserView; class LocalBrowserModel { vector selected; SaveFile * stamp; std::vector stampIDs; std::vector savesList; std::vector observers; int currentPage; void notifySavesListChanged(); void notifyPageChanged(); void notifySelectedChanged(); public: LocalBrowserModel(); int GetPageCount() { return max(1, (int)(ceil(stampIDs.size()/16))); } int GetPageNum() { return currentPage; } void AddObserver(LocalBrowserView * observer); std::vector GetSavesList(); void UpdateSavesList(int pageNumber); SaveFile * GetSave(); void SetSave(SaveFile * newStamp); vector GetSelected() { return selected; } void ClearSelected() { selected.clear(); notifySelectedChanged(); } void SelectSave(std::string stampID); void DeselectSave(std::string stampID); virtual ~LocalBrowserModel(); }; #endif /* STAMPSMODEL_H_ */