/
SearchController.h
57 lines (53 loc) · 1.36 KB
/
SearchController.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
#ifndef SEARCHCONTROLLER_H
#define SEARCHCONTROLLER_H
#include "gui/interface/Panel.h"
#include "SearchModel.h"
#include "SearchView.h"
#include "gui/preview/PreviewController.h"
#include "Controller.h"
#include "client/SaveInfo.h"
class SearchView;
class SearchModel;
class SearchController
{
private:
SearchModel * searchModel;
SearchView * searchView;
PreviewController * activePreview;
ControllerCallback * callback;
double nextQueryTime;
std::string nextQuery;
bool nextQueryDone;
bool instantOpen;
bool doRefresh;
void removeSelectedC();
void unpublishSelectedC(bool publish);
public:
class OpenCallback;
bool HasExited;
SearchController(ControllerCallback * callback = NULL);
~SearchController();
SearchView * GetView() { return searchView; }
void Exit();
void DoSearch(std::string query, bool now = false);
void DoSearch2(std::string query);
void Refresh();
void NextPage();
void PrevPage();
void SetPage(int page);
void ChangeSort();
void ShowOwn(bool show);
void ShowFavourite(bool show);
void Selected(int saveID, bool selected);
void InstantOpen(bool instant);
void OpenSave(int saveID);
void OpenSave(int saveID, int saveDate);
void Update();
void ClearSelection();
void RemoveSelected();
void UnpublishSelected(bool publish);
void FavouriteSelected();
void ReleaseLoadedSave();
SaveInfo * GetLoadedSave();
};
#endif // SEARCHCONTROLLER_H