UCL_DECLARE_REF_ALIASES(ImageGrid);
+ /**
+ * @brief Represents placement grid for images
+ */
class ImageGrid : public ucl::ElmWidget {
public:
UCL_DECLARE_REF_ALIASES(IListener);
+ /**
+ * @brief Grid type
+ */
enum class Type {
- HCOMB_3X3,
- LINEAR
+ HCOMB_3X3, /**< Honeycomb 3 by 3*/
+ LINEAR /**< Linear list, 1 at a time*/
};
-
+ /**
+ * @brief Provides set of instruments for creation of ImageGrid object
+ * with set of options
+ */
class Builder final {
public:
+ /**
+ * @brief Default constructor
+ */
Builder();
+
+ /**
+ * @brief Sets type
+ * @param[in] value Type
+ * @return Reference to Builder object
+ */
Builder &setType(Type value);
+
+ /**
+ * @brief Sets listener
+ * @param[in] value Weak reference to IListener object
+ * @return Reference to Builder object
+ */
Builder &setListener(const IListenerWRef &value);
+
+ /**
+ * @brief Sets selection mode on startup
+ * @param[in] value Value
+ * @return Reference to Builder object
+ */
Builder &setSelectModeStartup(bool value);
+
+ /**
+ * @brief Creates ImageGrid object
+ * @param[in] parent Parent widget
+ * @return Weak reference to ImageGrid object
+ */
ImageGridSRef build(ElmWidget &parent) const;
private:
Type m_type;
bool m_selectModeStartup;
};
+ /**
+ * @brief Enumeration of item events
+ */
enum class ItemEvent {
- CLICK,
- DOUBLE_TAP,
- TAP_AND_HOLD
+ CLICK, /**< Click*/
+ DOUBLE_TAP, /**< Double tap*/
+ TAP_AND_HOLD /**< Tap and hold*/
};
+ /**
+ * @brief Represents listener
+ */
class IListener : protected ucl::NonCopyable {
public:
+
+ /**
+ * @brief Occurs when item is realized
+ * @param[in] itemIndex Item index
+ */
virtual void onItemRealized(int itemIndex) = 0;
+
+ /**
+ * @brief Occurs when item is unrealized
+ * @param[in] itemIndex Item index
+ */
virtual void onItemUnrealized(int itemIndex) = 0;
+
+ /**
+ * @brief Occurs when item event emerged
+ * @param[in] itemIndex Item index
+ * @param[in] event Event descriptor
+ * @param[in] x X coordinate
+ * @param[in] y Y coordinate
+ */
virtual void onItemEvent(int itemIndex,
ItemEvent event, int x, int y) = 0;
+
+ /**
+ * @brief Occurs when transition finishes
+ */
virtual void onTransitionFinished() {}
};
+ /**
+ * @Enumeration of item flags
+ */
enum {
- UF_LOSE_IMAGE = 1,
- UF_LOSE_BG = 2,
- UF_BLOCK_CLICKS = 4,
- UF_SELECTED = 8
+ UF_LOSE_IMAGE = 1, /**< Make image transparent*/
+ UF_LOSE_BG = 2, /**< Make background transparent*/
+ UF_BLOCK_CLICKS = 4, /**< Is clickable*/
+ UF_SELECTED = 8 /**< Is selected*/
};
+ /**
+ * @brief Item parameters entry
+ */
struct ItemParams final {
- std::string imagePath;
- std::string bgImagePath;
- int imageWidth;
- int imageHeight;
- int flags;
+ std::string imagePath; /**< Image path*/
+ std::string bgImagePath; /**< Background image path*/
+ int imageWidth; /**< Image width*/
+ int imageHeight; /**< Image height*/
+ int flags; /**< Flags*/
};
+ /**
+ * @brief Item info entry
+ */
struct ItemInfo final {
- int imageLoadSize;
- bool isImageLoadSizeFull;
- bool isImageLoaded;
+ int imageLoadSize; /**< Image load size*/
+ bool isImageLoadSizeFull; /**< Is load full size*/
+ bool isImageLoaded; /**< Is image loaded*/
};
+ /**
+ * @brief Provides unrealization
+ */
class Unrealizer final : ucl::NonCopyable {
public:
+ /**
+ * @brief Constructor
+ * @param[in] imageGrid Image grid
+ */
Unrealizer(ImageGrid &imageGrid);
+
+ /**
+ * @brief Destructor
+ */
~Unrealizer();
private:
ImageGrid &m_imageGrid;
};
public:
+ /**
+ * @brief Sets listener
+ * @param[in] value Weak reference to IListener object
+ */
void setListener(const IListenerWRef &listener);
+ /**
+ * @brief Sets item count
+ * @param[in] count Item count
+ * @return RES_OK on success, otherwise an error code on failure
+ */
ucl::Result setItemCount(int count);
+ /**
+ * @brief Sets select mode enabled
+ * @param[in] enabled Value
+ * @return RES_OK on success, otherwise an error code on failure
+ */
ucl::Result setSelectModeEnabled(bool enabled);
+
+ /**
+ * @brief Checks if select mode is active
+ * @return true if in select mode, otherwise - false
+ */
bool isInSelectMode() const;
+
+ /**
+ * @brief Checks if in transition
+ * @return true if in transition, otherwise - false
+ */
bool isInTransition() const;
+ /**
+ * @brief Updates image grid
+ */
void update();
+ /**
+ * @brief Updates item
+ * @param[in] itemIndex Item index
+ * @param[in] params Item parameters
+ * @return RES_OK on success, otherwise an error code on failure
+ */
ucl::Result updateItem(int itemIndex, const ItemParams ¶ms);
+ /**
+ * @brief Checks if item is realized
+ * @param[in] itemInex Item index
+ * @return RES_OK on success, otherwise an error code on failure
+ */
ucl::Result isItemRealized(int itemIndex) const;
+ /**
+ * @brief Gets item info
+ * @param[in] itemIndex Item index
+ * @param[out] info Item info
+ * @return RES_OK on success, otherwise an error code on failure
+ */
ucl::Result getItemInfo(int itemIndex, ItemInfo &info) const;
+ /**
+ * @brief Gets scrolled to item index
+ * @return Index
+ */
int getScrolledToItemIndex() const;
+
+ /**
+ * @brief Scrolls to item
+ * @param[in] itemInex Item index
+ * @return RES_OK on success, otherwise an error code on failure
+ */
ucl::Result scrollToItem(int itemIndex);
+
+ /**
+ * @brief Brings in item
+ * @param[in] itemInex Item index
+ * @return RES_OK on success, otherwise an error code on failure
+ */
ucl::Result bringInItem(int itemIndex);
+ /**
+ * @brief Activates rotary
+ */
void activateRotary();
+
+ /**
+ * @brief Deactivates rotary
+ */
void deactivateRotary();
private:
UCL_DECLARE_REF_ALIASES(ImageViewer);
+ /**
+ * @brief Represents image viewer
+ */
class ImageViewer final : public ucl::ElmWidget {
public:
+
+ /**
+ * @brief Provides set of instruments for creation of
+ * ImageViewer object with set of options
+ */
class Builder final {
public:
+
+ /**
+ * @brief Constuctor
+ */
Builder();
+
+ /**
+ * @brief Sets high resolution image path
+ * @param[in] path Image path
+ * @return Reference to Builder object
+ */
Builder &setHighResImagePath(std::string path);
+
+ /**
+ * @brief Sets load size
+ * @param[in] value Size
+ * @return Reference to Builder object
+ */
Builder &setLoadSize(int value);
+
+ /**
+ * @brief Set force load
+ * @param[in] value Value
+ * @return Reference to Builder object
+ */
Builder &setForceLoad(bool value);
+
+ /**
+ * @brief Creates ImageViewer object
+ * @param[in] parent Parent presenter
+ * @return Shared reference to ImageViewer object
+ */
ImageViewerSRef build(ucl::ElmWidget &parent) const;
private:
std::string m_highResPath;
};
public:
+
+ /**
+ * @brief Sets low resolution image path
+ * @param[in] path image path
+ */
void setLowResImagePath(const std::string &path);
+
+ /**
+ * @brief Zooms in
+ * @param[in] originX X coordinate of point that doesn't move during
+ * zoom in process
+ * @param[in] originY Y coordinate of point that doesn't move during
+ * zoom in process
+ * @return
+ */
bool zoomIn(int originX, int originY);
+
+ /**
+ * @brief Zooms out
+ * @param[in] value Value
+ * @return true if zoomed out, false - if not
+ */
bool zoomOut();
+ /**
+ * @brief Checks if zooming out
+ * @return true if zooming out, false - if not
+ */
bool isZooming() const;
+
+ /**
+ * @brief Checks if zooming in
+ * @return true if zooming in, false - if not
+ */
bool isZoomedIn() const;
+
+ /**
+ * @brief Checks if zoomed out
+ * @return true if zoomed out, false - if not
+ */
bool isZoomedOut() const;
private:
UCL_DECLARE_REF_ALIASES(PageContent);
+ /**
+ * @brief Represents page content
+ */
class PageContent final : public ucl::ElmWidget {
public:
+
+ /**
+ * @brief Provides set of instruments for creation of
+ * PageContent 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 Creates PageContent object
+ * @param[in] parent Parent presenter
+ * @return Shared reference to PageContent object
+ */
PageContentSRef build(ucl::ElmWidget &parent) const;
private:
int m_flags;
};
+ /**
+ * @brief Enumeration of flags
+ */
enum {
- FLAG_MORE_OPTIONS = 1,
- FLAG_SELECT_BUTTON = 2,
- FLAG_BOTTOM_BUTTON = 4,
+ FLAG_MORE_OPTIONS = 1, /**< Select button flag*/
+ FLAG_SELECT_BUTTON = 2, /**< Select button flag*/
+ FLAG_BOTTOM_BUTTON = 4, /**< Bottom button flag*/
- FLAGS_SELECT_MODE = (FLAG_SELECT_BUTTON | FLAG_BOTTOM_BUTTON),
- FLAGS_ALL = (FLAG_MORE_OPTIONS | FLAGS_SELECT_MODE)
+ FLAGS_SELECT_MODE =
+ (FLAG_SELECT_BUTTON | FLAG_BOTTOM_BUTTON), /**< Select mode flag*/
+ FLAGS_ALL = FLAGS_SELECT_MODE /**< All flags*/
};
+ /**
+ * @brief Enumeration of parts
+ */
enum class Part {
- DEFAULT,
- OVERLAY,
- MORE_OPTIONS,
- SELECT_BUTTON,
- BOTTOM_BUTTON
+ DEFAULT, /**< Default*/
+ OVERLAY, /**< Overlay*/
+ MORE_OPTIONS, /**< More option button*/
+ SELECT_BUTTON, /**< Selector button*/
+ BOTTOM_BUTTON /**< Bottom button*/
};
public:
+
+ /**
+ * @brief Sets Evas object to part
+ * @param[in] widget Widget. @see ucl::Widget
+ * @param[in] part Part
+ * @return ListOptionDialog::Builder object
+ */
ucl::Result set(ucl::Widget &widget, Part part = Part::DEFAULT);
+
+ /**
+ * @brief Clears part
+ * @param[in] part Part
+ * @return Evas object pointer
+ */
Evas_Object *unset(Part part = Part::DEFAULT);
+ /**
+ * @brief Gets part
+ * @param[in] part Part
+ * @return Evas object pointer
+ */
Evas_Object *get(Part part = Part::DEFAULT) const;
+ /**
+ * @brief Sets select button visible
+ * @param[in] visible Value
+ * @return RES_OK on success, otherwise an error code on failure
+ */
ucl::Result setSelectButtonVisible(bool visible);
+
+ /**
+ * @brief Sets More options part visible
+ * @param[in] visible Value
+ * @return RES_OK on success, otherwise an error code on failure
+ */
ucl::Result setMoreOptionsVisible(bool visible);
private:
UCL_DECLARE_REF_ALIASES(TouchParser);
+ /**
+ * @brief Provides touch parsing options
+ */
class TouchParser final : public ucl::RefCountAware {
public:
+ /**
+ * @brief Tap handler type
+ */
using TapHandler = ucl::WeakDelegate<void(int x, int y)>;
private:
virtual ~TouchParser();
public:
+ /**
+ * @brief Sets tap handler
+ * @param[in] handler Tap handler
+ */
void setTapHandler(const TapHandler &handler);
+
+ /**
+ * @brief Sets double tap handler
+ * @param[in] handler Double tap handler
+ */
void setDoubleTapHandler(const TapHandler &handler);
+
+ /**
+ * @brief Sets tap and hold handler
+ * @param[in] handler Tap and hold handler
+ */
void setTapAndHoldHandler(const TapHandler &handler);
private:
namespace gallery { namespace util {
+ /**
+ * @brief Creates circle surface
+ * @param[in] navi Naviframe object. @see ucl::Naviframe
+ * @return RES_OK on success, otherwise an error code on failure
+ */
ucl::Result createCircleSurface(ucl::Naviframe &navi);
+
+ /**
+ * @brief Gets circle surface
+ * @param[in] widget ElmWidget object. @see ucl::ElmWidget
+ * @return Pointer to circle surface
+ */
Eext_Circle_Surface *getCircleSurface(const ucl::ElmWidget &widget);
void updateElmLanguage();
namespace gallery {
+ /**
+ * @brief Adds rotary event handler
+ * @param[in] func Callback function
+ * @param[in] data Pointer to data
+ */
void addRotaryEventHandler(Eext_Rotary_Handler_Cb func, void *data);
+
+ /**
+ * @brief Deletes rotary event handler
+ * @param[in] func Callback function
+ * @param[in] data Pointer to data
+ */
void delRotaryEventHandler(Eext_Rotary_Handler_Cb func, void *data);
+ /**
+ * @brief Gets image theme
+ * @param[in] fileName Input file
+ * @return Layout theme. @see ucl::LayoutTheme
+ */
ucl::LayoutTheme getImageTheme(const char *fileName);
}