summaryrefslogtreecommitdiff
path: root/src/stamps/StampsModel.h
blob: cee158c2fba03d20aaa8bd9b1dbede2f77def909 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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_ */