UCL_DECLARE_REF_ALIASES(Dialog);
+ /**
+ * @brief Base dialog class
+ */
class Dialog : public ucl::GuiPresenter,
public ucl::IDisposable {
public:
+ /**
+ * @brief Opens dialog
+ */
void open();
+
+ /**
+ * @brief Dismisses dialog
+ */
void dismiss();
// ucl::IDisposable //
+ /**
+ * @brief Disposes dialog
+ */
virtual void dispose() final override;
+
+ /**
+ * @brief Checks whether the object is already disposed
+ * @return true if disposed, false if not disposed
+ */
virtual bool isDisposed() const final override;
protected:
+
+ /**
+ * @brief Enumeration of popup types
+ */
enum class PopupType {
- NORMAL,
- CONTEXT
+ NORMAL, /**< Normal popup*/
+ CONTEXT /**< Context popup*/
};
protected:
+ /**
+ * @brief Constructor
+ * @param[in] rc Pointer to IRefCountObj (passed automatically)
+ */
Dialog(ucl::IRefCountObj &rc);
+
+ /**
+ * @brief Default destructor
+ */
virtual ~Dialog() = default;
+ /**
+ * @brief Prepares dialog data
+ * @param[in] parent Parent widget
+ * @param[in] popupType Popup type
+ * @param[in] onPrepare Prepare callback
+ * @return RES_OK on success, otherwise an error code on failure
+ */
template <class ON_PREPARE>
ucl::Result prepare(ucl::ElmWidget &parent, PopupType popupType,
ON_PREPARE &&onPrepare);
+ /**
+ * @brief Back key signal callback
+ */
virtual void onBackKey();
private:
UCL_DECLARE_REF_ALIASES(Page);
+ /**
+ * @brief Base class for Pages
+ */
class Page : public ucl::GuiPresenter,
public ucl::IDisposable {
public:
+ /**
+ * @brief Exit request handler type
+ */
using ExitRequestHandler = ucl::WeakDelegate<void(Page &page)>;
public:
+ /**
+ * @brief Gets naviframe. @see ucl::Naviframe
+ * @return Naviframe object
+ */
ucl::Naviframe &getNaviframe();
+ /**
+ * @brief Checks if Page is at top of stack
+ * @return true if at top
+ */
bool isAtTop() const;
+
+ /**
+ * @brief Checks if Page is at bottom of stack
+ * @return true if at bottom
+ */
bool isAtBottom() const;
+ /**
+ * @brief Closes current page
+ */
void exit();
+ /**
+ * @brief Pops pages of the naviframe till this page
+ */
void popTo();
+
+ /**
+ * @brief Deletes pages of the naviframe till this page
+ */
void deleteTo();
+
+ /**
+ * @brief Promotes page to the top of the page stack
+ */
void promote();
+ /**
+ * @brief Inserts NaviItem after this page. @see Naviframe::insertAfter
+ * @param[in] args Insertion parameters
+ * @return New NaviItem
+ */
template <class ...ARGS>
ucl::NaviItem insertAfter(ARGS &&...args);
+ /**
+ * @brief Inserts NaviItem before this page.
+ * @see Naviframe::insertBefore
+ * @param[in] args Insertion parameters
+ * @return New NaviItem
+ */
template <class ...ARGS>
ucl::NaviItem insertBefore(ARGS &&...args);
// ucl::IDisposable //
+ /**
+ * @brief Disposes object
+ */
virtual void dispose() override;
+
+ /**
+ * @brief Checks if object disposed
+ */
virtual bool isDisposed() const final override;
+
protected:
+ /**
+ * @brief Constructor
+ * @param[in] rc Pointer to IRefCountObj (passed automatically)
+ * @param[in] navi Shared reference to Naviframe object
+ * @param[in] onExitRequest Exit request handler
+ */
Page(ucl::IRefCountObj &rc, const ucl::NaviframeSRef &navi,
const ExitRequestHandler &onExitRequest);
+
+ /**
+ * @brief Default destructor
+ */
virtual ~Page();
+ /**
+ * @brief Prepares content
+ * @param[in] onPrepare Prepare callback
+ * @param[in] contentFlags Content flags
+ */
template <class ON_PREPARE>
ucl::Result prepare(ON_PREPARE &&onPrepare);
+ /**
+ * @brief Gets NaviItem
+ * @return NaviItem object
+ */
ucl::NaviItem getItem();
+ /**
+ * @brief Requests application exit
+ */
void requestExit();
+ /**
+ * @brief Back key callback
+ */
virtual void onBackKey();
private: