Initialize Tizen 2.3
[framework/uifw/elementary.git] / wearable / src / lib / elm_panel.h
1 /**
2  * @defgroup Panel Panel
3  * @ingroup Elementary
4  *
5  * @image html panel_inheritance_tree.png
6  * @image latex panel_inheritance_tree.eps
7  *
8  * @image html img/widget/panel/preview-00.png
9  * @image latex img/widget/panel/preview-00.eps
10  *
11  * @brief A panel is an animated side-panel that contains a
12  * sub-object. It can be expanded or contracted by clicking the
13  * button on its edge.
14  *
15  * Orientations are as follows:
16  * @li @c ELM_PANEL_ORIENT_TOP
17  * @li @c ELM_PANEL_ORIENT_LEFT
18  * @li @c ELM_PANEL_ORIENT_RIGHT
19  * @li @c ELM_PANEL_ORIENT_BOTTOM
20  *
21  * This widget inherits from the @ref Layout one, so that all the
22  * functions acting on it also work for panel objects (@since 1.8).
23  *
24  * Default content parts of the panel widget that you can use are:
25  * @li @c "default" - A content of the panel
26  *
27  * This widget emits the following signals, besides the ones sent from
28  * @li @c "scroll" - the content has been scrolled (moved)
29  *
30  * @ref tutorial_panel shows one way to use this widget.
31  * @{
32  */
33 typedef enum
34 {
35    ELM_PANEL_ORIENT_TOP, /**< Panel (dis)appears from the top */
36    ELM_PANEL_ORIENT_BOTTOM, /**< Panel (dis)appears from the bottom */
37    ELM_PANEL_ORIENT_LEFT, /**< Panel (dis)appears from the left */
38    ELM_PANEL_ORIENT_RIGHT, /**< Panel (dis)appears from the right */
39 } Elm_Panel_Orient;
40
41 /**
42  * @typedef Elm_Panel_Scroll_Info
43  *
44  * When panel content is scrolled, if the panel object is scrollable,
45  * This information will be passed by the @c event_info argument in the
46  * @c "scroll" smart callback function.
47  */
48 typedef struct _Elm_Panel_Scroll_Info
49 {
50    double rel_x;   /** <content scrolled position (0.0 ~ 1.0) in the panel */
51    double rel_y;   /** <content scrolled position (0.0 ~ 1.0) in the panel */
52
53 } Elm_Panel_Scroll_Info;
54
55 /**
56  * @brief Adds a panel object
57  *
58  * @param parent The parent object
59  *
60  * @return The panel object, or NULL on failure
61  *
62  * @ingroup Panel
63  */
64 EAPI Evas_Object                 *elm_panel_add(Evas_Object *parent);
65
66 /**
67  * @brief Sets the orientation of the panel
68  *
69  * @param obj The panel object
70  * @param orient The panel orientation. Can be one of the following:
71  * @li ELM_PANEL_ORIENT_TOP
72  * @li ELM_PANEL_ORIENT_LEFT
73  * @li ELM_PANEL_ORIENT_RIGHT
74  *
75  * Sets from where the panel will (dis)appear.
76  *
77  * @ingroup Panel
78  */
79 EAPI void                         elm_panel_orient_set(Evas_Object *obj, Elm_Panel_Orient orient);
80
81 /**
82  * @brief Get the orientation of the panel.
83  *
84  * @param obj The panel object
85  * @return The Elm_Panel_Orient, or ELM_PANEL_ORIENT_LEFT on failure.
86  *
87  * @ingroup Panel
88  */
89 EAPI Elm_Panel_Orient             elm_panel_orient_get(const Evas_Object *obj);
90
91 /**
92  * @brief Set the state of the panel.
93  *
94  * @param obj The panel object
95  * @param hidden If true, the panel will run the animation to disappear.
96  *
97  * @ingroup Panel
98  */
99 EAPI void                         elm_panel_hidden_set(Evas_Object *obj, Eina_Bool hidden);
100
101 /**
102  * @brief Get the state of the panel.
103  *
104  * @param obj The panel object
105  * @return EINA_TRUE if it is hidden state
106  *
107  * @ingroup Panel
108  */
109 EAPI Eina_Bool                    elm_panel_hidden_get(const Evas_Object *obj);
110
111 /**
112  * @brief Toggle the hidden state of the panel from code
113  *
114  * @param obj The panel object
115  *
116  * @ingroup Panel
117  */
118 EAPI void                         elm_panel_toggle(Evas_Object *obj);
119
120 /**
121  * Enable or disable scrolling in panel
122  *
123  * Normally the panel is not scrollable unless you enable it with this call.
124  *
125  * @param obj The panel object
126  * @param scrollable EINA_TRUE if it is to be scrollable, EINA_FALSE otherwise
127  *
128  * @ingroup Panel
129  */
130 EAPI void                         elm_panel_scrollable_set(Evas_Object *obj, Eina_Bool scrollable);
131
132 /**
133  * Get the scrollable state of the panel
134  *
135  * Normally the panel is not scrollable. This gets the scrollable state
136  * of the panel.
137  *
138  * @param obj The panel object
139  * @return The scrollable state
140  *
141  * @see elm_panel_scrollable_set()
142  *
143  * @ingroup Panel
144  */
145 EAPI Eina_Bool          elm_panel_scrollable_get(const Evas_Object *obj);
146
147 /**
148  * @}
149  */