summaryrefslogtreecommitdiff
path: root/src/displayapp/Screens/Screen.h
diff options
context:
space:
mode:
authorAvamander <avamander@gmail.com>2020-10-02 21:46:41 +0300
committerAvamander <avamander@gmail.com>2020-10-02 21:46:41 +0300
commite3fb2f0b8974f3e9a124d27f4b568e754ccfb782 (patch)
treebc43f58bca6920bfb5a78f3cf26d0ec5e8c0d5a0 /src/displayapp/Screens/Screen.h
parent30c261028e27dab0e30aec19b9c21c37cc74e92b (diff)
Renamed DisplayApp/ to displayapp/
Diffstat (limited to 'src/displayapp/Screens/Screen.h')
-rw-r--r--src/displayapp/Screens/Screen.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/displayapp/Screens/Screen.h b/src/displayapp/Screens/Screen.h
new file mode 100644
index 00000000..dbf81a44
--- /dev/null
+++ b/src/displayapp/Screens/Screen.h
@@ -0,0 +1,30 @@
+#pragma once
+
+#include <cstdint>
+#include "../TouchEvents.h"
+
+namespace Pinetime {
+ namespace Applications {
+ class DisplayApp;
+ namespace Screens {
+ class Screen {
+ public:
+ Screen(DisplayApp* app) : app{app} {}
+ virtual ~Screen() = default;
+
+ // Return false if the app can be closed, true if it must continue to run
+ virtual bool Refresh() = 0;
+
+ // Return false if the button hasn't been handled by the app, true if it has been handled
+ virtual bool OnButtonPushed() { return false; }
+
+ // Return false if the event hasn't been handled by the app, true if it has been handled
+ virtual bool OnTouchEvent(TouchEvents event) { return false; }
+ virtual bool OnTouchEvent(uint16_t x, uint16_t y) { return false; }
+
+ protected:
+ DisplayApp* app;
+ };
+ }
+ }
+}