summaryrefslogtreecommitdiff
path: root/src/search/SearchController.h
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-11-17 19:44:09 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-11-17 19:44:09 (GMT)
commit058a2edd75debbd0297f92572316daa704bd379f (patch)
treead303f091f9a08b209b91eb34a9fcad996a3de69 /src/search/SearchController.h
parente3594aba9e05c6865d396418c028049cda92c2f3 (diff)
parent7a21ae192fe19868539956f3fe28e62b2c7c4429 (diff)
downloadpowder-058a2edd75debbd0297f92572316daa704bd379f.zip
powder-058a2edd75debbd0297f92572316daa704bd379f.tar.gz
Merge branch 'master' of github.com:FacialTurd/PowderToypp
Diffstat (limited to 'src/search/SearchController.h')
-rw-r--r--src/search/SearchController.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/search/SearchController.h b/src/search/SearchController.h
new file mode 100644
index 0000000..66d464a
--- /dev/null
+++ b/src/search/SearchController.h
@@ -0,0 +1,50 @@
+#ifndef SEARCHCONTROLLER_H
+#define SEARCHCONTROLLER_H
+
+#include "interface/Panel.h"
+#include "SearchModel.h"
+#include "SearchView.h"
+#include "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;
+ void removeSelectedC();
+ void unpublishSelectedC();
+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 NextPage();
+ void PrevPage();
+ void ChangeSort();
+ void ShowOwn(bool show);
+ void ShowFavourite(bool show);
+ void Selected(int saveID, bool selected);
+ void OpenSave(int saveID);
+ void OpenSave(int saveID, int saveDate);
+ void Update();
+ void ClearSelection();
+ void RemoveSelected();
+ void UnpublishSelected();
+ void FavouriteSelected();
+ SaveInfo * GetLoadedSave();
+};
+
+#endif // SEARCHCONTROLLER_H