/**
* @brief enumeration for signals that passes parameter
+ *
* @details Only const model::Location & parameter type is allowed
*/
enum class ParameterSignalType {
/**
* @brief Sets user locations list.
+ *
* @remarks It emits CUSTOM_LIST_CHANGED signal
*/
void SetUserLocations(std::vector<const model::Location *> locations);
/**
* @brief Retrieve time zone for specified offset
+ *
* @param[in] offset offset in minutes between GMT 0 and returned time zone
*
* @return time zone that match specified offset
* @brief Gets location using its no in locations_ list
* @remarks This function is for temporary usage and will be removed before final version
*
- * param[no] location number
+ * @param[no] location number
*
* @return location
*/
/**
* @brief Sets next on the left to current time zone as current
- * param[in] direction direction to change current time zone to
+ *
+ * @param[in] direction direction to change current time zone to
*/
void MoveCurrentTimezone(Direction direction);
/**
* @brief Registers signal handler
- * @brief func must have one parameter. For now only const model::Location & type is supported
+ * @details func must have one parameter. For now only const model::Location & type is supported
*
* @param signal signal type
* @param func function to be called when registered signal is emitted.
/**
* @brief Currently set time zone.
- * It means the time zone to be displayed on world map and its details will be displayed below the map
+ * @details It means the time zone to be displayed on world map and its details will be displayed below the map
*/
const Timezone *current_tz_;
/**
* @brief Saves items list state using app_preferences API
+ *
* @details It saves every particular item(location)
*/
void SaveItemsList();
/**
* @brief Gets key identify given type(location struct field) for no'th item
* @details The key is used while storing data using preferences API
+ *
* @param type type of location struct field( see ItemKeyType enum)
* @param no order number of item
+ *
* @return created key
*/
const char *GetItemKey(int type, int no);
/**
* @brief Saves single location using app_preferences API
+ *
* @param[in] item location to save
* @param[in] i order number of the item
*/
/**
* @brief Loads single location using app_preferences API
+ *
* @param[in] i order number of the item
*
* @return user location
/**
* @brief Emits signal s
+ *
* @param s signal
* @param location location to pass to function registered for given signal
*/
/**
* @brief Emits signal s
+ *
* @param s signal
* @param location location to pass to function registered for given signal
*/
namespace model {
+ /**
+ * @brief class for exact Event firing.
+ */
class WorldClockDeleteRequestEvent: public utils::Event {
};
+ /**
+ * @brief class for exact Event firing.
+ */
class WorldClockReorderRequestEvent: public utils::Event {
};
}
/**
* @brief Invoked when "Cancel" button is clicked.
+ *
* @details Pops page.
*/
void OnCancelClicked();
/**
* @brief Invoked when "Delete" button is clicked.
+ *
* @details Deletes selected items. Pops page.
*/
void OnDeleteClicked();
namespace presenter {
+/**
+ * @brief Class for world clock presenter
+ *
+ * @details it manages map, timezone details, locations lists and "more" options popup.
+ */
class WorldClockPresenter {
public:
- /**
- * @brief Limits
- */
- enum Limits {
- USER_LOCATIONS_LIMIT = 20
- };
+ /**
+ * @brief Limits
+ */
+ enum Limits {
+ USER_LOCATIONS_LIMIT = 20
+ };
+ /**
+ * @brief Object Constructor
+ *
+ * @param[in] view World Clock tab view object
+ *
+ * @param[in] model World Clock tab model
+ */
WorldClockPresenter(view::WorldClockView *view, model::WorldClock *model);
+
+ /**
+ * @brief Destructs class object
+ */
~WorldClockPresenter();
private:
std::vector<utils::Listener> listeners_;
+ /**
+ * @brief Updates background of locations list. If list is empty proper message is displayed
+ */
void UpdateEmptyListBackground();
+ /**
+ * @brief Invoked when left arrow on map is clicked.
+ *
+ * @details It updates Map view including time zone details.
+ */
void OnLeftArrowButtonClicked();
+
+ /**
+ * @brief Invoked when right arrow on map is clicked.
+ *
+ * @details It updates Map view including time zone details.
+ */
void OnRightArrowButtonClicked();
+
+
+ /**
+ * @brief Invoked when user clicked on any location item on locaton list.
+ *
+ * @details It updates Map view including time zone details.
+ */
void OnCustomListItemClicked();
/**
/**
* @brief Invoked when Delete option is chosen on "more" popup.
+ *
* @details Created Delete View
*/
void OnMoreDeleteButtonClicked();
/**
* @brief Invoked when Reorder option is chosen on "more" popup.
+ *
* @details Created Reorder View
*/
void OnMoreReorderButtonClicked();
+ /**
+ * @brief Updates map view including timezone details.
+ */
void OnMapViewUpdateRequest();
+
+ /**
+ * @brief Invoked after location picker app(for no it is libug-worldclock-efl) sends launch replay.
+ *
+ * @details It adds location item to the model and view and updates map view.
+ */
void OnItemAdded();
/**
* @brief Deletes location from user locations list.
+ *
* @param location location to delete
*/
void OnItemDeleted(const model::Location &location);
/**
* @brief Invoked when "back arrow" button is clicked.
+ *
* @details Pops Reorder View page
*/
void OnBackClicked();
#include "Utils/Time.h"
namespace view {
-
+ /**
+ * @brief Class representing World Clock delete subview and is responsible for UI layer of the view.
+ *
+ * @detail It allow to delete any of location list items.
+ * It communicates with external classes by sending signals and do
+ * not touch any external resources directly except utils.
+ */
class WorldClockDeleteItemsView: public PageView {
public:
/**
* @brief Gets evas object of the page content -> genlist
+ *
* @return the object
*/
Evas_Object *GetEvasObject() override;
/**
* @brief Registers signals
+ *
* @param s signal enumerator
* @param func function invoked when the signal will be emitted
*/
/**
* @brief Appends items(Locations) from given list to delete View genlist
+ *
* @details The list is identical with user_locations_ list
+ *
* @param locations list of locations
*/
void AppendItems(std::vector<const model::Location *> locations);
/**
* @brief Sets items checkbox state
+ *
* @param state state to set
*/
void SetAllItems(bool state);
/**
* @brief Sets state of "Select All" checkbox
+ *
* @details It is useful when all items are selected manually
+ *
* @param state state to set
*/
void SetSelectAllCheckbox(bool state);
/**
* @brief Gets list of items selected to be deleted from user_locations_ list
- * @return
+ *
+ * @return List of locations selected to delete
*/
std::vector<const model::Location *> GetSelectedItems();
/**
* @brief Gets state of "Select All" item checkbox
+ *
* @return state of "Select All" item checkbox
*/
bool GetSelectAllState();
/**
* @brief Callback invoked when any item of list is clicked
+ *
* @param data user data
* @param obj obj
* @param event_info event_info
/**
* @brief Gets content for genlist item part
+ *
* @param data user data
* @param obj item object
* @param part part related to content to get
+ *
* @return Object of content that will be swallowed to the part
*/
static Evas_Object *ContentGet(void *data, Evas_Object *obj, const char *part);
/**
* @brief Gets text for genlist item part
+ *
* @param data user data
* @param obj item object
* @param part part related to text to get
+ *
* @return text to set to the textblock part
*/
static char *TextGet(void *data, Evas_Object *obj, const char *part);
/**
* @brief Deletes all resources of the item that cannot be deleted automatically
+ *
* @param data user data
* @param obj item object
*/
/**
* @brief Creates evas object for time
+ *
* @param parent parent
+ *
* @return the object
*/
static Evas_Object *CreateTimeObject(Evas_Object *parent, utils::Time t);
/**
* @brief Creates evas object for meridiem
+ *
* @param parent parent
+ *
* @return the object
*/
static Evas_Object *CreateXMeridiemObject(Evas_Object *parent, utils::Time t);
/**
* @brief Creates evas object for padding
+ *
* @param parent parent
+ *
* @return the object
*/
static Evas_Object *CreatePaddingObject(Evas_Object *parent, int width);
/**
* @brief emits signal
+ *
* @details it cause invocation of registered function
+ *
* @param s signal enumerator
*/
void EmitSignal(SignalType s);
/**
* @brief Emits BUTTON_CANCEL_CLICKED signal.
+ *
* @details Invoked when "Cancel" button is clicked
*/
static void OnCancelButtonClicked(void *data, Evas_Object *obj, void *event_info);
/**
* @brief Emits BUTTON_DELETE_CLICKED signal.
+ *
* @details Invoked when "Delete" button is clicked
*/
static void OnDeleteButtonClicked(void *data, Evas_Object *obj, void *event_info);
/**
* @brief Emits CHECKBOX_SELECT_ALL_CLICKED signal and toggle "Select all" checkbox state.
+ *
* @details Invoked when "Select all" item or checkbox is clicked
*/
static void OnSelectAllClicked(void *data, Evas_Object *obj, void *event_info);
/**
* @brief Timer callback for time updates.
+ *
* @param data user data
+ *
* @return EINA_BOOL to allow next invocation of callback, EINA_FALSE otherwise
*/
static Eina_Bool TimeUpdateCb(void *data);
namespace view {
+ /**
+ * @brief Class representing World Clock reorder subview and is responsible for UI layer of the view.
+ *
+ * @detail It allows reorder of location list items.
+ * It communicates with external classes by sending signals and do
+ * not touch any external resources directly except utils.
+ */
class WorldClockReorderView: public PageView {
public:
/**
* @brief Gets evas object of the page content -> genlist
+ *
* @return the object
*/
Evas_Object *GetEvasObject() override;
/**
* @brief Appends items(Locations) from given list to delete View genlist
+ *
* @details The list is identical with user_locations_ list
+ *
* @param locations list of locations
*/
void AppendItems(std::vector<const model::Location *> locations);
/**
* @brief Gets content for genlist item part
+ *
* @param data user data
* @param obj item object
* @param part part related to content to get
+ *
* @return Object of content that will be swallowed to the part
*/
static Evas_Object *ContentGet(void *data, Evas_Object *obj, const char *part);
/**
* @brief Gets text for genlist item part
+ *
* @param data user data
* @param obj item object
* @param part part related to text to get
+ *
* @return text to set to the textblock part
*/
static char *TextGet(void *data, Evas_Object *obj, const char *part);
/**
* @brief Deletes all resources of the item that cannot be deleted automatically
+ *
* @param data user data
* @param obj item object
*/
/**
* @brief Creates evas object for time
+ *
* @param parent parent
+ *
* @return the object
*/
static Evas_Object *CreateTimeObject(Evas_Object *parent, utils::Time t);
/**
* @brief Creates evas object for meridiem
+ *
* @param parent parent
+ *
* @return the object
*/
static Evas_Object *CreateXMeridiemObject(Evas_Object *parent, utils::Time t);
/**
* @brief Creates evas object for padding
+ *
* @param parent parent
+ *
* @return the object
*/
static Evas_Object *CreatePaddingObject(Evas_Object *parent, int width);
/**
* @brief emits signal
+ *
* @details it cause invocation of registered function
+ *
* @param s signal enumerator
*/
void EmitSignal(Signals s);
/**
* @brief Emits LIST_REORDERED signal
+ *
* @remarks Invoked everytime list is reordered
*/
static void OnListReordered(void *data, Evas_Object *obj, void *event_info);
/**
* @brief Emits BUTTON_BACK_CLICKED signal
+ *
* @remarks Invoked by clicking BACK naviframe button or back hardware key
*/
static void OnBackButtonClicked(void *data, Evas_Object *obj, void *event_info);
/**
* @brief Timer callback for time updates.
+ *
* @param data user data
+ *
* @return EINA_BOOL to allow next invocation of callback, EINA_FALSE otherwise
*/
static Eina_Bool TimeUpdateCb(void *data);
namespace view {
+ /**
+ * @brief Enumeration for callbacks signals
+ */
enum class WorldClockSignals {
BUTTON_LEFT_ARROW_CLICKED,
BUTTON_RIGHT_ARROW_CLICKED,
MAX
};
-
+ /**
+ * @brief Class representing World Clock view and is responsible for UI layer of the view.
+ *
+ * @detail It communicates with external classes by sending signals and do
+ * not touch any external resources directly except utils.
+ */
class WorldClockView: public ui::IView {
public:
REORDER_OPTION_ENABLED = 0x2
};
+ /**
+ * @brief Constructor
+ *
+ * @param main parent of the world clock view object
+ */
WorldClockView(ui::IView &main);
+
~WorldClockView();
+ /**
+ * @brief Returns evas object of the view
+ */
Evas_Object *GetEvasObject(){return world_clock_main_;};
+ /**
+ * @brief Registers signals
+ *
+ * @param[in] func function invoked when the signal will be emitted
+ * @param[in] s signal enumerator
+ */
void RegisterSignal(std::function<void(void)>func, view::WorldClockSignals signal);
+ /**
+ * @brief Updates map area and timezone details
+ *
+ * @param[in] timezone timezone to be set on map and in timezone details area.
+ */
void UpdateMapAndTimezoneDetails(const model::Timezone *timezone);
+ /**
+ * @brief Adds location item to list in view
+ *
+ * @param[in] location location to add
+ */
void AppendItemToCustomList(const model::Location *location);
+
+ /**
+ * @brief Removes location item from location list
+ *
+ * @param[in] location location to remove
+ */
void RemoveItem(const model::Location &location);
/**
*/
void ClearAllItems();
+ /**
+ * @brief Gets last clicked item
+ *
+ * @return clicked location
+ */
+
const model::Location *GetLastClickedItem();
+
+ /**
+ * @brief Gets location to add.
+ *
+ * @detail The location comes from location picker app.
+ *
+ * @return location to add
+ */
const model::Location *GetLocationToAdd();
+ /**
+ * @brief Shows "empty list" label
+ */
void ShowEmptyListLabel();
+
+ /**
+ * @brief Hides "empty list" label
+ */
void HideEmptyListLabel();
+
+ /**
+ * @brief Displays popup informing that location chosen in location
+ * picker app already exists in the list.
+ */
void PostItemExistMessage();
/**
* @brief Shows more popup.
+ *
* @param options options mask (see MoreMenuOptions enum)
*/
void ShowMorePopup(MoreMenuOptions options);
/**
* @brief Timer callback for time updates.
+ *
* @param data user data
+ *
* @return EINA_BOOL to allow next invocation of callback, EINA_FALSE otherwise
*/
static Eina_Bool TimeUpdateCb(void *data);