Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend/StarConfirmationDialog.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/frontend/StarConfirmationDialog.hpp')
-rw-r--r--source/frontend/StarConfirmationDialog.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/source/frontend/StarConfirmationDialog.hpp b/source/frontend/StarConfirmationDialog.hpp
new file mode 100644
index 0000000..793f6a3
--- /dev/null
+++ b/source/frontend/StarConfirmationDialog.hpp
@@ -0,0 +1,38 @@
+#ifndef STAR_CONFIRMATION_DIALOG_HPP
+#define STAR_CONFIRMATION_DIALOG_HPP
+
+#include "StarPane.hpp"
+#include "StarRpcPromise.hpp"
+
+namespace Star {
+
+STAR_CLASS(ConfirmationDialog);
+
+class ConfirmationDialog : public Pane {
+public:
+ ConfirmationDialog();
+
+ virtual ~ConfirmationDialog() {}
+
+ void displayConfirmation(Json const& dialogConfig, RpcPromiseKeeper<Json> resultPromise);
+ void displayConfirmation(Json const& dialogConfig, WidgetCallbackFunc okCallback, WidgetCallbackFunc cancelCallback);
+
+ Maybe<EntityId> sourceEntityId();
+
+ void dismissed() override;
+
+private:
+ void ok();
+
+ WidgetCallbackFunc m_okCallback;
+ WidgetCallbackFunc m_cancelCallback;
+ bool m_confirmed;
+
+ Maybe<EntityId> m_sourceEntityId;
+
+ Maybe<RpcPromiseKeeper<Json>> m_resultPromise;
+};
+
+}
+
+#endif