#ifndef __ALLOWED_CALLS_H__
#define __ALLOWED_CALLS_H__
-#include <Evas.h>
-
-#include <Elementary.h>
-#include "log.h"
-#include "common-efl.h"
-
+/**
+ * @brief Creates a popup with available modes of allowed calls.
+ */
void gl_allowed_calls_selected();
#endif //__ALLOWED_CALLS_H__
#include <stdbool.h>
#include <notification_setting.h>
#include <efl_extension.h>
-#include <string.h>
#include <Elementary.h>
#include <package_manager.h>
#include "pkgmgr-setting-info.h"
#include "notification-setting-info.h"
-
#define PKGNAME NULL
#define APP_STRING(str) dgettext(NULL, str)
#define MAX_TEXT_SIZE 1024
-typedef struct _data_list data_list_t;
-struct _data_list
-{
- data_list_t *next;
- int id;
- int index;
- char *appid;
- char *name;
- char *icon;
- bool is_app_data;
-};
-
-typedef struct item_data
-{
- int index;
- Elm_Object_Item *item;
- data_list_t *data;
-} item_data_s;
-
-
-/* User created ug data */
+/**
+ * @brief Main application's data structure.
+ */
typedef struct ug_data_t
{
- Evas_Object *win;
- Evas_Object *layout;
- Evas_Object *naviframe;
- Evas_Object *list_main;
- Evas_Object *list_sub;
- Evas_Object *cancel_button;
- Evas_Object *done_button;
- Elm_Object_Item *navi_item;
+ Evas_Object *win; /**< @brief Application's window.*/
+ Evas_Object *layout; /**< @brief Application's base layout.*/
+ Evas_Object *naviframe; /**< @brief Naviframe.*/
+ Evas_Object *list_main; /**< @brief Genlist with notification panel settings.*/
+ Evas_Object *list_sub; /**< @brief Genlist used in "Set schedule" and "Excepted apps" views.*/
+ Evas_Object *cancel_button; /**< @brief "Cancel" button displayed on the top of naviframe.*/
+ Evas_Object *done_button; /**< @brief "Done" button displayed on the top of naviframe.*/
+ Elm_Object_Item *navi_item; /**< @brief Naviframe item.*/
} ug_data;
-
+/**
+ * @brief Codes of genlist item styles.
+ */
enum {
- ITEM_STYLE_DEFAULT = 0,
- ITEM_STYLE_TYPE_ONE,
- ITEM_STYLE_ONE_ICON,
- ITEM_STYLE_RADIO,
+ ITEM_STYLE_DEFAULT = 0,/**< "default" style.*/
+ ITEM_STYLE_TYPE_ONE, /**< "type1" style. */
+ ITEM_STYLE_ONE_ICON, /**< "one_icon" style. */
+ ITEM_STYLE_RADIO, /**< "radio" style.*/
};
-ug_data* get_app_ui_data() ;
+/**
+ * @brief Gets pointer to main app's data structure.
+ * @return data structure.
+ */
+ug_data *get_app_ui_data();
+
+/**
+ * @brief Used to store ug_data instance as a global variable.
+ * @param[in] data an instance of ug_data.
+ */
void set_app_ui_data(ug_data *data);
+/**
+ * @brief Used to create generic layout based on specified parent.
+ * @param[in] parent parent object.
+ * @return created layout.
+ */
Evas_Object *create_layout(Evas_Object *parent);
+
+/**
+ * @brief Creates background layout for "Notifications on Lockscreen" view.
+ * @param[in] parent parent object.
+ * @return created background layout.
+ */
Evas_Object *create_background(Evas_Object *parent);
+
+/**
+ * @brief Creates a naviframe based on specified parent object.
+ * @param[in] parent parent object.
+ * @return created naviframe.
+ */
Evas_Object *create_naviframe(Evas_Object *parent);
-Evas_Object* create_icon(Evas_Object *parent, char* icon_path);
-Evas_Object* create_custom_layout(Evas_Object *parent, char* group_name);
-void gl_loaded_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED);
-void gl_realized_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info);
-void gl_longpressed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info);
+/**
+ * @brief Creates icon based on specified parent object and loads picture available by specified path.
+ * @param[in] parent parent object.
+ * @param[in] icon_path path to icon-file. In case of NULL passed here "images/unknown.png" from internal resource app's dir is loaded.
+ * @return created icon.
+ */
+Evas_Object *create_icon(Evas_Object *parent, char *icon_path);
+/**
+ * @brief Creates a layout based on specified parent object and applies specified style to it.
+ * @param[in] parent parent object.
+ * @param[in] group_name name of style to be applied to a new layout.
+ * @return created layout.
+ */
+Evas_Object *create_custom_layout(Evas_Object *parent, char *group_name);
+
+/**
+ * @brief A callback raised when genlist-item is pressed.
+ * @param[in] data user-data passed into-callback.
+ * @param[in] obj required by EFL, but not used.
+ * @param[in] event_info required by EFL, but not used.
+ */
void gl_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info);
+
+/**
+ * @brief A callback raised on "contracted"-event from EFL. Removes all sub-item of specified genlist-item.
+ * @param[in] event_info genlist-item.
+ */
void gl_contracted_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info);
void gl_del_cb(void *data, Evas_Object *obj EINA_UNUSED);
-void append_gl_group_index(Evas_Object *genlist, char* text);
/**
- * @brief Append Eina_List to genlist and add radio button to each list item
- * @param genlist The genlist object
- * @param list List of selected items
- * @param style Name of the visual style to use for genlist. If you don't know use "default"
+ * @brief Appends Eina_List to genlist and add radio button to each list item.
+ * @param[in] genlist The genlist object
+ * @param[in] list List of selected items
+ * @param[in] style Name of the visual style to use for genlist. If you don't know use "default"
*/
void append_gl_radio_item_list(Evas_Object *genlist, Eina_List* list, char *style);
+
+/**
+ * @brief Appends specified list of items to a specified genlist.
+ * @param[in] genlist a genlist items should be appended to.
+ * @param[in] list list of items to append.
+ * @param[in] style code of style to be applied to items.
+ */
void append_gl_item_list(Evas_Object *genlist, Eina_List* list, int style);
+
+/**
+ * @brief Appends an item to genlist on main application's layout.
+ * @param[in] genlist a genlist on main view.
+ * @param[in] style name of style to be applied to new genlist item.
+ * @param[in] ugName a string identifier of genlist-item used to distinguish how the content of new item should be created.
+ */
void append_gl_start_option(Evas_Object *genlist, char *style, char *ugName);
+
+/**
+ * @brief Creates an item with checkbox and "Allow All" text for "App Notifications" view and
+ * adds it to specified genlist.
+ * @param[in] genlist a genlist new item should be added to.
+ * @return created genlist item.
+ */
Elm_Widget_Item *append_gl_allow_all(Evas_Object *genlist);
-void append_gl_full_item(Evas_Object *genlist, Evas_Object *(*fullContentCb)(Evas_Object* parent, void *data), void *cbData);
+/**
+ * @brief Aimed to append item with complex content to specified genlist (like weekday selector
+ * in "Set schedule")
+ * @param[in] genlist a genlist new item should be appended to.
+ * @param[in] fullContentCb a callback passed from outside that should create content of new genlist item.
+ * @param[in] cbData user data.
+ * @see full_content_data_s
+ */
+void append_gl_full_item(Evas_Object *genlist, Evas_Object *(*fullContentCb)(Evas_Object* parent, void *data), void *cbData);
+/**
+ * @brief A callback raised when user exits from "App Notifications" view.
+ * @param[in] data user-data passed into callback. In this case it's a Naviframe-object.
+ * @param[in] obj a control(back-button) that was pressed.
+ * @param[in] event_info a param required by EFL - not used.
+ */
void back_button_cb(void *data, Evas_Object *obj, void *event_info);
+
/**
- * @brief A callback function that canceled operation and returns to previous menu
- * @param data User data to be passed to the callback function
- * @param obj A smart object
- * @param event_info The event's info name string
+ * @brief A callback function that canceled operation and returns to previous menu.
+ * @param[in] data User data to be passed to the callback function.
+ * @param[in] obj A smart object.
+ * @param[in] event_info The event's info name string.
*/
void cancel_button_noti_ls_cb(void *data, Evas_Object *obj, void *event_info);
+
/**
- * @brief A callback function that confirms operation
- * @param data User data to be passed to the callback function
- * @param obj A smart object
- * @param event_info The event's info name string
+ * @brief A callback function that confirms operation.
+ * @param[in] data User data to be passed to the callback function.
+ * @param[in] obj A smart object.
+ * @param[in] event_info The event's info name string.
*/
void done_button_noti_ls_cb(void *data, Evas_Object *obj, void *event_info);
-
#endif //__COMMON_EFL_H__
#ifndef __DO_NOT_DISTURB_EFL_H__
#define __DO_NOT_DISTURB_EFL_H__
-#include <Evas.h>
-#include <stdbool.h>
-#include <notification_setting.h>
-
#include <Elementary.h>
-#include "log.h"
-#include "common-efl.h"
-void do_not_disturb_append_item_in_list(Evas_Object* genlist);
+
+/**
+ * @brief Populates specified genlist with items from "Do not Disturb" view:
+ * - "Do not disturb" radio-button
+ * - "Enable as scheduled"
+ * - "Allowed calls"
+ *
+ * @param[in] genlist a genlist to populate.
+ */
+void do_not_disturb_append_items_in_list(Evas_Object* genlist);
+
+/**
+ * @brief Creates a layout with table filled with applications notifications are allowed from.
+ * @param[in] parent parent for new layout.
+ * @param[in] data a list of allowed applications
+ * @return created layout.
+ * @see item_info_s
+ */
Evas_Object *do_not_disturb_allowed_apps_cont_cb(Evas_Object* parent, void *data);
#endif //__DO_NOT_DISTURB_EFL_H__
#ifndef __EXCEPTED_APPS_EFL_H__
#define __EXCEPTED_APPS_EFL_H__
-#include <Evas.h>
-#include <stdbool.h>
-#include <notification_setting.h>
-
#include <Elementary.h>
-#include <package_manager.h>
-
+/**
+ * @brief A callback raised when button "Manage" on "Do not disturb" view is pressed.
+ * @param[in] data user-data.
+ * @param[in] obj required by EFL, but not used.
+ * @param[in] event_info required by EFL, but not used.
+ * @see ug_data
+ */
void exception_application_clicked_cb(void *data, Evas_Object *obj, void *event_info);
-
#endif //__EXCEPTED_APPS_EFL_H__
Eina_List *lower_noti_list;
} setting_info_s;
+/**
+ * @brief checks the state of "do not disturb" notification setting.
+ * @return true if "do not disturb" is enabled, otherwise false.
+ */
bool get_do_not_disturb();
+
+/**
+ * @brief Saves new state of "do not disturb" setting to notification panel settings.
+ * @param[in] state new state. If true enables
+ */
void set_do_not_disturb(bool state);
bool set_allow_to_nofity(char *pkg_name, bool state);
Eina_List *get_excepted_apps_list();
Eina_List *get_not_excepted_apps_list();
/**
- *@brief Get list that should be shown in lower part of screen in lock screen content menu
- *@return Eina_List with commands that can be done in lock screen content menu
+ *@brief Get list that should be shown in lower part of screen in lock screen content menu.
+ *@return Eina_List with commands that can be done in lock screen content menu.
*/
Eina_List *get_lower_noti_list();
void create_app_notification_list();
void create_do_not_disturb_application_list();
/**
- *@brief Create list that should be shown in lower part of screen in lock screen content menu
+ *@brief Create list that should be shown in lower part of screen in lock screen content menu.
*/
void create_notification_on_ls_list();
/**
- *@brief Remove list that should be shown in lower part of screen in lock screen content menu
+ *@brief Remove list that should be shown in lower part of screen in lock screen content menu.
*/
void remove_lower_noti_list();
void remove_all_apps_list();
#include <tizen.h>
#include "log.h"
+/**
+ * @brief A data-structure that represents a notification settings for a specific application.
+ */
typedef struct {
- /* innate features */
- char *appid;
- char *name;
- char *icon;
-
- int ordering;
- bool is_app_data;
- int index;
- bool allow_to_notify;
- bool do_not_disturb_except;
- bool visibility_class;
- int item_style;
+ char *appid; /**< @brief Application's package name.*/
+ char *name; /**< @brief Application's display name.*/
+ char *icon; /**< @brief Path to application's icon.*/
+ int index; /**< @brief Item's index in list that contains it.*/
+ bool allow_to_notify; /**< @brief Flag that defines if application is allowed to post notifications.*/
+ bool do_not_disturb_except; /**< @brief Flag that defines if application is set an exception and allowed to post notifications in "Do not disturb" mode.*/
+ int item_style; /**< @brief A code of style that should be applied to genlist-item that represents this application.*/
} item_info_s;
-HAPI item_info_s *apps_item_info_create(const char *appid);
+/**
+ * @brief Gets path icon of application with specified package name.
+ * @param[in] package name of application.
+ * @return path to icon.
+ */
HAPI char *get_app_icon(char *appid);
+
+/**
+ * @brief Gets display name of application with specified package name.
+ * @param[in] package name of application.
+ * @return application's display name.
+ */
HAPI char *get_app_name(const char *appid);
+
+/**
+ * @brief A function aimed to compare display names in list of item_info_s items in eina_list_sort().
+ * @param[in] first item to compare.
+ * @param[in] second item to compare.
+ * @return 0 if names are equal, >0 if the first character of display name that does not match has a lower value in d1 than in d2, <0 otherwise,
+ * @see item_info_s
+ */
HAPI int apps_sort_cb(const void *d1, const void *d2);
*/
#include "allowed-calls.h"
+#include <Evas.h>
+
+#include <Elementary.h>
+#include "log.h"
+#include "common-efl.h"
static char *items[4] = {
"IDS_QP_TAB4_ALL_M_RECEIVED_ALL",
return naviframe;
}
-void gl_loaded_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
-{
-}
-
-void gl_realized_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
-{
-}
-
-void gl_longpressed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
-{
-}
-
void gl_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Elm_Object_Item *it = (Elm_Object_Item*)event_info;
return layout;
}
-static char *gl_group_index_text_get_cb(void *data, Evas_Object *obj, const char *part)
-{
- char *text = (char*)data;
-
- if (!strcmp(part, "elm.text")) {
- return strdup(text);
- }
-
- return NULL;
-}
-
-void append_gl_group_index(Evas_Object *genlist, char* text) {
- Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
- ret_if(!itc);
-
- itc->item_style = "group_index";
- itc->func.text_get = gl_group_index_text_get_cb;
- itc->func.content_get = NULL;
- itc->func.del = gl_del_cb;
-
-
- elm_genlist_item_append(genlist, /* genlist object */
- itc, /* item class */
- strdup(text), /* item class user data */
- NULL, /* parent item */
- ELM_GENLIST_ITEM_NONE, /* item type */
- gl_selected_cb, /* select smart callback */
- NULL); /* smart callback user data */
-
-
- elm_genlist_item_class_free(itc);
-}
-
static void _excepted_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
NOTISET_TRACE_BEGIN;
elm_naviframe_item_pop(data);
}
+/**
+ * @brief This struct stands for helping to generate a full content-layout of item added to genlist.
+ */
typedef struct
{
- Evas_Object *(*fullContentCb)(Evas_Object* parent, void *data);
- void *cbData;
+ /**
+ * A callback raised from genlist item class'es content_get callback that should create genlist
+ * item's content.
+ * */
+ Evas_Object *(*fullContentCb)(Evas_Object* parent, void *data);
+ void *cbData; /**< User-data passed to fullContentCb.*/
} full_content_data_s;
static Evas_Object* _gl_full_content_get_cb(void *data, Evas_Object *obj, const char *part)
#include "do-not-disturb-efl.h"
#include "excepted-apps-efl.h"
#include "common-efl.h"
+#include "log.h"
+#include <notification_setting.h>
#define ALLOWED_LAYOUT_NAME "allow_noti_from_layout"
#define ALLOWED_LAYOUT_TEXT_PART "elm.text"
#define APP_LAYOUT_HEADER 95 + 64
#define ITEMS_PER_ROW 5
-void do_not_disturb_append_item_in_list(Evas_Object* genlist)
+void do_not_disturb_append_items_in_list(Evas_Object* genlist)
{
append_gl_start_option(genlist, "multiline", "do-not-disturb");
// TODO: append when API will be implemented, will be move to final release
#include "notification-setting-info.h"
#include "common-efl.h"
#include "do-not-disturb-efl.h"
+#include <notification_setting.h>
static Evas_Object* _create_edit_exception_apps_list(ug_data *ugd)
{
elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
/* Add Smart Callback */
- evas_object_smart_callback_add(genlist, "realized", gl_realized_cb, NULL);
- evas_object_smart_callback_add(genlist, "loaded", gl_loaded_cb, NULL);
- evas_object_smart_callback_add(genlist, "longpressed", gl_longpressed_cb, NULL);
evas_object_smart_callback_add(genlist, "contracted", gl_contracted_cb, NULL);
append_gl_item_list(genlist, get_first_allowed_apps_list(), ITEM_STYLE_DEFAULT);
create_do_not_disturb_application_list();
elm_genlist_clear(u_data->list_main);
- do_not_disturb_append_item_in_list(u_data->list_main);
+ do_not_disturb_append_items_in_list(u_data->list_main);
}
}
elm_genlist_block_count_set(genlist, 8);
/* Add Smart Callback */
- evas_object_smart_callback_add(genlist, "realized", gl_realized_cb, NULL);
- evas_object_smart_callback_add(genlist, "loaded", gl_loaded_cb, NULL);
- evas_object_smart_callback_add(genlist, "longpressed", gl_longpressed_cb, NULL);
evas_object_smart_callback_add(genlist, "contracted", gl_contracted_cb, NULL);
-
- do_not_disturb_append_item_in_list(genlist);
+ do_not_disturb_append_items_in_list(genlist);
return genlist;
}
elm_genlist_block_count_set(genlist, 8);
/* Add Smart Callback */
- evas_object_smart_callback_add(genlist, "realized", gl_realized_cb, NULL);
- evas_object_smart_callback_add(genlist, "loaded", gl_loaded_cb, NULL);
- evas_object_smart_callback_add(genlist, "longpressed", gl_longpressed_cb, NULL);
evas_object_smart_callback_add(genlist, "contracted", gl_contracted_cb, NULL);
append_gl_allow_all(genlist);
notification_setting_get_package_name(temp, &package_name);
item_info->appid = package_name;
-
notification_setting_get_allow_to_notify(temp, &allow_to_notify);
item_info->allow_to_notify = allow_to_notify;