-
Notifications
You must be signed in to change notification settings - Fork 746
/
PreviewModel.h
64 lines (54 loc) · 1.48 KB
/
PreviewModel.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef PREVIEWMODEL_H
#define PREVIEWMODEL_H
#include <vector>
#include <iostream>
#include "common/tpt-thread.h"
#include "PreviewView.h"
#include "client/SaveInfo.h"
#include "gui/preview/Comment.h"
#include "gui/search/Thumbnail.h"
#include "client/requestbroker/RequestListener.h"
using namespace std;
class PreviewView;
class PreviewModel: RequestListener {
bool doOpen;
bool canOpen;
vector<PreviewView*> observers;
SaveInfo * save;
std::vector<unsigned char> * saveData;
std::vector<SaveComment*> * saveComments;
void notifySaveChanged();
void notifySaveCommentsChanged();
void notifyCommentsPageChanged();
void notifyCommentBoxEnabledChanged();
//Background retrieval
int tSaveID;
int tSaveDate;
//
bool commentBoxEnabled;
bool commentsLoaded;
int commentsTotal;
int commentsPageNumber;
public:
PreviewModel();
SaveInfo * GetSave();
std::vector<SaveComment*> * GetComments();
bool GetCommentBoxEnabled();
void SetCommentBoxEnabled(bool enabledState);
bool GetCommentsLoaded();
int GetCommentsPageNum();
int GetCommentsPageCount();
void UpdateComments(int pageNumber);
void CommentAdded();
void AddObserver(PreviewView * observer);
void UpdateSave(int saveID, int saveDate);
void SetFavourite(bool favourite);
bool GetDoOpen();
bool GetCanOpen();
void SetDoOpen(bool doOpen);
void Update();
virtual void OnResponseReady(void * object, int identifier);
virtual void OnResponseFailed(int identifier);
virtual ~PreviewModel();
};
#endif /* PREVIEWMODEL_H */