tizen 2.4 release
[framework/uifw/elementary.git] / src / lib / elm_widget_panel.h
1 #ifndef ELM_WIDGET_PANEL_H
2 #define ELM_WIDGET_PANEL_H
3
4 #include "elm_interface_scrollable.h"
5 #include "elm_widget_layout.h"
6
7 /* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
8  * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
9  * FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK
10  * IT AT RUNTIME.
11  */
12
13 /**
14  * @internal
15  * @addtogroup Widget
16  * @{
17  *
18  * @section elm-panel-class The Elementary Panel Class
19  *
20  * Elementary, besides having the @ref Panel widget, exposes its
21  * foundation -- the Elementary Panel Class -- in order to create other
22  * widgets which are a panel with some more logic on top.
23  */
24
25 /**
26  * Base layout smart data extended with panel instance data.
27  */
28 typedef struct _Elm_Panel_Data Elm_Panel_Data;
29 struct _Elm_Panel_Data
30 {
31    Evas_Object                          *bx, *content;
32    Evas_Object                          *event;
33    Evas_Object                          *scr_ly;
34    Evas_Object                          *hit_rect, *panel_edje, *scr_edje;
35    Evas_Object                          *scr_panel, *scr_event;
36
37
38    Elm_Panel_Orient                      orient;
39
40    double                                content_size_ratio;
41    Evas_Coord                            down_x, down_y;
42    Evas_Coord                            handler_size;
43    Ecore_Timer                          *timer;
44
45    Eina_Bool                             hidden : 1;
46    Eina_Bool                             delete_me : 1;
47    Eina_Bool                             scrollable : 1;
48    Eina_Bool                             freeze: 1;
49 };
50
51 /**
52  * @}
53  */
54
55 #define ELM_PANEL_DATA_GET(o, sd) \
56   Elm_Panel_Data * sd = eo_data_scope_get(o, ELM_PANEL_CLASS)
57
58 #define ELM_PANEL_DATA_GET_OR_RETURN(o, ptr)         \
59   ELM_PANEL_DATA_GET(o, ptr);                        \
60   if (EINA_UNLIKELY(!ptr))                           \
61     {                                                \
62        CRI("No widget data for object %p (%s)",      \
63            o, evas_object_type_get(o));              \
64        return;                                       \
65     }
66
67 #define ELM_PANEL_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
68   ELM_PANEL_DATA_GET(o, ptr);                         \
69   if (EINA_UNLIKELY(!ptr))                            \
70     {                                                 \
71        CRI("No widget data for object %p (%s)",       \
72            o, evas_object_type_get(o));               \
73        return val;                                    \
74     }
75
76 #define ELM_PANEL_CHECK(obj)                              \
77   if (EINA_UNLIKELY(!eo_isa((obj), ELM_PANEL_CLASS))) \
78     return
79
80 #endif