summaryrefslogtreecommitdiff
path: root/src/common/utils.c
diff options
context:
space:
mode:
authorHyojung Jo <hj903.jo@samsung.com>2015-08-25 14:52:01 +0900
committerHyojung Jo <hj903.jo@samsung.com>2015-08-25 17:27:07 +0900
commitbad9bd9c939363172e2f1cf61ae1834868da5b81 (patch)
treef03bfb83b07fcf752902572f9aa6bd1994aad83f /src/common/utils.c
parent13d61c71cb31c22268cdcfed58710b5f32e1e156 (diff)
downloadair_favorite-bad9bd9c939363172e2f1cf61ae1834868da5b81.tar.gz
air_favorite-bad9bd9c939363172e2f1cf61ae1834868da5b81.tar.bz2
air_favorite-bad9bd9c939363172e2f1cf61ae1834868da5b81.zip
Add notify util function and edc code for notify stylesubmit/tizen/20150825.125147accepted/tizen/tv/20150826.015708
Change-Id: I5c5eebe38e8045eb238130aa1dda80efafb42bee Signed-off-by: Hyojung Jo <hj903.jo@samsung.com>
Diffstat (limited to 'src/common/utils.c')
-rw-r--r--src/common/utils.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/common/utils.c b/src/common/utils.c
index f3e7223..ed0958c 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -184,6 +184,51 @@ Evas_Object *utils_add_table(Evas_Object *parent, const char *part,
return table;
}
+Evas_Object *utils_add_notify(Evas_Object *parent, const char *text,
+ const char *noti_style, const char *label_style, int timeout)
+{
+ Evas_Object *notify, *lbl;
+
+ if (!parent) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ notify = elm_notify_add(parent);
+ if (!notify) {
+ _ERR("elm_notify_add failed.");
+ return NULL;
+ }
+
+ evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_notify_align_set(notify, 0.0, 1.0);
+ elm_notify_timeout_set(notify, timeout);
+
+ if (noti_style)
+ elm_object_style_set(notify, noti_style);
+
+ lbl = elm_label_add(notify);
+ if (!lbl) {
+ _ERR("elm_label_add failed.");
+ evas_object_del(notify);
+ return NULL;
+ }
+
+ elm_object_content_set(notify, lbl);
+ evas_object_show(lbl);
+
+ if (label_style)
+ elm_object_style_set(lbl, label_style);
+
+ if (text)
+ elm_object_text_set(lbl, text);
+
+ evas_object_show(notify);
+
+ return notify;
+}
+
bool utils_launch_app(const char *appid, const char *key, const char *value)
{
app_control_h app_ctrl;