revert to the migration tempoary
[framework/uifw/elementary.git] / src / lib / elm_tickernoti.c
1 #include <Elementary.h>
2 #include "elm_priv.h"
3
4 /**
5  * @defgroup TickerNoti TickerNoti
6  * @ingroup Elementary
7  *
8  * This is a notification widget which can be used to display some short information.
9  */
10
11 typedef struct _Widget_Data Widget_Data;
12
13 struct _Widget_Data
14 {
15    Evas_Object *win;
16    Evas_Object *edje_obj;
17    Evas_Object *icon;
18    Evas_Object *button;
19    Ecore_Event_Handler *rotation_event_handler;
20    const char *label;
21    int noti_height;
22    int angle;
23    Elm_Tickernoti_Mode mode;
24    Elm_Tickernoti_Orient orient;
25 };
26
27 static const char *widtype = NULL;
28 static void _del_hook(Evas_Object *obj);
29 static void _theme_hook(Evas_Object *obj);
30 static void _sizing_eval(Evas_Object *obj);
31 static void _update_geometry_on_rotation(Evas_Object *obj, int angle, int *x, int *y, int *w);
32
33 static const char SIG_CLICKED[] = "clicked";
34 static const char SIG_HIDDEN[] = "hide";
35 static const Evas_Smart_Cb_Description _signals[] = {
36        {SIG_CLICKED, ""},
37        {SIG_HIDDEN, ""},
38        {NULL, NULL}
39 };
40
41 static void
42 _del_job(void *data)
43 {
44    evas_object_del(data);
45 }
46
47 static void
48 _del_hook(Evas_Object *obj)
49 {
50    Evas_Object *parent;
51    Widget_Data *wd = elm_widget_data_get(obj);
52
53    if (!wd) return;
54    parent = elm_widget_parent_get(obj);
55    if (wd->rotation_event_handler)
56      ecore_event_handler_del(wd->rotation_event_handler);
57    if (wd->win) ecore_job_add(_del_job, parent);
58    evas_object_del(wd->edje_obj);
59    wd->edje_obj = NULL;
60    free(wd);
61 }
62
63 static void
64 _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
65 {
66    Widget_Data *wd = elm_widget_data_get(obj);
67
68    if (!wd) return;
69    edje_object_mirrored_set(wd->edje_obj, rtl);
70 }
71
72 static void
73 _theme_hook(Evas_Object *obj)
74 {
75    char *data_win_height = NULL;
76    Evas_Coord w;
77    Widget_Data *wd = elm_widget_data_get(obj);
78
79    if (!wd) return;
80    _elm_widget_mirrored_reload(obj);
81    _mirrored_set(obj, elm_widget_mirrored_get(obj));
82
83    _elm_theme_object_set(wd->win, wd->edje_obj, "tickernoti",
84                           "base", elm_widget_style_get(obj));
85
86    edje_object_scale_set(wd->edje_obj, elm_widget_scale_get(obj) * _elm_config->scale);
87
88    /* tickernoti detail height set */
89    data_win_height = (char *)edje_object_data_get(wd->edje_obj, "height");
90    if (data_win_height != NULL && elm_scale_get() > 0.0)
91      wd->noti_height = (int)(elm_scale_get() * atoi(data_win_height));
92
93    evas_object_geometry_get(wd->win, NULL, NULL, &w, NULL);
94    evas_object_resize(wd->win, w, wd->noti_height);
95
96    if (wd->label)
97      edje_object_part_text_set(wd->edje_obj, "elm.text", wd->label);
98    if (wd->icon)
99      edje_object_part_swallow(wd->edje_obj, "icon", wd->icon);
100    if (wd->button)
101      edje_object_part_swallow(wd->edje_obj, "button", wd->button);
102    edje_object_signal_emit(wd->edje_obj, "effect,show", "elm");
103    edje_object_message_signal_process(wd->edje_obj);
104
105    _sizing_eval(obj);
106 }
107
108 static void
109 _sizing_eval(Evas_Object *obj)
110 {
111    Widget_Data *wd = elm_widget_data_get(obj);
112    Evas_Coord minw = -1, minh = -1;
113
114    if (!wd) return;
115    elm_coords_finger_size_adjust(1, &minw, 1, &minh);
116    edje_object_size_min_restricted_calc(wd->edje_obj, &minw, &minh, minw, minh);
117    evas_object_size_hint_min_set(obj, minw, minh);
118 }
119
120 #ifdef HAVE_ELEMENTARY_X
121 static void
122 _update_window_hints(Evas_Object *obj)
123 {
124    Ecore_X_Window xwin;
125    Ecore_X_Atom _notification_level_atom;
126    int level;
127    // elm_win_xwindow_get() must call after elm_win_alpha_set()
128    xwin = elm_win_xwindow_get(obj);
129
130    ecore_x_icccm_hints_set(xwin, 0, ECORE_X_WINDOW_STATE_HINT_NONE, 0, 0, 0, 0, 0);
131    ecore_x_netwm_window_type_set(xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
132    ecore_x_netwm_opacity_set(xwin, 0);
133    // Create atom for notification level
134    _notification_level_atom = ecore_x_atom_get("_E_ILLUME_NOTIFICATION_LEVEL");
135
136    // HIGH:150, NORMAL:100, LOW:50
137    level = 100;
138
139    // Set notification level of the window
140    ecore_x_window_prop_property_set(xwin, _notification_level_atom, ECORE_X_ATOM_CARDINAL, 32, &level, 1);
141 }
142 #endif
143
144 static void _hide_cb(void *data, Evas_Object *obj __UNUSED__,
145                              const char *emission __UNUSED__,
146                              const char *source __UNUSED__)
147 {
148    Widget_Data *wd = elm_widget_data_get(data);
149
150    if (!wd) return;
151    evas_object_hide(wd->win);
152    evas_object_smart_callback_call(data, SIG_HIDDEN, NULL);
153 }
154
155 static void _clicked_cb(void *data, Evas_Object *obj __UNUSED__,
156                              const char *emission __UNUSED__,
157                              const char *source __UNUSED__)
158 {
159    Widget_Data *wd = elm_widget_data_get(data);
160
161    if (!wd) return;
162    evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
163 }
164
165 static Evas_Object
166 *_create_window(Evas_Object *parent, const char *name)
167 {
168    Evas_Object *win;
169
170    win = elm_win_add(parent, name, ELM_WIN_BASIC);
171    elm_win_title_set(win, name);
172    elm_win_borderless_set(win, EINA_TRUE);
173    elm_win_autodel_set(win, EINA_TRUE);
174    elm_win_alpha_set(win, EINA_TRUE);
175    evas_object_size_hint_weight_set(win, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
176    evas_object_size_hint_align_set(win, EVAS_HINT_FILL, EVAS_HINT_FILL);
177
178 #ifdef HAVE_ELEMENTARY_X
179    // set top window
180    _update_window_hints(win);
181 #endif
182    return win;
183 }
184
185 static void
186 _win_rotated(Evas_Object *obj)
187 {
188    Widget_Data *wd = elm_widget_data_get(obj);
189    int x = 0, y = 0, w = 0, angle = 0;
190
191    if (!wd) return;
192    angle = elm_win_rotation_get(wd->win);
193    if (angle % 90) return;
194    angle %= 360;
195    if (angle < 0) angle += 360;
196    wd->angle = angle;
197    _update_geometry_on_rotation(obj, wd->angle, &x, &y, &w);
198    evas_object_move(wd->win, x, y);
199    evas_object_resize(wd->win, w, wd->noti_height);
200 #ifdef HAVE_ELEMENTARY_X
201    _update_window_hints(wd->win);
202 #endif
203 }
204
205 static Eina_Bool
206 _prop_change(void *data, int type __UNUSED__, void *event)
207 {
208 #ifdef HAVE_ELEMENTARY_X
209    Ecore_X_Event_Window_Property *ev;
210    Widget_Data *wd = elm_widget_data_get(data);
211
212    if (!wd) return ECORE_CALLBACK_PASS_ON;
213    ev = event;
214    if (ev->atom == ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE)
215      {
216         if (ev->win == elm_win_xwindow_get(wd->win))
217           {
218              _win_rotated(data);
219           }
220      }
221    return ECORE_CALLBACK_PASS_ON;
222 #endif
223 }
224
225 static void
226 _create_tickernoti(Evas_Object *obj)
227 {
228 #ifdef HAVE_ELEMENTARY_X
229    Evas_Coord w;
230 #endif
231    Widget_Data *wd = elm_widget_data_get(obj);
232    char *data_win_height = NULL;
233    Evas *e;
234
235    if (!wd) return;
236
237    evas_object_move(wd->win, 0, 0);
238    e = evas_object_evas_get(wd->win);
239
240    wd->edje_obj = edje_object_add(e);
241    _elm_theme_object_set(wd->win, wd->edje_obj, "tickernoti", "base", "default");
242    elm_win_resize_object_add(wd->win, wd->edje_obj);
243
244    // tickernoti height setting
245    data_win_height = (char *)edje_object_data_get(wd->edje_obj, "height");
246    if (data_win_height != NULL && elm_scale_get() > 0.0)
247      wd->noti_height = (int)(elm_scale_get() * atoi(data_win_height));
248
249 #ifdef HAVE_ELEMENTARY_X
250    ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, NULL);
251    evas_object_resize(wd->win, w, wd->noti_height);
252    wd->rotation_event_handler = ecore_event_handler_add(
253             ECORE_X_EVENT_WINDOW_PROPERTY, _prop_change, obj);
254 #endif
255
256    edje_object_signal_callback_add(wd->edje_obj, "request,hide", "", _hide_cb, obj);
257    edje_object_signal_callback_add(wd->edje_obj, "clicked", "", _clicked_cb, obj);
258    evas_object_show(wd->edje_obj);
259 }
260
261 static void
262 _disable_hook(Evas_Object *obj)
263 {
264    Widget_Data *wd = elm_widget_data_get(obj);
265
266    if (!wd) return;
267 //TODO: To stop the event in case of being disabled
268 }
269
270 static void
271 _show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
272       void *event_info __UNUSED__)
273 {
274    Widget_Data *wd = elm_widget_data_get(obj);
275    if (!wd) return;
276
277 #ifdef HAVE_ELEMENTARY_X
278    _update_window_hints(wd->win);
279 #endif
280    evas_object_show(wd->win);
281    edje_object_signal_emit(wd->edje_obj, "effect,show", "elm");
282    edje_object_message_signal_process(wd->edje_obj);
283 }
284
285 static void
286 _hide(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
287       void *event_info __UNUSED__)
288 {
289    Widget_Data *wd = elm_widget_data_get(obj);
290
291    if (!wd) return;
292    evas_object_hide(wd->win);
293 }
294
295 static void _tickernoti_hide_cb(void *data, Evas_Object *obj __UNUSED__,
296                                  void *event_info __UNUSED__)
297 {
298    Widget_Data *wd = data;
299
300    if (!wd) return;
301
302    edje_object_signal_emit(wd->edje_obj, "effect,hide", "elm");
303    edje_object_message_signal_process(wd->edje_obj);
304 }
305
306 static void
307 _update_geometry_on_rotation(Evas_Object *obj, int angle, int *x, int *y, int *w)
308 {
309    ELM_CHECK_WIDTYPE(obj, widtype);
310    Widget_Data *wd = elm_widget_data_get(obj);
311
312    if (!wd) return;
313
314 #ifdef HAVE_ELEMENTARY_X
315    Evas_Coord root_w, root_h;
316
317    /*
318    * manually calculate win_tickernoti_indi window position & size
319    *  - win_indi is not full size window
320    */
321    ecore_x_window_size_get(ecore_x_window_root_first_get(), &root_w, &root_h);
322    // rotate win
323    switch(angle)
324      {
325       case 90:
326          *w = root_h;
327          if (wd->orient == ELM_TICKERNOTI_ORIENT_BOTTOM)
328            *x = root_w - wd->noti_height;
329          break;
330       case 270:
331          *w = root_h;
332          if (!(wd->orient == ELM_TICKERNOTI_ORIENT_BOTTOM))
333            *x = root_w - wd->noti_height;
334          break;
335       case 180:
336          *w = root_w;
337          if (!wd->orient == ELM_TICKERNOTI_ORIENT_BOTTOM)
338            *y = root_h - wd->noti_height;
339          break;
340        case 0:
341       default:
342          *w = root_w;
343          if (wd->orient == ELM_TICKERNOTI_ORIENT_BOTTOM)
344            *y = root_h - wd->noti_height;
345          break;
346      }
347 #endif
348 }
349
350 static void
351 _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
352 {
353    Widget_Data *wd = elm_widget_data_get(obj);
354    Evas_Object *sub = event_info;
355    if (!wd) return;
356    if (sub == wd->icon)
357      wd->icon = NULL;
358    if (sub == wd->button)
359      wd->button = NULL;
360 }
361
362 static void
363 _elm_tickernoti_label_set(Evas_Object *obj, const char *part, const char *label)
364 {
365    ELM_CHECK_WIDTYPE(obj, widtype);
366    Widget_Data *wd = elm_widget_data_get(obj);
367
368    if (!wd) return;
369    if (part && strcmp(part, "default")) return;
370    eina_stringshare_replace(&wd->label, label);
371    edje_object_part_text_set(wd->edje_obj, "elm.text", wd->label);
372    _sizing_eval(obj);
373 }
374
375 const char *
376 _elm_tickernoti_label_get(const Evas_Object *obj, const char *part)
377 {
378    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
379    Widget_Data *wd = elm_widget_data_get(obj);
380
381    if (part && strcmp(part, "default")) return NULL;
382    if (!wd) return NULL;
383    return wd->label;
384 }
385
386 static void
387 _elm_tickernoti_icon_set(Evas_Object *obj, Evas_Object *icon)
388 {
389    ELM_CHECK_WIDTYPE(obj, widtype);
390    Widget_Data *wd = elm_widget_data_get(obj);
391
392    if (!wd) return;
393    if (wd->icon == icon) return;
394    if (wd->icon) evas_object_del(wd->icon);
395    wd->icon = icon;
396    if (icon)
397      {
398         elm_widget_sub_object_add(obj, icon);
399         edje_object_part_swallow(wd->edje_obj, "icon", icon);
400      }
401 }
402
403 static void
404 _elm_tickernoti_button_set(Evas_Object *obj, Evas_Object *button)
405 {
406    ELM_CHECK_WIDTYPE(obj, widtype);
407    Widget_Data *wd = elm_widget_data_get(obj);
408
409    if (!wd) return;
410    if (wd->button == button) return;
411    if (wd->button) evas_object_del(wd->button);
412    wd->button = button;
413    if (button)
414      {
415         elm_widget_sub_object_add(obj, button);
416         edje_object_part_swallow(wd->edje_obj, "button", button);
417         evas_object_smart_callback_add(wd->button, "clicked", _tickernoti_hide_cb, wd);
418      }
419 }
420
421 static void
422 _elm_tickernoti_content_part_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
423 {
424    ELM_CHECK_WIDTYPE(obj, widtype);
425    Widget_Data *wd = elm_widget_data_get(obj);
426
427    if (!wd || !part) return;
428    if (!part || !strcmp(part, "icon"))
429      {
430         _elm_tickernoti_icon_set(obj, content);
431         return;
432      }
433    else if (!strcmp(part, "button"))
434      {
435         _elm_tickernoti_button_set(obj, content);
436         return;
437      }
438 }
439
440 static Evas_Object *
441 _elm_tickernoti_icon_get(const Evas_Object *obj)
442 {
443    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
444    Widget_Data *wd = elm_widget_data_get(obj);
445    if (!wd) return NULL;
446    return wd->icon;
447 }
448
449 static Evas_Object *
450 _elm_tickernoti_button_get(const Evas_Object *obj)
451 {
452    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
453    Widget_Data *wd = elm_widget_data_get(obj);
454    if (!wd) return NULL;
455    return wd->button;
456 }
457
458 static Evas_Object *
459 _elm_tickernoti_content_part_get_hook(Evas_Object *obj, const char *part)
460 {
461    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
462    Widget_Data *wd = elm_widget_data_get(obj);
463
464    if (!wd || !part) return NULL;
465    if (!part || !strcmp(part, "icon"))
466      return _elm_tickernoti_icon_get(obj);
467    else if (!strcmp(part, "button"))
468      return _elm_tickernoti_button_get(obj);
469    return NULL;
470 }
471
472 static Evas_Object *
473 _elm_tickernoti_icon_unset(Evas_Object *obj)
474 {
475    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
476    Evas_Object *icon;
477    Widget_Data *wd = elm_widget_data_get(obj);
478
479    if (!wd || !wd->icon) return NULL;
480    icon = wd->icon;
481    elm_widget_sub_object_del(obj, wd->icon);
482    edje_object_part_unswallow(wd->edje_obj, icon);
483    wd->icon = NULL;
484    return icon;
485 }
486
487 static Evas_Object *
488 _elm_tickernoti_button_unset(Evas_Object *obj)
489 {
490    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
491    Evas_Object *button;
492    Widget_Data *wd = elm_widget_data_get(obj);
493
494    if (!wd || !wd->button) return NULL;
495    button = wd->button;
496    elm_widget_sub_object_del(obj, wd->button);
497    edje_object_part_unswallow(wd->edje_obj, button);
498    wd->button = NULL;
499    return button;
500 }
501
502 static Evas_Object *
503 _elm_tickernoti_content_part_unset_hook(Evas_Object *obj, const char *part)
504 {
505    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
506    Widget_Data *wd = elm_widget_data_get(obj);
507
508    if (!wd || !part) return NULL;
509    if (!strcmp(part, "icon"))
510      return _elm_tickernoti_icon_unset(obj);
511    else if (!strcmp(part, "button"))
512      return _elm_tickernoti_button_unset(obj);
513    return NULL;
514 }
515
516 /**
517  * Add a tickernoti object to @p parent
518  *
519  * @param parent The parent object
520  *
521  * @return The tickernoti object, or NULL upon failure
522  *
523  * @ingroup TickerNoti
524  */
525 EAPI Evas_Object *
526 elm_tickernoti_add(Evas_Object *parent)
527 {
528    Evas_Object *obj;
529    Evas *e;
530    Widget_Data *wd;
531
532    wd = ELM_NEW(Widget_Data);
533    wd->win = _create_window(parent, "noti-window");
534
535    e = evas_object_evas_get(wd->win);
536    obj = elm_widget_add(e);
537    ELM_SET_WIDTYPE(widtype, "tickernoti");
538    elm_widget_type_set(obj, widtype);
539    elm_widget_sub_object_add(wd->win, obj);
540    elm_widget_data_set(obj, wd);
541    elm_widget_del_hook_set(obj, _del_hook);
542    elm_widget_theme_hook_set(obj, _theme_hook);
543    elm_widget_can_focus_set(obj, 0);
544    elm_widget_disable_hook_set(obj, _disable_hook);
545
546    wd->orient = ELM_TICKERNOTI_ORIENT_TOP;
547
548    _create_tickernoti(obj);
549    elm_widget_text_set_hook_set(obj, _elm_tickernoti_label_set);
550    elm_widget_text_get_hook_set(obj, _elm_tickernoti_label_get);
551    elm_widget_content_set_hook_set(obj, _elm_tickernoti_content_part_set_hook);
552    elm_widget_content_get_hook_set(obj, _elm_tickernoti_content_part_get_hook);
553    elm_widget_content_unset_hook_set(obj, _elm_tickernoti_content_part_unset_hook);
554    evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, NULL);
555
556    evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, NULL);
557    evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, NULL);
558    evas_object_smart_callbacks_descriptions_set(obj, _signals);
559    return obj;
560 }
561
562 /**
563  * Get the rotation of tickernoti object
564  *
565  * @param obj The tickernotil object
566  * @return The rotation angle
567  * @ingroup TickerNoti
568  */
569 EAPI int
570 elm_tickernoti_rotation_get(const Evas_Object *obj)
571 {
572    ELM_CHECK_WIDTYPE(obj, widtype) -1;
573    Widget_Data *wd = elm_widget_data_get(obj);
574    if (!wd) return -1;
575    return wd->angle;
576 }
577
578 /**
579  * Set the rotation angle for the tickernoti object
580  *
581  * @param obj The tickernoti object
582  * @param angle The rotation angle(in degree) will be used on the tickernoti object
583  * @ingroup TickerNoti
584  */
585 EAPI void
586 elm_tickernoti_rotation_set(Evas_Object *obj, int angle)
587 {
588    ELM_CHECK_WIDTYPE(obj, widtype);
589    Widget_Data *wd = elm_widget_data_get(obj);
590
591    if (!wd) return;
592    if (angle % 90) return;
593    angle %= 360;
594    if (angle < 0) angle += 360;
595    wd->angle = angle;
596    elm_win_rotation_with_resize_set (wd->win, angle);
597 }
598
599 /**
600  * Set the orientation of the tickernoti object
601  *
602  * @param obj The tickernoti object
603  * @param orient The orientation of tickernoti object
604  * @ingroup TickerNoti
605  */
606 EAPI void
607 elm_tickernoti_orient_set(Evas_Object *obj, Elm_Tickernoti_Orient orient)
608 {
609    ELM_CHECK_WIDTYPE(obj, widtype);
610
611 #ifdef HAVE_ELEMENTARY_X
612    Evas_Coord root_w, root_h;
613 #endif
614    Widget_Data *wd = elm_widget_data_get(obj);
615
616    if (!wd) return;
617    if (orient >= ELM_TICKERNOTI_ORIENT_LAST) return;
618
619 #ifdef HAVE_ELEMENTARY_X
620    ecore_x_window_size_get(ecore_x_window_root_first_get(), &root_w, &root_h);
621 #endif
622
623    switch(orient) {
624       case ELM_TICKERNOTI_ORIENT_BOTTOM:
625 #ifdef HAVE_ELEMENTARY_X
626          evas_object_move(wd->win, 0, root_h - wd->noti_height);
627 #endif
628          wd->orient = ELM_TICKERNOTI_ORIENT_BOTTOM;
629          break;
630       case ELM_TICKERNOTI_ORIENT_TOP:
631       default:
632 #ifdef HAVE_ELEMENTARY_X
633          evas_object_move(wd->win, 0, 0);
634 #endif
635          wd->orient = ELM_TICKERNOTI_ORIENT_TOP;
636          break;
637    }
638 #ifdef HAVE_ELEMENTARY_X
639    _update_window_hints(wd->win);
640 #endif
641 }
642
643 /**
644  * Get the orientation of the tickernoti object
645  *
646  * @param obj The tickernotil object
647  * @return The orientation of tickernotil object
648  *
649  * @ingroup TickerNoti
650  */
651 EAPI Elm_Tickernoti_Orient
652 elm_tickernoti_orient_get(const Evas_Object *obj)
653 {
654    ELM_CHECK_WIDTYPE(obj, widtype) -1;
655    Widget_Data *wd = elm_widget_data_get(obj);
656
657    if (!wd) return ELM_TICKERNOTI_ORIENT_LAST;
658    return wd->orient;
659 }
660
661 /**
662  * Get the view window(elm_win) on the tickernoti object
663  *
664  * @param obj The tickernotil object
665  * @return internal view window(elm_win) object
666  *
667  * @ingroup TickerNoti
668  */
669 EAPI Evas_Object *
670 elm_tickernoti_win_get(const Evas_Object *obj)
671 {
672    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
673    Widget_Data *wd = elm_widget_data_get(obj);
674    if (!wd) return NULL;
675    return wd->win;
676 }
677
678 // ################### Below APIs are going to be removed. ###########################
679 /**
680  * Set the detail label on the tickernoti object
681  *
682  * @param obj The tickernoti object
683  * @param label The label will be used on the tickernoti object
684  * @deprecated use elm_object_text_set() instead
685  *
686  * @ingroup TickerNoti
687  */
688 EAPI void
689 elm_tickernoti_detailview_label_set(Evas_Object *obj, const char *label)
690 {
691    _elm_tickernoti_label_set(obj, NULL, label);
692 }
693
694 /**
695  * Get the detail label used on the tickernoti object
696  *
697  * @param obj The tickernotil object
698  * @return The string inside the label
699  * @deprecated use elm_object_text_get() instead
700  *
701  * @ingroup TickerNoti
702  */
703 EAPI const char *
704 elm_tickernoti_detailview_label_get(const Evas_Object *obj)
705 {
706    return _elm_tickernoti_label_get(obj, NULL);
707 }
708
709 /**
710  * Set the button object used on the tickernoti object
711  *
712  * @param obj The tickernotil object
713  * @param button The button object will be used on the tickernoti object
714  * @deprecated use elm_object_content_part_set() instead with "icon" as part name
715  *
716  * @ingroup TickerNoti
717  */
718 EAPI void
719 elm_tickernoti_detailview_button_set(Evas_Object *obj, Evas_Object *button)
720 {
721    _elm_tickernoti_button_set(obj, button);
722 }
723
724
725 /**
726  * Get the button object used on the tickernoti object
727  *
728  * @param obj The tickernotil object
729  * @return The button object inside the tickernoti
730  * @deprecated use elm_object_content_part_get() instead with "button" as part name
731  *
732  * @ingroup TickerNoti
733  */
734 EAPI Evas_Object *
735 elm_tickernoti_detailview_button_get(const Evas_Object *obj)
736 {
737    return _elm_tickernoti_button_get(obj);
738 }
739
740 /**
741  * Set the detail icon object used on the tickernoti object
742  *
743  * @param obj The tickernotil object
744  * @param icon The icon object will be used on the tickernoti object
745  * @deprecated use elm_object_content_part_set() instead with "icon" as part name
746  *
747  * @ingroup TickerNoti
748  */
749 EAPI void
750 elm_tickernoti_detailview_icon_set(Evas_Object *obj, Evas_Object *icon)
751 {
752    _elm_tickernoti_icon_set(obj, icon);
753 }
754
755 /**
756  * Get the detail icon object used on the tickernoti object
757  *
758  * @param obj The tickernotil object
759  * @return The icon object inside the tickernoti
760  * @deprecated use elm_object_content_part_get() instead with "icon" as part name
761  *
762  * @ingroup TickerNoti
763  */
764 EAPI Evas_Object *
765 elm_tickernoti_detailview_icon_get(const Evas_Object *obj)
766 {
767    return _elm_tickernoti_icon_get(obj);
768 }
769
770 /**
771  * Get the view mode on the tickernoti object
772  *
773  * @param obj The tickernotil object
774  * @return The view mode
775  * @deprecated removed as now styles are used instead
776  *
777  * @ingroup TickerNoti
778  */
779 EAPI Elm_Tickernoti_Mode
780 elm_tickernoti_mode_get(const Evas_Object *obj)
781 {
782    ELM_CHECK_WIDTYPE(obj, widtype) -1;
783    Widget_Data *wd = elm_widget_data_get(obj);
784    if (!wd) return -1;
785    return wd->mode;
786 }
787
788 /**
789  * Set the view mode used on the tickernoti object
790  *
791  * @param obj The tickernotil object
792  * @param mode The view mode will be used on the tickernoti object
793  * @deprecated removed as now styles are used instead
794  *
795  * @ingroup TickerNoti
796  */
797 EAPI void
798 elm_tickernoti_mode_set(Evas_Object *obj, Elm_Tickernoti_Mode mode)
799 {
800    ELM_CHECK_WIDTYPE(obj, widtype);
801    Widget_Data *wd = elm_widget_data_get(obj);
802    if (!wd) return;
803
804    switch(mode){
805       case ELM_TICKERNOTI_DEFAULT:
806       case ELM_TICKERNOTI_DETAILVIEW:
807          wd->mode = mode;
808          break;
809       default:
810          break;
811    }
812 }
813
814 /**
815  * Get the detail view window(elm_win) on the tickernoti object
816  *
817  * @param obj The tickernotil object
818  * @return detail view window(elm_win) object
819  * @ingroup TickerNoti
820  */
821 EAPI Evas_Object *
822 elm_tickernoti_detailview_get(const Evas_Object *obj)
823 {
824    return elm_tickernoti_win_get(obj);
825 }
826
827 /**
828  * Set the orientation of the tickernoti object
829  *
830  * @param obj The tickernoti object
831  * @param orient The orientation of tickernoti object
832  * @deprecated use elm_tickernoti_orient_set() instead
833  *
834  * @ingroup TickerNoti
835  */
836 EAPI void
837 elm_tickernoti_orientation_set(Evas_Object *obj, Elm_Tickernoti_Orient orient)
838 {
839    elm_tickernoti_orient_set(obj, orient);
840 }
841
842 /**
843  * Get the orientation of the tickernoti object
844  *
845  * @param obj The tickernotil object
846  * @return The orientation of tickernotil object
847  * @deprecated use elm_tickernoti_orient_get() instead
848  *
849  * @ingroup TickerNoti
850  */
851 EAPI Elm_Tickernoti_Orient
852 elm_tickernoti_orientation_get(const Evas_Object *obj)
853 {
854    return elm_tickernoti_orient_get(obj);
855 }
856
857 /**
858  * Set the label on the tickernoti object
859  *
860  * @param obj The tickernoti object
861  * @param label The label will be used on the tickernoti object
862  * @deprecated use elm_object_text_get()
863  *
864  * @ingroup TickerNoti
865  */
866 EAPI void
867 elm_tickernoti_label_set(Evas_Object *obj, const char *label)
868 {
869    _elm_tickernoti_label_set(obj, NULL, label);
870 }
871
872 /**
873  * Get the label used on the tickernoti object
874  *
875  * @param obj The tickernotil object
876  * @return The string inside the label
877  * @deprecated use elm_object_text_get() instead
878  *
879  * @ingroup TickerNoti
880  */
881 EAPI const char *
882 elm_tickernoti_label_get(const Evas_Object *obj)
883 {
884    return _elm_tickernoti_label_get(obj, NULL);
885 }
886
887 /**
888  * Set the action button object used on the tickernoti object
889  *
890  * @param obj The tickernotil object
891  * @param button The button object will be used on the tickernoti object
892  * @deprecated use elm_object_content_part_set() instead with "button" as part name
893  *
894  * @ingroup TickerNoti
895  */
896 EAPI void
897 elm_tickernoti_button_set(Evas_Object *obj, Evas_Object *button)
898 {
899    _elm_tickernoti_button_set(obj, button);
900 }
901
902 /**
903  * Get the action button object used on the tickernoti object
904  *
905  * @param obj The tickernotil object
906  * @return The button object inside the tickernoti
907  * @deprecated use elm_object_content_part_get() instead with "button" as part name
908  *
909  * @ingroup TickerNoti
910  */
911 EAPI Evas_Object *
912 elm_tickernoti_button_get(const Evas_Object *obj)
913 {
914    return _elm_tickernoti_button_get(obj);
915 }
916
917 /**
918  * Set the icon object of the tickernoti object
919  *
920  * @param obj The tickernotil object
921  * @param icon The icon object will be used on the tickernoti object
922  * @deprecated use elm_object_content_part_set() instead with "icon" as part name
923  *
924  * @ingroup TickerNoti
925  */
926 EAPI void
927 elm_tickernoti_icon_set(Evas_Object *obj, Evas_Object *icon)
928 {
929    _elm_tickernoti_icon_set(obj, icon);
930 }
931
932 /**
933  * Get the icon object of the tickernoti object
934  *
935  * @param obj The tickernotil object
936  * @return The icon object inside the tickernoti
937  * @deprecated use elm_object_content_part_get() instead with "icon" as part name
938  *
939  * @ingroup TickerNoti
940  */
941 EAPI Evas_Object *
942 elm_tickernoti_icon_get(const Evas_Object *obj)
943 {
944    return _elm_tickernoti_icon_get(obj);
945 }