b37e4946987f6bb1b03e8f12ee3f78dc58bb7ae7
[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    while (angle < 0) angle += 360;
194    while (angle >= 360) angle -= 360;
195    if (angle%90 != 0) return;
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    * manual 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 _elm_tickernoti_label_set(Evas_Object *obj, const char *part, const char *label)
352 {
353    ELM_CHECK_WIDTYPE(obj, widtype);
354    Widget_Data *wd = elm_widget_data_get(obj);
355
356    if (!wd) return;
357    if (part && strcmp(part, "default")) return;
358    eina_stringshare_replace(&wd->label, label);
359    edje_object_part_text_set(wd->edje_obj, "elm.text", wd->label);
360    _sizing_eval(obj);
361 }
362
363 const char *
364 _elm_tickernoti_label_get(const Evas_Object *obj, const char *part)
365 {
366    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
367    Widget_Data *wd = elm_widget_data_get(obj);
368
369    if (part && strcmp(part, "default")) return NULL;
370    if (!wd) return NULL;
371    return wd->label;
372 }
373
374 static void
375 _elm_tickernoti_icon_set(Evas_Object *obj, Evas_Object *icon)
376 {
377    ELM_CHECK_WIDTYPE(obj, widtype);
378    Widget_Data *wd = elm_widget_data_get(obj);
379
380    if (!wd) return;
381    if (!icon) return;
382    edje_object_part_swallow(wd->edje_obj, "icon", icon);
383    wd->icon = icon;
384 }
385
386 static void
387 _elm_tickernoti_button_set(Evas_Object *obj, Evas_Object *button)
388 {
389    ELM_CHECK_WIDTYPE(obj, widtype);
390    Widget_Data *wd = elm_widget_data_get(obj);
391    if (!wd) return;
392    if (!button) return;
393    edje_object_part_swallow(wd->edje_obj, "button", button);
394    wd->button = button;
395    evas_object_smart_callback_add(wd->button, "clicked", _tickernoti_hide_cb, wd);
396 }
397
398 static void
399 _elm_tickernoti_content_part_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
400 {
401    ELM_CHECK_WIDTYPE(obj, widtype);
402    Widget_Data *wd = elm_widget_data_get(obj);
403
404    if (!wd || !part) return;
405    if (!part || !strcmp(part, "icon"))
406      {
407         _elm_tickernoti_icon_set(obj, content);
408         return;
409      }
410    else if (!strcmp(part, "button"))
411      {
412         _elm_tickernoti_button_set(obj, content);
413         return;
414      }
415 }
416
417 static Evas_Object *
418 _elm_tickernoti_icon_get(const Evas_Object *obj)
419 {
420    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
421    Widget_Data *wd = elm_widget_data_get(obj);
422    if (!wd) return NULL;
423    return wd->icon;
424 }
425
426 static Evas_Object *
427 _elm_tickernoti_button_get(const Evas_Object *obj)
428 {
429    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
430    Widget_Data *wd = elm_widget_data_get(obj);
431    if (!wd) return NULL;
432    return wd->button;
433 }
434
435 static Evas_Object *
436 _elm_tickernoti_content_part_get_hook(Evas_Object *obj, const char *part)
437 {
438    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
439    Widget_Data *wd = elm_widget_data_get(obj);
440
441    if (!wd || !part) return NULL;
442    if (!part || !strcmp(part, "icon"))
443      return _elm_tickernoti_icon_get(obj);
444    else if (!strcmp(part, "button"))
445      return _elm_tickernoti_button_get(obj);
446    return NULL;
447 }
448
449 /**
450  * Add a tickernoti object to @p parent
451  *
452  * @param parent The parent object
453  *
454  * @return The tickernoti object, or NULL upon failure
455  *
456  * @ingroup TickerNoti
457  */
458 EAPI Evas_Object *
459 elm_tickernoti_add(Evas_Object *parent)
460 {
461    Evas_Object *obj;
462    Evas *e;
463    Widget_Data *wd;
464
465    wd = ELM_NEW(Widget_Data);
466    wd->win = _create_window(parent, "noti-window");
467
468    e = evas_object_evas_get(wd->win);
469    obj = elm_widget_add(e);
470    ELM_SET_WIDTYPE(widtype, "tickernoti");
471    elm_widget_type_set(obj, widtype);
472    elm_widget_sub_object_add(wd->win, obj);
473    elm_widget_data_set(obj, wd);
474    elm_widget_del_hook_set(obj, _del_hook);
475    elm_widget_theme_hook_set(obj, _theme_hook);
476    elm_widget_can_focus_set(obj, 0);
477    elm_widget_disable_hook_set(obj, _disable_hook);
478
479    wd->orient = ELM_TICKERNOTI_ORIENT_TOP;
480
481    _create_tickernoti(obj);
482    elm_widget_text_set_hook_set(obj, _elm_tickernoti_label_set);
483    elm_widget_text_get_hook_set(obj, _elm_tickernoti_label_get);
484    elm_widget_content_set_hook_set(obj, _elm_tickernoti_content_part_set_hook);
485    elm_widget_content_get_hook_set(obj, _elm_tickernoti_content_part_get_hook);
486
487    evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, NULL);
488    evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, NULL);
489    evas_object_smart_callbacks_descriptions_set(obj, _signals);
490    return obj;
491 }
492
493 /**
494  * Get the rotation of tickernoti object
495  *
496  * @param obj The tickernotil object
497  * @return The rotation angle
498  * @ingroup TickerNoti
499  */
500 EAPI int
501 elm_tickernoti_rotation_get(const Evas_Object *obj)
502 {
503    ELM_CHECK_WIDTYPE(obj, widtype) -1;
504    Widget_Data *wd = elm_widget_data_get(obj);
505    if (!wd) return -1;
506    return wd->angle;
507 }
508
509 /**
510  * Set the rotation angle for the tickernoti object
511  *
512  * @param obj The tickernoti object
513  * @param angle The rotation angle(in degree) will be used on the tickernoti object
514  * @ingroup TickerNoti
515  */
516 EAPI void
517 elm_tickernoti_rotation_set(Evas_Object *obj, int angle)
518 {
519    ELM_CHECK_WIDTYPE(obj, widtype);
520    Widget_Data *wd = elm_widget_data_get(obj);
521
522    if (!wd) return;
523    if (angle%90 != 0) return;
524
525    while (angle < 0) angle += 360;
526    while (angle >= 360) angle -= 360;
527    elm_win_rotation_with_resize_set (wd->win, angle);
528 }
529
530 /**
531  * Set the orientation of the tickernoti object
532  *
533  * @param obj The tickernoti object
534  * @param orient The orientation of tickernoti object
535  * @ingroup TickerNoti
536  */
537 EAPI void
538 elm_tickernoti_orient_set(Evas_Object *obj, Elm_Tickernoti_Orient orient)
539 {
540    ELM_CHECK_WIDTYPE(obj, widtype);
541
542 #ifdef HAVE_ELEMENTARY_X
543    Evas_Coord root_w, root_h;
544 #endif
545    Widget_Data *wd = elm_widget_data_get(obj);
546
547    if (!wd) return;
548    if (orient >= ELM_TICKERNOTI_ORIENT_LAST) return;
549
550 #ifdef HAVE_ELEMENTARY_X
551    ecore_x_window_size_get(ecore_x_window_root_first_get(), &root_w, &root_h);
552 #endif
553
554    switch(orient) {
555       case ELM_TICKERNOTI_ORIENT_BOTTOM:
556 #ifdef HAVE_ELEMENTARY_X
557          evas_object_move(wd->win, 0, root_h - wd->noti_height);
558 #endif
559          wd->orient = ELM_TICKERNOTI_ORIENT_BOTTOM;
560          break;
561       case ELM_TICKERNOTI_ORIENT_TOP:
562       default:
563 #ifdef HAVE_ELEMENTARY_X
564          evas_object_move(wd->win, 0, 0);
565 #endif
566          wd->orient = ELM_TICKERNOTI_ORIENT_TOP;
567          break;
568    }
569 #ifdef HAVE_ELEMENTARY_X
570    _update_window_hints(wd->win);
571 #endif
572 }
573
574 /**
575  * Get the orientation of the tickernoti object
576  *
577  * @param obj The tickernotil object
578  * @return The orientation of tickernotil object
579  *
580  * @ingroup TickerNoti
581  */
582 EAPI Elm_Tickernoti_Orient
583 elm_tickernoti_orient_get(const Evas_Object *obj)
584 {
585    ELM_CHECK_WIDTYPE(obj, widtype) -1;
586    Widget_Data *wd = elm_widget_data_get(obj);
587
588    if (!wd) return ELM_TICKERNOTI_ORIENT_LAST;
589    return wd->orient;
590 }
591
592 /**
593  * Get the view window(elm_win) on the tickernoti object
594  *
595  * @param obj The tickernotil object
596  * @return internal view window(elm_win) object
597  *
598  * @ingroup TickerNoti
599  */
600 EAPI Evas_Object *
601 elm_tickernoti_win_get(const Evas_Object *obj)
602 {
603    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
604    Widget_Data *wd = elm_widget_data_get(obj);
605    if (!wd) return NULL;
606    return wd->win;
607 }
608
609 // ################### Below APIs are going to be removed. ###########################
610 /**
611  * Set the detail label on the tickernoti object
612  *
613  * @param obj The tickernoti object
614  * @param label The label will be used on the tickernoti object
615  * @deprecated use elm_object_text_set() instead
616  *
617  * @ingroup TickerNoti
618  */
619 EAPI void
620 elm_tickernoti_detailview_label_set(Evas_Object *obj, const char *label)
621 {
622    _elm_tickernoti_label_set(obj, NULL, label);
623 }
624
625 /**
626  * Get the detail label used on the tickernoti object
627  *
628  * @param obj The tickernotil object
629  * @return The string inside the label
630  * @deprecated use elm_object_text_get() instead
631  *
632  * @ingroup TickerNoti
633  */
634 EAPI const char *
635 elm_tickernoti_detailview_label_get(const Evas_Object *obj)
636 {
637    return _elm_tickernoti_label_get(obj, NULL);
638 }
639
640 /**
641  * Set the button object used on the tickernoti object
642  *
643  * @param obj The tickernotil object
644  * @param button The button object will be used on the tickernoti object
645  * @deprecated use elm_object_content_part_set() instead with "icon" as part name
646  *
647  * @ingroup TickerNoti
648  */
649 EAPI void
650 elm_tickernoti_detailview_button_set(Evas_Object *obj, Evas_Object *button)
651 {
652    _elm_tickernoti_button_set(obj, button);
653 }
654
655
656 /**
657  * Get the button object used on the tickernoti object
658  *
659  * @param obj The tickernotil object
660  * @return The button object inside the tickernoti
661  * @deprecated use elm_object_content_part_get() instead with "button" as part name
662  *
663  * @ingroup TickerNoti
664  */
665 EAPI Evas_Object *
666 elm_tickernoti_detailview_button_get(const Evas_Object *obj)
667 {
668    return _elm_tickernoti_button_get(obj);
669 }
670
671 /**
672  * Set the detail icon object used on the tickernoti object
673  *
674  * @param obj The tickernotil object
675  * @param icon The icon object will be used on the tickernoti object
676  * @deprecated use elm_object_content_part_set() instead with "icon" as part name
677  *
678  * @ingroup TickerNoti
679  */
680 EAPI void
681 elm_tickernoti_detailview_icon_set(Evas_Object *obj, Evas_Object *icon)
682 {
683    _elm_tickernoti_icon_set(obj, icon);
684 }
685
686 /**
687  * Get the detail icon object used on the tickernoti object
688  *
689  * @param obj The tickernotil object
690  * @return The icon object inside the tickernoti
691  * @deprecated use elm_object_content_part_get() instead with "icon" as part name
692  *
693  * @ingroup TickerNoti
694  */
695 EAPI Evas_Object *
696 elm_tickernoti_detailview_icon_get(const Evas_Object *obj)
697 {
698    return _elm_tickernoti_icon_get(obj);
699 }
700
701 /**
702  * Get the view mode on the tickernoti object
703  *
704  * @param obj The tickernotil object
705  * @return The view mode
706  * @deprecated removed as now styles are used instead
707  *
708  * @ingroup TickerNoti
709  */
710 EAPI Elm_Tickernoti_Mode
711 elm_tickernoti_mode_get(const Evas_Object *obj)
712 {
713    ELM_CHECK_WIDTYPE(obj, widtype) -1;
714    Widget_Data *wd = elm_widget_data_get(obj);
715    if (!wd) return -1;
716    return wd->mode;
717 }
718
719 /**
720  * Set the view mode used on the tickernoti object
721  *
722  * @param obj The tickernotil object
723  * @param mode The view mode will be used on the tickernoti object
724  * @deprecated removed as now styles are used instead
725  *
726  * @ingroup TickerNoti
727  */
728 EAPI void
729 elm_tickernoti_mode_set(Evas_Object *obj, Elm_Tickernoti_Mode mode)
730 {
731    ELM_CHECK_WIDTYPE(obj, widtype);
732    Widget_Data *wd = elm_widget_data_get(obj);
733    if (!wd) return;
734
735    switch(mode){
736       case ELM_TICKERNOTI_DEFAULT:
737       case ELM_TICKERNOTI_DETAILVIEW:
738          wd->mode = mode;
739          break;
740       default:
741          break;
742    }
743 }
744
745 /**
746  * Get the detail view window(elm_win) on the tickernoti object
747  *
748  * @param obj The tickernotil object
749  * @return detail view window(elm_win) object
750  * @ingroup TickerNoti
751  */
752 EAPI Evas_Object *
753 elm_tickernoti_detailview_get(const Evas_Object *obj)
754 {
755    return elm_tickernoti_win_get(obj);
756 }
757
758 /**
759  * Set the orientation of the tickernoti object
760  *
761  * @param obj The tickernoti object
762  * @param orient The orientation of tickernoti object
763  * @deprecated use elm_tickernoti_orient_set() instead
764  *
765  * @ingroup TickerNoti
766  */
767 EAPI void
768 elm_tickernoti_orientation_set(Evas_Object *obj, Elm_Tickernoti_Orient orient)
769 {
770    elm_tickernoti_orient_set(obj, orient);
771 }
772
773 /**
774  * Get the orientation of the tickernoti object
775  *
776  * @param obj The tickernotil object
777  * @return The orientation of tickernotil object
778  * @deprecated use elm_tickernoti_orient_get() instead
779  *
780  * @ingroup TickerNoti
781  */
782 EAPI Elm_Tickernoti_Orient
783 elm_tickernoti_orientation_get(const Evas_Object *obj)
784 {
785    return elm_tickernoti_orient_get(obj);
786 }
787
788 /**
789  * Set the label on the tickernoti object
790  *
791  * @param obj The tickernoti object
792  * @param label The label will be used on the tickernoti object
793  * @deprecated use elm_object_text_get()
794  *
795  * @ingroup TickerNoti
796  */
797 EAPI void
798 elm_tickernoti_label_set(Evas_Object *obj, const char *label)
799 {
800    _elm_tickernoti_label_set(obj, NULL, label);
801 }
802
803 /**
804  * Get the label used on the tickernoti object
805  *
806  * @param obj The tickernotil object
807  * @return The string inside the label
808  * @deprecated use elm_object_text_get() instead
809  *
810  * @ingroup TickerNoti
811  */
812 EAPI const char *
813 elm_tickernoti_label_get(const Evas_Object *obj)
814 {
815    return _elm_tickernoti_label_get(obj, NULL);
816 }
817
818 /**
819  * Set the action button object used on the tickernoti object
820  *
821  * @param obj The tickernotil object
822  * @param button The button object will be used on the tickernoti object
823  * @deprecated use elm_object_content_part_set() instead with "button" as part name
824  *
825  * @ingroup TickerNoti
826  */
827 EAPI void
828 elm_tickernoti_button_set(Evas_Object *obj, Evas_Object *button)
829 {
830    _elm_tickernoti_button_set(obj, button);
831 }
832
833 /**
834  * Get the action button object used on the tickernoti object
835  *
836  * @param obj The tickernotil object
837  * @return The button object inside the tickernoti
838  * @deprecated use elm_object_content_part_get() instead with "button" as part name
839  *
840  * @ingroup TickerNoti
841  */
842 EAPI Evas_Object *
843 elm_tickernoti_button_get(const Evas_Object *obj)
844 {
845    return _elm_tickernoti_button_get(obj);
846 }
847
848 /**
849  * Set the icon object of the tickernoti object
850  *
851  * @param obj The tickernotil object
852  * @param icon The icon object will be used on the tickernoti object
853  * @deprecated use elm_object_content_part_set() instead with "icon" as part name
854  *
855  * @ingroup TickerNoti
856  */
857 EAPI void
858 elm_tickernoti_icon_set(Evas_Object *obj, Evas_Object *icon)
859 {
860    _elm_tickernoti_icon_set(obj, icon);
861 }
862
863 /**
864  * Get the icon object of the tickernoti object
865  *
866  * @param obj The tickernotil object
867  * @return The icon object inside the tickernoti
868  * @deprecated use elm_object_content_part_get() instead with "icon" as part name
869  *
870  * @ingroup TickerNoti
871  */
872 EAPI Evas_Object *
873 elm_tickernoti_icon_get(const Evas_Object *obj)
874 {
875    return _elm_tickernoti_icon_get(obj);
876 }