mapbuf - Fix the mapbuf to resize the contents(smart obj) correctly.
[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_size_hint_min_set(wd->edje_obj, w, wd->noti_height);
238    evas_object_resize(wd->win, w, wd->noti_height);
239    wd->rotation_event_handler = ecore_event_handler_add(
240             ECORE_X_EVENT_WINDOW_PROPERTY, _prop_change, obj);
241 #endif
242
243    edje_object_signal_callback_add(wd->edje_obj, "request,hide", "", _hide_cb, obj);
244    edje_object_signal_callback_add(wd->edje_obj, "clicked", "", _clicked_cb, obj);
245    evas_object_show(wd->edje_obj);
246 }
247
248 static void
249 _disable_hook(Evas_Object *obj)
250 {
251    Widget_Data *wd = elm_widget_data_get(obj);
252
253    if (!wd) return;
254 //TODO: To stop the event in case of being disabled
255 }
256
257 static void
258 _show(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
259       void *event_info __UNUSED__)
260 {
261    Widget_Data *wd = elm_widget_data_get(obj);
262    if (!wd) return;
263
264 #ifdef HAVE_ELEMENTARY_X
265    _update_window_hints(wd->win);
266 #endif
267    evas_object_show(wd->win);
268    edje_object_signal_emit(wd->edje_obj, "effect,show", "elm");
269    edje_object_message_signal_process(wd->edje_obj);
270 }
271
272 static void
273 _hide(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj,
274       void *event_info __UNUSED__)
275 {
276    Widget_Data *wd = elm_widget_data_get(obj);
277
278    if (!wd) return;
279    evas_object_hide(wd->win);
280 }
281
282 static void _tickernoti_hide_cb(void *data, Evas_Object *obj __UNUSED__,
283                                  void *event_info __UNUSED__)
284 {
285    Widget_Data *wd = data;
286
287    if (!wd) return;
288
289    edje_object_signal_emit(wd->edje_obj, "effect,hide", "elm");
290    edje_object_message_signal_process(wd->edje_obj);
291 }
292
293 static void
294 _update_geometry_on_rotation(Evas_Object *obj, int angle, int *x, int *y, int *w)
295 {
296    ELM_CHECK_WIDTYPE(obj, widtype);
297    Widget_Data *wd = elm_widget_data_get(obj);
298
299    if (!wd) return;
300
301 #ifdef HAVE_ELEMENTARY_X
302    Evas_Coord root_w, root_h;
303
304    /*
305    * manually calculate win_tickernoti_indi window position & size
306    *  - win_indi is not full size window
307    */
308    ecore_x_window_size_get(ecore_x_window_root_first_get(), &root_w, &root_h);
309    // rotate win
310    switch(angle)
311      {
312       case 90:
313          *w = root_h;
314          if (wd->orient == ELM_TICKERNOTI_ORIENT_BOTTOM)
315            *x = root_w - wd->noti_height;
316          break;
317       case 270:
318          *w = root_h;
319          if (!(wd->orient == ELM_TICKERNOTI_ORIENT_BOTTOM))
320            *x = root_w - wd->noti_height;
321          break;
322       case 180:
323          *w = root_w;
324          if (!wd->orient == ELM_TICKERNOTI_ORIENT_BOTTOM)
325            *y = root_h - wd->noti_height;
326          break;
327        case 0:
328       default:
329          *w = root_w;
330          if (wd->orient == ELM_TICKERNOTI_ORIENT_BOTTOM)
331            *y = root_h - wd->noti_height;
332          break;
333      }
334 #endif
335 }
336
337 static void
338 _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
339 {
340    Widget_Data *wd = elm_widget_data_get(obj);
341    Evas_Object *sub = event_info;
342    if (!wd) return;
343    if (sub == wd->icon)
344      wd->icon = NULL;
345    if (sub == wd->button)
346      wd->button = NULL;
347 }
348
349 static void
350 _elm_tickernoti_label_set(Evas_Object *obj, const char *part, const char *label)
351 {
352    ELM_CHECK_WIDTYPE(obj, widtype);
353    Widget_Data *wd = elm_widget_data_get(obj);
354
355    if (!wd) return;
356    if (part && strcmp(part, "default")) return;
357    eina_stringshare_replace(&wd->label, label);
358    edje_object_part_text_set(wd->edje_obj, "elm.text", wd->label);
359    _sizing_eval(obj);
360 }
361
362 const char *
363 _elm_tickernoti_label_get(const Evas_Object *obj, const char *part)
364 {
365    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
366    Widget_Data *wd = elm_widget_data_get(obj);
367
368    if (part && strcmp(part, "default")) return NULL;
369    if (!wd) return NULL;
370    return wd->label;
371 }
372
373 static void
374 _elm_tickernoti_icon_set(Evas_Object *obj, Evas_Object *icon)
375 {
376    ELM_CHECK_WIDTYPE(obj, widtype);
377    Widget_Data *wd = elm_widget_data_get(obj);
378
379    if (!wd) return;
380    if (wd->icon == icon) return;
381    if (wd->icon) evas_object_del(wd->icon);
382    wd->icon = icon;
383    if (icon)
384      {
385         elm_widget_sub_object_add(obj, icon);
386         edje_object_part_swallow(wd->edje_obj, "icon", icon);
387      }
388 }
389
390 static void
391 _elm_tickernoti_button_set(Evas_Object *obj, Evas_Object *button)
392 {
393    ELM_CHECK_WIDTYPE(obj, widtype);
394    Widget_Data *wd = elm_widget_data_get(obj);
395
396    if (!wd) return;
397    if (wd->button == button) return;
398    if (wd->button) evas_object_del(wd->button);
399    wd->button = button;
400    if (button)
401      {
402         elm_widget_sub_object_add(obj, button);
403         edje_object_part_swallow(wd->edje_obj, "button", button);
404         evas_object_smart_callback_add(wd->button, "clicked", _tickernoti_hide_cb, wd);
405      }
406 }
407
408 static void
409 _elm_tickernoti_content_part_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
410 {
411    ELM_CHECK_WIDTYPE(obj, widtype);
412    Widget_Data *wd = elm_widget_data_get(obj);
413
414    if (!wd || !part) return;
415    if (!part || !strcmp(part, "icon"))
416      {
417         _elm_tickernoti_icon_set(obj, content);
418         return;
419      }
420    else if (!strcmp(part, "button"))
421      {
422         _elm_tickernoti_button_set(obj, content);
423         return;
424      }
425 }
426
427 static Evas_Object *
428 _elm_tickernoti_icon_get(const Evas_Object *obj)
429 {
430    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
431    Widget_Data *wd = elm_widget_data_get(obj);
432    if (!wd) return NULL;
433    return wd->icon;
434 }
435
436 static Evas_Object *
437 _elm_tickernoti_button_get(const Evas_Object *obj)
438 {
439    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
440    Widget_Data *wd = elm_widget_data_get(obj);
441    if (!wd) return NULL;
442    return wd->button;
443 }
444
445 static Evas_Object *
446 _elm_tickernoti_content_part_get_hook(Evas_Object *obj, const char *part)
447 {
448    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
449    Widget_Data *wd = elm_widget_data_get(obj);
450
451    if (!wd || !part) return NULL;
452    if (!part || !strcmp(part, "icon"))
453      return _elm_tickernoti_icon_get(obj);
454    else if (!strcmp(part, "button"))
455      return _elm_tickernoti_button_get(obj);
456    return NULL;
457 }
458
459 static Evas_Object *
460 _elm_tickernoti_icon_unset(Evas_Object *obj)
461 {
462    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
463    Evas_Object *icon;
464    Widget_Data *wd = elm_widget_data_get(obj);
465
466    if (!wd || !wd->icon) return NULL;
467    icon = wd->icon;
468    elm_widget_sub_object_del(obj, wd->icon);
469    edje_object_part_unswallow(wd->edje_obj, icon);
470    wd->icon = NULL;
471    return icon;
472 }
473
474 static Evas_Object *
475 _elm_tickernoti_button_unset(Evas_Object *obj)
476 {
477    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
478    Evas_Object *button;
479    Widget_Data *wd = elm_widget_data_get(obj);
480
481    if (!wd || !wd->button) return NULL;
482    button = wd->button;
483    elm_widget_sub_object_del(obj, wd->button);
484    edje_object_part_unswallow(wd->edje_obj, button);
485    wd->button = NULL;
486    return button;
487 }
488
489 static Evas_Object *
490 _elm_tickernoti_content_part_unset_hook(Evas_Object *obj, const char *part)
491 {
492    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
493    Widget_Data *wd = elm_widget_data_get(obj);
494
495    if (!wd || !part) return NULL;
496    if (!strcmp(part, "icon"))
497      return _elm_tickernoti_icon_unset(obj);
498    else if (!strcmp(part, "button"))
499      return _elm_tickernoti_button_unset(obj);
500    return NULL;
501 }
502
503 EAPI Evas_Object *
504 elm_tickernoti_add(Evas_Object *parent)
505 {
506    Evas_Object *obj;
507    Evas *e;
508    Widget_Data *wd;
509
510    wd = ELM_NEW(Widget_Data);
511    wd->win = _create_window(parent, "noti-window");
512
513    e = evas_object_evas_get(wd->win);
514    obj = elm_widget_add(e);
515    ELM_SET_WIDTYPE(widtype, "tickernoti");
516    elm_widget_type_set(obj, widtype);
517    elm_widget_sub_object_add(wd->win, obj);
518    elm_widget_data_set(obj, wd);
519    elm_widget_del_hook_set(obj, _del_hook);
520    elm_widget_theme_hook_set(obj, _theme_hook);
521    elm_widget_can_focus_set(obj, 0);
522    elm_widget_disable_hook_set(obj, _disable_hook);
523
524    wd->orient = ELM_TICKERNOTI_ORIENT_TOP;
525
526    _create_tickernoti(obj);
527    elm_widget_text_set_hook_set(obj, _elm_tickernoti_label_set);
528    elm_widget_text_get_hook_set(obj, _elm_tickernoti_label_get);
529    elm_widget_content_set_hook_set(obj, _elm_tickernoti_content_part_set_hook);
530    elm_widget_content_get_hook_set(obj, _elm_tickernoti_content_part_get_hook);
531    elm_widget_content_unset_hook_set(obj, _elm_tickernoti_content_part_unset_hook);
532    evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, NULL);
533
534    evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, NULL);
535    evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, NULL);
536    evas_object_smart_callbacks_descriptions_set(obj, _signals);
537    return obj;
538 }
539
540 EAPI int
541 elm_tickernoti_rotation_get(const Evas_Object *obj)
542 {
543    ELM_CHECK_WIDTYPE(obj, widtype) -1;
544    Widget_Data *wd = elm_widget_data_get(obj);
545    if (!wd) return -1;
546    return wd->angle;
547 }
548
549 EAPI void
550 elm_tickernoti_rotation_set(Evas_Object *obj, int angle)
551 {
552    ELM_CHECK_WIDTYPE(obj, widtype);
553    Widget_Data *wd = elm_widget_data_get(obj);
554
555    if (!wd) return;
556    if (angle % 90) return;
557    angle %= 360;
558    if (angle < 0) angle += 360;
559    wd->angle = angle;
560    elm_win_rotation_set(wd->win, angle);
561    _win_rotated(obj);
562 }
563
564 EAPI void
565 elm_tickernoti_orient_set(Evas_Object *obj, Elm_Tickernoti_Orient orient)
566 {
567    ELM_CHECK_WIDTYPE(obj, widtype);
568
569 #ifdef HAVE_ELEMENTARY_X
570    Evas_Coord root_w, root_h;
571 #endif
572    Widget_Data *wd = elm_widget_data_get(obj);
573
574    if (!wd) return;
575    if (orient >= ELM_TICKERNOTI_ORIENT_LAST) return;
576
577 #ifdef HAVE_ELEMENTARY_X
578    ecore_x_window_size_get(ecore_x_window_root_first_get(), &root_w, &root_h);
579 #endif
580
581    switch(orient) {
582       case ELM_TICKERNOTI_ORIENT_BOTTOM:
583 #ifdef HAVE_ELEMENTARY_X
584          evas_object_move(wd->win, 0, root_h - wd->noti_height);
585 #endif
586          wd->orient = ELM_TICKERNOTI_ORIENT_BOTTOM;
587          break;
588       case ELM_TICKERNOTI_ORIENT_TOP:
589       default:
590 #ifdef HAVE_ELEMENTARY_X
591          evas_object_move(wd->win, 0, 0);
592 #endif
593          wd->orient = ELM_TICKERNOTI_ORIENT_TOP;
594          break;
595    }
596 #ifdef HAVE_ELEMENTARY_X
597    _update_window_hints(wd->win);
598 #endif
599 }
600
601 EAPI Elm_Tickernoti_Orient
602 elm_tickernoti_orient_get(const Evas_Object *obj)
603 {
604    ELM_CHECK_WIDTYPE(obj, widtype) -1;
605    Widget_Data *wd = elm_widget_data_get(obj);
606
607    if (!wd) return ELM_TICKERNOTI_ORIENT_LAST;
608    return wd->orient;
609 }
610
611 EAPI Evas_Object *
612 elm_tickernoti_win_get(const Evas_Object *obj)
613 {
614    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
615    Widget_Data *wd = elm_widget_data_get(obj);
616    if (!wd) return NULL;
617    return wd->win;
618 }
619
620 EAPI void
621 elm_tickernoti_detailview_label_set(Evas_Object *obj, const char *label)
622 {
623    _elm_tickernoti_label_set(obj, NULL, label);
624 }
625
626 EAPI const char *
627 elm_tickernoti_detailview_label_get(const Evas_Object *obj)
628 {
629    return _elm_tickernoti_label_get(obj, NULL);
630 }
631
632 EAPI void
633 elm_tickernoti_detailview_button_set(Evas_Object *obj, Evas_Object *button)
634 {
635    _elm_tickernoti_button_set(obj, button);
636 }
637
638 EAPI Evas_Object *
639 elm_tickernoti_detailview_button_get(const Evas_Object *obj)
640 {
641    return _elm_tickernoti_button_get(obj);
642 }
643
644 EAPI void
645 elm_tickernoti_detailview_icon_set(Evas_Object *obj, Evas_Object *icon)
646 {
647    _elm_tickernoti_icon_set(obj, icon);
648 }
649
650 EAPI Evas_Object *
651 elm_tickernoti_detailview_icon_get(const Evas_Object *obj)
652 {
653    return _elm_tickernoti_icon_get(obj);
654 }
655
656 EAPI Elm_Tickernoti_Mode
657 elm_tickernoti_mode_get(const Evas_Object *obj)
658 {
659    ELM_CHECK_WIDTYPE(obj, widtype) -1;
660    Widget_Data *wd = elm_widget_data_get(obj);
661    if (!wd) return -1;
662    return wd->mode;
663 }
664
665 EAPI void
666 elm_tickernoti_mode_set(Evas_Object *obj, Elm_Tickernoti_Mode mode)
667 {
668    ELM_CHECK_WIDTYPE(obj, widtype);
669    Widget_Data *wd = elm_widget_data_get(obj);
670    if (!wd) return;
671
672    switch(mode){
673       case ELM_TICKERNOTI_DEFAULT:
674       case ELM_TICKERNOTI_DETAILVIEW:
675          wd->mode = mode;
676          break;
677       default:
678          break;
679    }
680 }
681
682 EAPI Evas_Object *
683 elm_tickernoti_detailview_get(const Evas_Object *obj)
684 {
685    return elm_tickernoti_win_get(obj);
686 }
687
688 EAPI void
689 elm_tickernoti_orientation_set(Evas_Object *obj, Elm_Tickernoti_Orient orient)
690 {
691    elm_tickernoti_orient_set(obj, orient);
692 }
693
694 EAPI Elm_Tickernoti_Orient
695 elm_tickernoti_orientation_get(const Evas_Object *obj)
696 {
697    return elm_tickernoti_orient_get(obj);
698 }
699
700 EAPI void
701 elm_tickernoti_label_set(Evas_Object *obj, const char *label)
702 {
703    _elm_tickernoti_label_set(obj, NULL, label);
704 }
705
706 EAPI const char *
707 elm_tickernoti_label_get(const Evas_Object *obj)
708 {
709    return _elm_tickernoti_label_get(obj, NULL);
710 }
711
712 EAPI void
713 elm_tickernoti_button_set(Evas_Object *obj, Evas_Object *button)
714 {
715    _elm_tickernoti_button_set(obj, button);
716 }
717
718 EAPI Evas_Object *
719 elm_tickernoti_button_get(const Evas_Object *obj)
720 {
721    return _elm_tickernoti_button_get(obj);
722 }
723
724 EAPI void
725 elm_tickernoti_icon_set(Evas_Object *obj, Evas_Object *icon)
726 {
727    _elm_tickernoti_icon_set(obj, icon);
728 }
729
730 EAPI Evas_Object *
731 elm_tickernoti_icon_get(const Evas_Object *obj)
732 {
733    return _elm_tickernoti_icon_get(obj);
734 }