summaryrefslogtreecommitdiff
path: root/src/preview/PreviewView.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/preview/PreviewView.h
parente3594aba9e05c6865d396418c028049cda92c2f3 (diff)
parent7a21ae192fe19868539956f3fe28e62b2c7c4429 (diff)
downloadpowder-058a2edd75debbd0297f92572316daa704bd379f.zip
powder-058a2edd75debbd0297f92572316daa704bd379f.tar.gz
Merge branch 'master' of github.com:FacialTurd/PowderToypp
Diffstat (limited to 'src/preview/PreviewView.h')
-rw-r--r--src/preview/PreviewView.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/preview/PreviewView.h b/src/preview/PreviewView.h
new file mode 100644
index 0000000..2dc667b
--- /dev/null
+++ b/src/preview/PreviewView.h
@@ -0,0 +1,78 @@
+/*
+ * PreviewView.h
+ *
+ * Created on: Jan 21, 2012
+ * Author: Simon
+ */
+
+#ifndef PREVIEWVIEW_H_
+#define PREVIEWVIEW_H_
+
+#include <vector>
+#include "Comment.h"
+#include "interface/Window.h"
+#include "preview/PreviewController.h"
+#include "preview/PreviewModel.h"
+#include "interface/Button.h"
+#include "search/Thumbnail.h"
+#include "interface/Label.h"
+#include "interface/Textbox.h"
+
+namespace ui
+{
+ class ScrollPanel;
+}
+
+class PreviewModel;
+class PreviewController;
+class PreviewView: public ui::Window {
+ class SubmitCommentAction;
+ class LoginAction;
+ class AutoCommentSizeAction;
+ PreviewController * c;
+ Thumbnail * savePreview;
+ ui::Button * openButton;
+ ui::Button * browserOpenButton;
+ ui::Button * favButton;
+ ui::Button * reportButton;
+ ui::Button * submitCommentButton;
+ ui::Textbox * addCommentBox;
+ ui::Label * saveNameLabel;
+ ui::Label * authorDateLabel;
+ ui::Label * pageInfo;
+ ui::Label * saveDescriptionLabel;
+ ui::Label * viewsLabel;
+ ui::Textbox * saveIDTextbox;
+ ui::ScrollPanel * commentsPanel;
+ std::vector<SaveComment> comments;
+ std::vector<ui::Component*> commentComponents;
+ std::vector<ui::Component*> commentTextComponents;
+ int votesUp;
+ int votesDown;
+ bool doOpen;
+
+ int commentBoxHeight;
+ float commentBoxPositionX;
+ float commentBoxPositionY;
+ float commentBoxSizeX;
+ float commentBoxSizeY;
+
+ void displayComments();
+ void commentBoxAutoHeight();
+ void submitComment();
+public:
+ void AttachController(PreviewController * controller);
+ PreviewView();
+ void NotifySaveChanged(PreviewModel * sender);
+ void NotifyCommentsChanged(PreviewModel * sender);
+ void NotifyCommentsPageChanged(PreviewModel * sender);
+ void NotifyCommentBoxEnabledChanged(PreviewModel * sender);
+ virtual void OnDraw();
+ virtual void DoDraw();
+ virtual void OnTick(float dt);
+ virtual void OnTryExit(ExitMethod method);
+ virtual void OnMouseWheel(int x, int y, int d);
+ virtual ~PreviewView();
+};
+
+#endif /* PREVIEWVIEW_H_ */