UCL_DECLARE_REF_ALIASES(MoreOptionsPresenter);
+ /**
+ * @brief Represents More Options menu
+ */
class MoreOptionsPresenter final : public ucl::GuiPresenter {
public:
UCL_DECLARE_REF_ALIASES(IListener);
+ /**
+ * @brief Option entry
+ */
struct Option final {
- int id;
- ucl::TString text;
- ucl::TString subText;
- ucl::LayoutTheme iconTheme;
+ int id; /**< ID*/
+ ucl::TString text; /**< Text*/
+ ucl::TString subText; /**< Subtext */
+ ucl::LayoutTheme iconTheme; /**< Icon theme*/
};
+ /**
+ * @brief Provides set of instruments for creation of
+ * MoreOptionsPresenter object with set of options
+ */
class Builder final {
public:
+
+ /**
+ * @brief Default constructor
+ */
Builder();
+
+ /**
+ * @brief Destructor
+ */
~Builder();
+
+ /**
+ * @brief Checks whether options list is empty
+ * @return true if empty, false if not empty
+ */
bool isEmpty() const;
+
+ /**
+ * @brief Clears option list
+ * @return Reference to Builder object
+ */
Builder &clear();
+
+ /**
+ * @brief Adds option to the list
+ * @param[in] option Option
+ * @return Reference to Builder object
+ */
Builder &addOption(Option option);
+
+ /**
+ * @brief Sets parent widget
+ * @param[in] parentWidget Widget
+ * @return Reference to Builder object
+ */
Builder &setParentWidget(const ucl::ElmWidgetSRef &parentWidget);
+
+ /**
+ * @brief Creates MoreOptionsPresenter object
+ * @param[in] parent Parent presenter
+ * @return Shared reference to MoreOptionsPresenter object
+ */
MoreOptionsPresenterSRef build(GuiPresenter &parent) const;
private:
std::list<Option> m_options;
ucl::ElmWidgetSRef m_parentWidget;
};
+ /**
+ * @brief Represents MoreOptions event listener
+ */
class IListener : protected ucl::NonCopyable {
public:
+ /**
+ * @brief Called when MoreOptions cue clicked.
+ * @param[in] sender Sender
+ * @param[in] optionID Option ID
+ */
virtual void onMoreOptionClicked(MoreOptionsPresenter &sender,
int optionId) = 0;
+
+ /**
+ * @brief Called when option was selected.
+ * @param[in] sender Sender
+ * @param[in] optionID Option ID
+ */
virtual void onMoreOptionSelected(MoreOptionsPresenter &sender,
int optionId) {};
+
+ /**
+ * @brief Called when MoreOptions opened.
+ * @param[in] sender Sender
+ */
virtual void onMoreOptionsOpened(MoreOptionsPresenter &sender) {};
+
+ /**
+ * @brief Called when MoreOptions closed.
+ * @param[in] sender Sender
+ */
virtual void onMoreOptionsClosed(MoreOptionsPresenter &sender) {};
};
public:
+
+ /**
+ * @brief Sets listener
+ * @param[in] listener Weak reference to listener
+ */
void setListener(const IListenerWRef &listener);
+ /**
+ * @brief Gets widget
+ * @return Widget. @see ucl::Widget
+ */
ucl::Widget &getWidget();
+ /**
+ * @brief Sets opened status
+ * @param[in] isOpened Open status
+ */
void setOpened(bool isOpened);
+
+ /**
+ * @brief Checks if MoreOptions is opened
+ * @return true if opened, false if not opened
+ */
bool isOpened() const;
+ /**
+ * @brief Sets opened status with delay
+ * @param[in] isOpened Open status
+ * @param[in] timeout Delay timeout. Has effect only if "Open status"
+ * parameter is set to true
+ */
void setOpenedDelayed(bool isOpened, double timeout);
private:
UCL_DECLARE_REF_ALIASES(ProcessingPresenter);
+ /**
+ * @brief Provides set of instruments to display processing status of some
+ * operation and its result
+ */
class ProcessingPresenter final : public ucl::GuiPresenter {
public:
+ /**
+ * @brief Enumeration of icon types
+ */
enum class IconType {
- NONE,
- CHECK
+ NONE, /**< No icon*/
+ CHECK /**< Check icon*/
};
+ /**
+ * @brief Provides set of instruments for creation of
+ * ProcessingPresenter object with set of options
+ */
class Builder final {
public:
+
+ /**
+ * @brief Default constructor
+ */
Builder();
+
+ /**
+ * @brief Sets processing text
+ * @param[in] text Text
+ * @return Reference to Builder object
+ */
Builder &setProcessingText(ucl::TString text);
+
+ /**
+ * @brief Sets show progress flag
+ * @param[in] value Show progress flag
+ * @return Reference to Builder object
+ */
Builder &setForceProgress(bool value);
+
+ /**
+ * @brief Creates ProcessingPresenter object
+ * @return Weak reference to ProcessingPresenter object
+ */
ProcessingPresenterSRef build(ucl::ElmWidget &parent) const;
private:
ucl::TString m_processingText;
bool m_forceProgress;
};
+ /**
+ * @brief Dismiss handler type
+ */
using DismissHandler = ucl::WeakDelegate<void()>;
public:
+ /**
+ * @brief Finalizes processing progress with set text or icon
+ * @param[in] completeText Text
+ * @param[in] iconType Icon type
+ */
void complete(const ucl::TString &completeText,
IconType iconType = IconType::NONE);
+ /**
+ * @brief Sets dismiss handler
+ * @param[in] handler Dismiss handlerssss
+ */
void setDismissHandler(const DismissHandler &handler);
private:
UCL_DECLARE_REF_ALIASES(SelectModePresenter);
+ /**
+ * @brief Provides set of instruments for selecting multiple objects
+ */
class SelectModePresenter final : public ucl::GuiPresenter {
public:
UCL_DECLARE_REF_ALIASES(IListener);
+ /**
+ * @brief Enumeration of flags
+ */
enum {
FLAG_NO_BOTTOM_BUTTON = 1,
FLAG_NO_MORE_OPTIONS = 2,
FLAG_NO_DISMISS_ON_ROTARY = 8
};
+ /**
+ * @brief Provides set of instruments for creation of
+ * SelectModePresenter object with set of options
+ */
class Builder final {
public:
+
+ /**
+ * @brief Default constructor
+ */
Builder();
+
+ /**
+ * @brief Sets flags
+ * @param[in] flags Flags
+ * @return Reference to Builder object
+ */
Builder &setFlags(int flags);
+
+ /**
+ * @brief Sets page content
+ * @param[in] content Shared reference to content
+ * @return Reference to Builder object
+ */
Builder &setPageContent(const PageContentSRef &content);
+
+ /**
+ * @brief Creates SelectModePresenter object
+ * @param[in] parent Parent presenter
+ * @return Shared reference to SelectModePresenter object
+ */
SelectModePresenterSRef build(GuiPresenter &parent) const;
private:
PageContentSRef m_content;
int m_flags;
};
+ /**
+ * @brief Enumeration of events
+ */
enum class Event {
- SELECT_ALL,
- DESELECT_ALL,
- BOTTOM_BUTTON_CLICK
+ SELECT_ALL, /**< Select all*/
+ DESELECT_ALL, /**< Deselect all*/
+ BOTTOM_BUTTON_CLICK /**< Bottom button clicked*/
};
+ /**
+ * @brief Event listener
+ */
class IListener : protected ucl::NonCopyable {
public:
+
+ /**
+ * @brief Select mode callback
+ */
virtual void onSelectModeEvent(Event event) = 0;
};
public:
+
+ /**
+ * @brief Sets listener
+ * @param[in] listener Listener
+ */
void setListener(const IListenerWRef &listener);
+ /**
+ * @brief Sets visibility
+ * @param[in] value Visibility value
+ */
void setVisible(bool value);
+
+ /**
+ * @brief Checks visibility
+ * @return true if visible, false if invisible
+ */
bool isVisible() const;
+ /**
+ * @brief Gets "Select" button
+ * @return ElmWidget. @see ucl::ElmWidget
+ */
ucl::ElmWidget &getSelectButton();
+
+ /**
+ * @brief Gets bottom button
+ * @return ElmWidget. @see ucl::ElmWidget
+ */
ucl::ElmWidget &getBottomButton();
+ /**
+ * @brief Sets bottom button text
+ * @param[in] value Text
+ */
void setBottomButtonText(const ucl::TString &value);
+ /**
+ * @brief Updates presenter
+ * @param[in] selectCount Number of selected elements
+ * @param[in] totalCount Overall number of elements
+ */
void update(int selectCount, int totalCount = -1);
private:
constexpr ucl::SmartEvent INSTANCE_PAUSED {"gallery,instance,paused"};
constexpr ucl::SmartEvent INSTANCE_RESUMED {"gallery,instance,resumed"};
+ /**
+ * @brief Sets instance pause
+ * @param[in] win Window
+ * @param[in] value Instance Pause state status
+ */
void setInstancePaused(ucl::Window &win, bool value);
+
+ /**
+ * @brief Checks if instance is paused
+ * @param[in] win Window
+ * @return true if paused, false if not
+ */
bool isInstancePaused(const ucl::Window &win);
}