Added TizenRefApp-6774 added doxygen headers, removed unused code 33/83233/1
authorAndrey Klimenko <and.klimenko@samsung.com>
Tue, 9 Aug 2016 14:56:30 +0000 (17:56 +0300)
committerAndrey Klimenko <and.klimenko@samsung.com>
Tue, 9 Aug 2016 14:58:28 +0000 (17:58 +0300)
Change-Id: I82b90a0abee44898ce701959b826e73043e3e914
Signed-off-by: Andrey Klimenko <and.klimenko@samsung.com>
12 files changed:
inc/allowed-calls.h
inc/common-efl.h
inc/do-not-disturb-efl.h
inc/excepted-apps-efl.h
inc/notification-setting-info.h
inc/pkgmgr-setting-info.h
src/allowed-calls.c
src/common-efl.c
src/do-not-disturb-efl.c
src/excepted-apps-efl.c
src/main.c
src/notification-setting-info.c

index a72f38a2fa1ed25baf6a10eacaa5930c6bc13565..f6a1874bb1c5a3dc7086c9cd52f483874d6d9acb 100644 (file)
 #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__
index 5b449b884af35e1656a694f5c7398c29d600ddf8..d2449ce969e458ee56038434ea2af4a61da434bd 100755 (executable)
@@ -22,7 +22,6 @@
 #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__
index a0a76cffad4cda34e929c75524d54fb973af8061..d721906d01cbe70c15390fc068f495b176adcee0 100755 (executable)
 #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__
index 5196c143b89bfebbc8aa541f5e98752bb8ee50ce..9dc2cda68f4af28548e1d8836b599b5409c6a81b 100755 (executable)
 #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__
index 0b1790df3e624dfe0d2cf33e868efba700865645..2161190631ec50a01add4acbfb30b1eb4d379381 100755 (executable)
@@ -34,7 +34,16 @@ typedef struct _setting_info_t {
     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);
@@ -48,19 +57,19 @@ Eina_List *get_first_excepted_apps_list();
 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();
index 5741c545d72078ad3caea441e51dc1495765767d..0a151b83ad4997be17ca24112b45aad3f3330488 100755 (executable)
 #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);
 
 
index 611676d9915d1938e762c2c83dd6fcc8f79cc154..c906a063015469e4a84bba03d2cbd94377dc9f75 100755 (executable)
  */
 
 #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",
index e75d3a8d7e1e5c0be9a84c1068a45be8146a9110..d09d1342695db3121175888c0ca88402a3a104f2 100755 (executable)
@@ -95,18 +95,6 @@ Evas_Object *create_naviframe(Evas_Object *parent)
        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;
@@ -176,39 +164,6 @@ Evas_Object* create_custom_layout(Evas_Object *parent, char* group_name)
     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;
@@ -671,10 +626,17 @@ void back_button_cb(void *data, Evas_Object *obj, void *event_info)
        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)
index 652e05c6eb0514d4ea0aa7814837094be4371362..06fc75d4a883f38a21ec27c2b2404012b0d2d812 100755 (executable)
@@ -18,6 +18,8 @@
 #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"
@@ -32,7 +34,7 @@
 #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
index 7f12de160025d360b8b03ca5b2db8f29857bd035..4a807e2e53bcf593b0d255503dbe907330276910 100755 (executable)
@@ -23,6 +23,7 @@
 #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)
 {
@@ -34,9 +35,6 @@ 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);
@@ -93,7 +91,7 @@ static void _done_button_cb(void *data, Evas_Object *obj, void *event_info)
 
         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);
     }
 }
 
index a4c8b9b6629c1a327bf5bc478d5313ed06452af8..56fd142a6c2af7def6c32802eef4860121c9fb81 100755 (executable)
@@ -90,12 +90,8 @@ static Evas_Object* _create_do_not_disturb_gl(ug_data *ugd)
        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;
 }
@@ -150,9 +146,6 @@ Evas_Object* _create_app_notification_gl(ug_data *ugd)
        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);
index 60be7972117bcedfba1ac6797ffc798f8139f539..b47c84bc37fb0ec71afe0bfa0df12c9c1a981a21 100755 (executable)
@@ -57,7 +57,6 @@ void create_app_notification_list()
             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;