UCL_DECLARE_REF_ALIASES(AlertDialog);
+ /**
+ * @brief Alert dialog
+ */
class AlertDialog final : public Dialog {
public:
+
+ /**
+ * @brief Alert dialog
+ */
enum class Type {
- OK,
- OK_CANCEL
+ OK, /**< With single button OK*/
+ OK_CANCEL /**< With OK and Cancel buttons*/
};
+ /**
+ * @brief Enumeration of event types
+ */
enum class Event {
- CANCEL,
- OK,
- BACK
+ CANCEL, /**< Cancel event*/
+ OK, /**< OK event*/
+ BACK /**< Back event*/
};
using EventHandler = ucl::WeakDelegate<
bool(AlertDialog &dialog, Event event)>;
+ /**
+ * @brief Provides set of instruments for creation of AlertDialog
+ * object with set of options
+ */
class Builder final {
public:
+ /**
+ * @brief Default constructor
+ */
Builder();
+
+ /**
+ * @brief Sets dialog type
+ * @param[in] type Type
+ * @return Reference to Builder object
+ */
Builder &setType(Type type);
+
+ /**
+ * @brief Sets dialog title
+ * @param[in] title Title
+ * @return Reference to Builder object
+ */
Builder &setTitle(ucl::TString title);
+
+ /**
+ * @brief Sets dialog text to display
+ * @param[in] text Text
+ * @return Reference to Builder object
+ */
Builder &setText(ucl::TString text);
+
+ /**
+ * @brief Sets event handler
+ * @param[in] handler Event handler
+ * @return Reference to Builder object
+ */
Builder &setHandler(const EventHandler &handler);
+
+ /**
+ * @brief Creates new AlertDialog instance
+ * @param[in] parent Parent widget
+ * @return Weak reference to AlertDialog object
+ */
AlertDialogWRef build(ucl::ElmWidget &parent) const;
private:
Type m_type;