[elm_slider.c] fix for Nabi/ S1 - 1271, regarding indicator drag sensitivity.
[framework/uifw/elementary.git] / src / lib / elm_tickernoti.c
1 #include <Elementary.h>
2 #include "elm_priv.h"
3
4 typedef struct _Widget_Data Widget_Data;
5
6 struct _Widget_Data
7 {
8    Evas_Object *win;
9    Evas_Object *edje_obj;
10    Evas_Object *icon;
11    Evas_Object *button;
12    Ecore_Event_Handler *rotation_event_handler;
13    const char *label;
14    int noti_height;
15    int angle;
16    Elm_Tickernoti_Mode mode;
17    Elm_Tickernoti_Orient orient;
18 };
19
20 static const char *widtype = NULL;
21 static void _del_hook(Evas_Object *obj);
22 static void _theme_hook(Evas_Object *obj);
23 static void _sizing_eval(Evas_Object *obj);
24 static void _update_geometry_on_rotation(Evas_Object *obj, int angle, int *x, int *y, int *w);
25
26 static const char SIG_CLICKED[] = "clicked";
27 static const char SIG_HIDDEN[] = "hide";
28 static const Evas_Smart_Cb_Description _signals[] = {
29        {SIG_CLICKED, ""},
30        {SIG_HIDDEN, ""},
31        {NULL, NULL}
32 };
33
34 static void
35 _del_job(void *data)
36 {
37    evas_object_del(data);
38 }
39
40 static void
41 _del_hook(Evas_Object *obj)
42 {
43    Evas_Object *parent;
44    Widget_Data *wd = elm_widget_data_get(obj);
45
46    if (!wd) return;
47    parent = elm_widget_parent_get(obj);
48    if (wd->rotation_event_handler)
49      ecore_event_handler_del(wd->rotation_event_handler);
50    if (wd->win) ecore_job_add(_del_job, parent);
51    evas_object_del(wd->edje_obj);
52    wd->edje_obj = NULL;
53    free(wd);
54 }
55
56 static void
57 _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
58 {
59    Widget_Data *wd = elm_widget_data_get(obj);
60
61    if (!wd) return;
62    edje_object_mirrored_set(wd->edje_obj, rtl);
63 }
64
65 static void
66 _theme_hook(Evas_Object *obj)
67 {
68    char *data_win_height = NULL;
69    Evas_Coord w;
70    Widget_Data *wd = elm_widget_data_get(obj);
71
72    if (!wd) return;
73    _elm_widget_mirrored_reload(obj);
74    _mirrored_set(obj, elm_widget_mirrored_get(obj));
75
76    _elm_theme_object_set(wd->win, wd->edje_obj, "tickernoti",
77                           "base", elm_widget_style_get(obj));
78
79    /* tickernoti detail height set */
80    data_win_height = (char *)edje_object_data_get(wd->edje_obj, "height");
81    if (data_win_height != NULL && elm_scale_get() > 0.0)
82      wd->noti_height = (int)(elm_scale_get() * atoi(data_win_height));
83
84    evas_object_geometry_get(wd->win, NULL, NULL, &w, NULL);
85    evas_object_resize(wd->win, w, wd->noti_height);
86
87    edje_object_signal_emit(wd->edje_obj, "effect,show", "elm");/*goes too late*/
88    edje_object_message_signal_process(wd->edje_obj);
89    edje_object_scale_set(wd->edje_obj, elm_widget_scale_get(obj) * _elm_config->scale);
90
91    _sizing_eval(obj);
92 }
93
94 static void
95 _sizing_eval(Evas_Object *obj)
96 {
97    Widget_Data *wd = elm_widget_data_get(obj);
98    Evas_Coord minw = -1, minh = -1;
99
100    if (!wd) return;
101    elm_coords_finger_size_adjust(1, &minw, 1, &minh);
102    edje_object_size_min_restricted_calc(wd->edje_obj, &minw, &minh, minw, minh);
103    evas_object_size_hint_min_set(obj, minw, minh);
104 }
105
106 #ifdef HAVE_ELEMENTARY_X
107 static void
108 _update_window_hints(Evas_Object *obj)
109 {
110    Ecore_X_Window xwin;
111    Ecore_X_Atom _notification_level_atom;
112    int level;
113    // elm_win_xwindow_get() must call after elm_win_alpha_set()
114    xwin = elm_win_xwindow_get(obj);
115
116    ecore_x_icccm_hints_set(xwin, 0, ECORE_X_WINDOW_STATE_HINT_NONE, 0, 0, 0, 0, 0);
117    ecore_x_netwm_window_type_set(xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION);
118    ecore_x_netwm_opacity_set(xwin, 0);
119    // Create atom for notification level
120    _notification_level_atom = ecore_x_atom_get("_E_ILLUME_NOTIFICATION_LEVEL");
121
122    // HIGH:150, NORMAL:100, LOW:50
123    level = 100;
124
125    // Set notification level of the window
126    ecore_x_window_prop_property_set(xwin, _notification_level_atom, ECORE_X_ATOM_CARDINAL, 32, &level, 1);
127 }
128 #endif
129
130 static void _hide_cb(void *data, Evas_Object *obj __UNUSED__,
131                              const char *emission __UNUSED__,
132                              const char *source __UNUSED__)
133 {
134    Widget_Data *wd = elm_widget_data_get(data);
135
136    if (!wd) return;
137    evas_object_hide(wd->win);
138    evas_object_smart_callback_call(data, SIG_HIDDEN, NULL);
139 }
140
141 static void _clicked_cb(void *data, Evas_Object *obj __UNUSED__,
142                              const char *emission __UNUSED__,
143                              const char *source __UNUSED__)
144 {
145    Widget_Data *wd = elm_widget_data_get(data);
146
147    if (!wd) return;
148    evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
149 }
150
151 static Evas_Object
152 *_create_window(Evas_Object *parent, const char *name)
153 {
154    Evas_Object *win;
155
156    win = elm_win_add(parent, name, ELM_WIN_BASIC);
157    elm_win_title_set(win, name);
158    elm_win_borderless_set(win, EINA_TRUE);
159    elm_win_autodel_set(win, EINA_TRUE);
160    elm_win_alpha_set(win, EINA_TRUE);
161    evas_object_size_hint_weight_set(win, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
162    evas_object_size_hint_align_set(win, EVAS_HINT_FILL, EVAS_HINT_FILL);
163
164 #ifdef HAVE_ELEMENTARY_X
165    // set top window
166    _update_window_hints(win);
167 #endif
168    return win;
169 }
170
171 static void
172 _win_rotated(Evas_Object *obj)
173 {
174    Widget_Data *wd = elm_widget_data_get(obj);
175    int x = 0, y = 0, w = 0, angle = 0;
176
177    if (!wd) return;
178    angle = elm_win_rotation_get(wd->win);
179    if (angle % 90) return;
180    angle %= 360;
181    if (angle < 0) angle += 360;
182    wd->angle = angle;
183    _update_geometry_on_rotation(obj, wd->angle, &x, &y, &w);
184    evas_object_move(wd->win, x, y);
185    evas_object_resize(wd->win, w, wd->noti_height);
186 #ifdef HAVE_ELEMENTARY_X
187    _update_window_hints(wd->win);
188 #endif
189 }
190
191 static Eina_Bool
192 _prop_change(void *data, int type __UNUSED__, void *event)
193 {
194 #ifdef HAVE_ELEMENTARY_X
195    Ecore_X_Event_Window_Property *ev;
196    Widget_Data *wd = elm_widget_data_get(data);
197
198    if (!wd) return ECORE_CALLBACK_PASS_ON;
199    ev = event;
200    if (ev->atom == ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE)
201      {
202         if (ev->win == elm_win_xwindow_get(wd->win))
203           {
204              _win_rotated(data);
205           }
206      }
207    return ECORE_CALLBACK_PASS_ON;
208 #endif
209 }
210
211 static void
212 _create_tickernoti(Evas_Object *obj)
213 {
214 #ifdef HAVE_ELEMENTARY_X
215    Evas_Coord w;
216 #endif
217    Widget_Data *wd = elm_widget_data_get(obj);
218    char *data_win_height = NULL;
219    Evas *e;
220
221    if (!wd) return;
222
223    evas_object_move(wd->win, 0, 0);
224    e = evas_object_evas_get(wd->win);
225
226    wd->edje_obj = edje_object_add(e);
227    _elm_theme_object_set(wd->win, wd->edje_obj, "tickernoti", "base", "default");
228    elm_win_resize_object_add(wd->win, wd->edje_obj);
229
230    // tickernoti height setting
231    data_win_height = (char *)edje_object_data_get(wd->edje_obj, "height");
232    if (data_win_height != NULL && elm_scale_get() > 0.0)
233      wd->noti_height = (int)(elm_scale_get() * atoi(data_win_height));
234
235 #ifdef HAVE_ELEMENTARY_X
236    ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, NULL);
237    evas_object_resize(wd->win, w, wd->noti_height);
238    wd->rotation_event_handler = ecore_event_handler_add(
239             ECORE_X_EVENT_WINDOW_PROPERTY, _prop_change, obj);
240 #endif
241
242    edje_object_signal_callback_add(wd->edje_obj, "request,hide", "", _hide_cb, obj);
243    edje_object_signal_callback_add(wd->edje_obj, "clicked", "", _clicked_cb, obj);
244    evas_object_show(wd->edje_obj);
245 }
246
247 static void
248 _disable_hook(Evas_Object *obj)
249 {
250    Widget_Data *wd = elm_widget_data_get(obj);
251
252    if (!wd) return;
253 //TODO: To stop the event in case of being disabled
254 }
255
256 static void
257 _show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
258       void *event_info __UNUSED__)
259 {
260    Widget_Data *wd = elm_widget_data_get(obj);
261    if (!wd) return;
262
263 #ifdef HAVE_ELEMENTARY_X
264    _update_window_hints(wd->win);
265 #endif
266    evas_object_show(wd->win);
267    edje_object_signal_emit(wd->edje_obj, "effect,show", "elm");
268    edje_object_message_signal_process(wd->edje_obj);
269 }
270
271 static void
272 _hide(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
273       void *event_info __UNUSED__)
274 {
275    Widget_Data *wd = elm_widget_data_get(obj);
276
277    if (!wd) return;
278    evas_object_hide(wd->win);
279 }
280
281 static void _tickernoti_hide_cb(void *data, Evas_Object *obj __UNUSED__,
282                                  void *event_info __UNUSED__)
283 {
284    Widget_Data *wd = data;
285
286    if (!wd) return;
287
288    edje_object_signal_emit(wd->edje_obj, "effect,hide", "elm");
289    edje_object_message_signal_process(wd->edje_obj);
290 }
291
292 static void
293 _update_geometry_on_rotation(Evas_Object *obj, int angle, int *x, int *y, int *w)
294 {
295    ELM_CHECK_WIDTYPE(obj, widtype);
296    Widget_Data *wd = elm_widget_data_get(obj);
297
298    if (!wd) return;
299
300 #ifdef HAVE_ELEMENTARY_X
301    Evas_Coord root_w, root_h;
302
303    /*
304    * manually calculate win_tickernoti_indi window position & size
305    *  - win_indi is not full size window
306    */
307    ecore_x_window_size_get(ecore_x_window_root_first_get(), &root_w, &root_h);
308    // rotate win
309    switch(angle)
310      {
311       case 90:
312          *w = root_h;
313          if (wd->orient == ELM_TICKERNOTI_ORIENT_BOTTOM)
314            *x = root_w - wd->noti_height;
315          break;
316       case 270:
317          *w = root_h;
318          if (!(wd->orient == ELM_TICKERNOTI_ORIENT_BOTTOM))
319            *x = root_w - wd->noti_height;
320          break;
321       case 180:
322          *w = root_w;
323          if (!wd->orient == ELM_TICKERNOTI_ORIENT_BOTTOM)
324            *y = root_h - wd->noti_height;
325          break;
326        case 0:
327       default:
328          *w = root_w;
329          if (wd->orient == ELM_TICKERNOTI_ORIENT_BOTTOM)
330            *y = root_h - wd->noti_height;
331          break;
332      }
333 #endif
334 }
335
336 static void
337 _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
338 {
339    Widget_Data *wd = elm_widget_data_get(obj);
340    Evas_Object *sub = event_info;
341    if (!wd) return;
342    if (sub == wd->icon)
343      wd->icon = NULL;
344    if (sub == wd->button)
345      wd->button = NULL;
346 }
347
348 static void
349 _elm_tickernoti_label_set(Evas_Object *obj, const char *part, const char *label)
350 {
351    ELM_CHECK_WIDTYPE(obj, widtype);
352    Widget_Data *wd = elm_widget_data_get(obj);
353
354    if (!wd) return;
355    if (part && strcmp(part, "default")) return;
356    eina_stringshare_replace(&wd->label, label);
357    edje_object_part_text_set(wd->edje_obj, "elm.text", wd->label);
358    _sizing_eval(obj);
359 }
360
361 const char *
362 _elm_tickernoti_label_get(const Evas_Object *obj, const char *part)
363 {
364    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
365    Widget_Data *wd = elm_widget_data_get(obj);
366
367    if (part && strcmp(part, "default")) return NULL;
368    if (!wd) return NULL;
369    return wd->label;
370 }
371
372 static void
373 _elm_tickernoti_icon_set(Evas_Object *obj, Evas_Object *icon)
374 {
375    ELM_CHECK_WIDTYPE(obj, widtype);
376    Widget_Data *wd = elm_widget_data_get(obj);
377
378    if (!wd) return;
379    if (wd->icon == icon) return;
380    if (wd->icon) evas_object_del(wd->icon);
381    wd->icon = icon;
382    if (icon)
383      {
384         elm_widget_sub_object_add(obj, icon);
385         edje_object_part_swallow(wd->edje_obj, "icon", icon);
386      }
387 }
388
389 static void
390 _elm_tickernoti_button_set(Evas_Object *obj, Evas_Object *button)
391 {
392    ELM_CHECK_WIDTYPE(obj, widtype);
393    Widget_Data *wd = elm_widget_data_get(obj);
394
395    if (!wd) return;
396    if (wd->button == button) return;
397    if (wd->button) evas_object_del(wd->button);
398    wd->button = button;
399    if (button)
400      {
401         elm_widget_sub_object_add(obj, button);
402         edje_object_part_swallow(wd->edje_obj, "button", button);
403         evas_object_smart_callback_add(wd->button, "clicked", _tickernoti_hide_cb, wd);
404      }
405 }
406
407 static void
408 _elm_tickernoti_content_part_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
409 {
410    ELM_CHECK_WIDTYPE(obj, widtype);
411    Widget_Data *wd = elm_widget_data_get(obj);
412
413    if (!wd || !part) return;
414    if (!part || !strcmp(part, "icon"))
415      {
416         _elm_tickernoti_icon_set(obj, content);
417         return;
418      }
419    else if (!strcmp(part, "button"))
420      {
421         _elm_tickernoti_button_set(obj, content);
422         return;
423      }
424 }
425
426 static Evas_Object *
427 _elm_tickernoti_icon_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->icon;
433 }
434
435 static Evas_Object *
436 _elm_tickernoti_button_get(const Evas_Object *obj)
437 {
438    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
439    Widget_Data *wd = elm_widget_data_get(obj);
440    if (!wd) return NULL;
441    return wd->button;
442 }
443
444 static Evas_Object *
445 _elm_tickernoti_content_part_get_hook(Evas_Object *obj, const char *part)
446 {
447    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
448    Widget_Data *wd = elm_widget_data_get(obj);
449
450    if (!wd || !part) return NULL;
451    if (!part || !strcmp(part, "icon"))
452      return _elm_tickernoti_icon_get(obj);
453    else if (!strcmp(part, "button"))
454      return _elm_tickernoti_button_get(obj);
455    return NULL;
456 }
457
458 static Evas_Object *
459 _elm_tickernoti_icon_unset(Evas_Object *obj)
460 {
461    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
462    Evas_Object *icon;
463    Widget_Data *wd = elm_widget_data_get(obj);
464
465    if (!wd || !wd->icon) return NULL;
466    icon = wd->icon;
467    elm_widget_sub_object_del(obj, wd->icon);
468    edje_object_part_unswallow(wd->edje_obj, icon);
469    wd->icon = NULL;
470    return icon;
471 }
472
473 static Evas_Object *
474 _elm_tickernoti_button_unset(Evas_Object *obj)
475 {
476    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
477    Evas_Object *button;
478    Widget_Data *wd = elm_widget_data_get(obj);
479
480    if (!wd || !wd->button) return NULL;
481    button = wd->button;
482    elm_widget_sub_object_del(obj, wd->button);
483    edje_object_part_unswallow(wd->edje_obj, button);
484    wd->button = NULL;
485    return button;
486 }
487
488 static Evas_Object *
489 _elm_tickernoti_content_part_unset_hook(Evas_Object *obj, const char *part)
490 {
491    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
492    Widget_Data *wd = elm_widget_data_get(obj);
493
494    if (!wd || !part) return NULL;
495    if (!strcmp(part, "icon"))
496      return _elm_tickernoti_icon_unset(obj);
497    else if (!strcmp(part, "button"))
498      return _elm_tickernoti_button_unset(obj);
499    return NULL;
500 }
501
502 EAPI Evas_Object *
503 elm_tickernoti_add(Evas_Object *parent)
504 {
505    Evas_Object *obj;
506    Evas *e;
507    Widget_Data *wd;
508
509    wd = ELM_NEW(Widget_Data);
510    wd->win = _create_window(parent, "noti-window");
511
512    e = evas_object_evas_get(wd->win);
513    obj = elm_widget_add(e);
514    ELM_SET_WIDTYPE(widtype, "tickernoti");
515    elm_widget_type_set(obj, widtype);
516    elm_widget_sub_object_add(wd->win, obj);
517    elm_widget_data_set(obj, wd);
518    elm_widget_del_hook_set(obj, _del_hook);
519    elm_widget_theme_hook_set(obj, _theme_hook);
520    elm_widget_can_focus_set(obj, 0);
521    elm_widget_disable_hook_set(obj, _disable_hook);
522
523    wd->orient = ELM_TICKERNOTI_ORIENT_TOP;
524
525    _create_tickernoti(obj);
526    elm_widget_text_set_hook_set(obj, _elm_tickernoti_label_set);
527    elm_widget_text_get_hook_set(obj, _elm_tickernoti_label_get);
528    elm_widget_content_set_hook_set(obj, _elm_tickernoti_content_part_set_hook);
529    elm_widget_content_get_hook_set(obj, _elm_tickernoti_content_part_get_hook);
530    elm_widget_content_unset_hook_set(obj, _elm_tickernoti_content_part_unset_hook);
531    evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, NULL);
532
533    evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, NULL);
534    evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, NULL);
535    evas_object_smart_callbacks_descriptions_set(obj, _signals);
536    return obj;
537 }
538
539 EAPI int
540 elm_tickernoti_rotation_get(const Evas_Object *obj)
541 {
542    ELM_CHECK_WIDTYPE(obj, widtype) -1;
543    Widget_Data *wd = elm_widget_data_get(obj);
544    if (!wd) return -1;
545    return wd->angle;
546 }
547
548 EAPI void
549 elm_tickernoti_rotation_set(Evas_Object *obj, int angle)
550 {
551    ELM_CHECK_WIDTYPE(obj, widtype);
552    Widget_Data *wd = elm_widget_data_get(obj);
553
554    if (!wd) return;
555    if (angle % 90) return;
556    angle %= 360;
557    if (angle < 0) angle += 360;
558    wd->angle = angle;
559    elm_win_rotation_set(wd->win, angle);
560    _win_rotated(obj);
561 }
562
563 EAPI void
564 elm_tickernoti_orient_set(Evas_Object *obj, Elm_Tickernoti_Orient orient)
565 {
566    ELM_CHECK_WIDTYPE(obj, widtype);
567
568 #ifdef HAVE_ELEMENTARY_X
569    Evas_Coord root_w, root_h;
570 #endif
571    Widget_Data *wd = elm_widget_data_get(obj);
572
573    if (!wd) return;
574    if (orient >= ELM_TICKERNOTI_ORIENT_LAST) return;
575
576 #ifdef HAVE_ELEMENTARY_X
577    ecore_x_window_size_get(ecore_x_window_root_first_get(), &root_w, &root_h);
578 #endif
579
580    switch(orient) {
581       case ELM_TICKERNOTI_ORIENT_BOTTOM:
582 #ifdef HAVE_ELEMENTARY_X
583          evas_object_move(wd->win, 0, root_h - wd->noti_height);
584 #endif
585          wd->orient = ELM_TICKERNOTI_ORIENT_BOTTOM;
586          break;
587       case ELM_TICKERNOTI_ORIENT_TOP:
588       default:
589 #ifdef HAVE_ELEMENTARY_X
590          evas_object_move(wd->win, 0, 0);
591 #endif
592          wd->orient = ELM_TICKERNOTI_ORIENT_TOP;
593          break;
594    }
595 #ifdef HAVE_ELEMENTARY_X
596    _update_window_hints(wd->win);
597 #endif
598 }
599
600 EAPI Elm_Tickernoti_Orient
601 elm_tickernoti_orient_get(const Evas_Object *obj)
602 {
603    ELM_CHECK_WIDTYPE(obj, widtype) -1;
604    Widget_Data *wd = elm_widget_data_get(obj);
605
606    if (!wd) return ELM_TICKERNOTI_ORIENT_LAST;
607    return wd->orient;
608 }
609
610 EAPI Evas_Object *
611 elm_tickernoti_win_get(const Evas_Object *obj)
612 {
613    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
614    Widget_Data *wd = elm_widget_data_get(obj);
615    if (!wd) return NULL;
616    return wd->win;
617 }
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 EAPI const char *
626 elm_tickernoti_detailview_label_get(const Evas_Object *obj)
627 {
628    return _elm_tickernoti_label_get(obj, NULL);
629 }
630
631 EAPI void
632 elm_tickernoti_detailview_button_set(Evas_Object *obj, Evas_Object *button)
633 {
634    _elm_tickernoti_button_set(obj, button);
635 }
636
637 EAPI Evas_Object *
638 elm_tickernoti_detailview_button_get(const Evas_Object *obj)
639 {
640    return _elm_tickernoti_button_get(obj);
641 }
642
643 EAPI void
644 elm_tickernoti_detailview_icon_set(Evas_Object *obj, Evas_Object *icon)
645 {
646    _elm_tickernoti_icon_set(obj, icon);
647 }
648
649 EAPI Evas_Object *
650 elm_tickernoti_detailview_icon_get(const Evas_Object *obj)
651 {
652    return _elm_tickernoti_icon_get(obj);
653 }
654
655 EAPI Elm_Tickernoti_Mode
656 elm_tickernoti_mode_get(const Evas_Object *obj)
657 {
658    ELM_CHECK_WIDTYPE(obj, widtype) -1;
659    Widget_Data *wd = elm_widget_data_get(obj);
660    if (!wd) return -1;
661    return wd->mode;
662 }
663
664 EAPI void
665 elm_tickernoti_mode_set(Evas_Object *obj, Elm_Tickernoti_Mode mode)
666 {
667    ELM_CHECK_WIDTYPE(obj, widtype);
668    Widget_Data *wd = elm_widget_data_get(obj);
669    if (!wd) return;
670
671    switch(mode){
672       case ELM_TICKERNOTI_DEFAULT:
673       case ELM_TICKERNOTI_DETAILVIEW:
674          wd->mode = mode;
675          break;
676       default:
677          break;
678    }
679 }
680
681 EAPI Evas_Object *
682 elm_tickernoti_detailview_get(const Evas_Object *obj)
683 {
684    return elm_tickernoti_win_get(obj);
685 }
686
687 EAPI void
688 elm_tickernoti_orientation_set(Evas_Object *obj, Elm_Tickernoti_Orient orient)
689 {
690    elm_tickernoti_orient_set(obj, orient);
691 }
692
693 EAPI Elm_Tickernoti_Orient
694 elm_tickernoti_orientation_get(const Evas_Object *obj)
695 {
696    return elm_tickernoti_orient_get(obj);
697 }
698
699 EAPI void
700 elm_tickernoti_label_set(Evas_Object *obj, const char *label)
701 {
702    _elm_tickernoti_label_set(obj, NULL, label);
703 }
704
705 EAPI const char *
706 elm_tickernoti_label_get(const Evas_Object *obj)
707 {
708    return _elm_tickernoti_label_get(obj, NULL);
709 }
710
711 EAPI void
712 elm_tickernoti_button_set(Evas_Object *obj, Evas_Object *button)
713 {
714    _elm_tickernoti_button_set(obj, button);
715 }
716
717 EAPI Evas_Object *
718 elm_tickernoti_button_get(const Evas_Object *obj)
719 {
720    return _elm_tickernoti_button_get(obj);
721 }
722
723 EAPI void
724 elm_tickernoti_icon_set(Evas_Object *obj, Evas_Object *icon)
725 {
726    _elm_tickernoti_icon_set(obj, icon);
727 }
728
729 EAPI Evas_Object *
730 elm_tickernoti_icon_get(const Evas_Object *obj)
731 {
732    return _elm_tickernoti_icon_get(obj);
733 }