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