e638f6235d170ccac94536c3b482f806abb4ccd7
[framework/uifw/elementary.git] / src / lib / elm_panes.h
1    /**
2     * @defgroup Panes Panes
3     * @ingroup Elementary
4     *
5     * @image html img/widget/panes/preview-00.png
6     * @image latex img/widget/panes/preview-00.eps width=\textwidth
7     *
8     * @image html img/panes.png
9     * @image latex img/panes.eps width=\textwidth
10     *
11     * The panes adds a dragable bar between two contents. When dragged
12     * this bar will resize contents size.
13     *
14     * Panes can be displayed vertically or horizontally, and contents
15     * size proportion can be customized (homogeneous by default).
16     *
17     * Smart callbacks one can listen to:
18     * - "press" - The panes has been pressed (button wasn't released yet).
19     * - "unpressed" - The panes was released after being pressed.
20     * - "clicked" - The panes has been clicked>
21     * - "clicked,double" - The panes has been double clicked
22     *
23     * Available styles for it:
24     * - @c "default"
25     *
26     * Default contents parts of the panes widget that you can use for are:
27     * @li "left" - A leftside content of the panes
28     * @li "right" - A rightside content of the panes
29     *
30     * If panes is displayed vertically, left content will be displayed at
31     * top.
32     *
33     * Here is an example on its usage:
34     * @li @ref panes_example
35     */
36
37    /**
38     * @addtogroup Panes
39     * @{
40     */
41
42    /**
43     * Add a new panes widget to the given parent Elementary
44     * (container) object.
45     *
46     * @param parent The parent object.
47     * @return a new panes widget handle or @c NULL, on errors.
48     *
49     * This function inserts a new panes widget on the canvas.
50     *
51     * @ingroup Panes
52     */
53    EAPI Evas_Object          *elm_panes_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
54
55    /**
56     * Set the left content of the panes widget.
57     *
58     * @param obj The panes object.
59     * @param content The new left content object.
60     *
61     * Once the content object is set, a previously set one will be deleted.
62     * If you want to keep that old content object, use the
63     * elm_panes_content_left_unset() function.
64     *
65     * If panes is displayed vertically, left content will be displayed at
66     * top.
67     *
68     * @see elm_panes_content_left_get()
69     * @see elm_panes_content_right_set() to set content on the other side.
70     *
71     * @deprecated use elm_object_part_content_set() instead
72     *
73     * @ingroup Panes
74     */
75    EINA_DEPRECATED EAPI void                  elm_panes_content_left_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1);
76
77    /**
78     * Set the right content of the panes widget.
79     *
80     * @param obj The panes object.
81     * @param content The new right content object.
82     *
83     * Once the content object is set, a previously set one will be deleted.
84     * If you want to keep that old content object, use the
85     * elm_panes_content_right_unset() function.
86     *
87     * If panes is displayed vertically, left content will be displayed at
88     * bottom.
89     *
90     * @see elm_panes_content_right_get()
91     * @see elm_panes_content_left_set() to set content on the other side.
92     *
93     * @deprecated use elm_object_part_content_set() instead
94     *
95     * @ingroup Panes
96     */
97    EINA_DEPRECATED EAPI void                  elm_panes_content_right_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1);
98
99    /**
100     * Get the left content of the panes.
101     *
102     * @param obj The panes object.
103     * @return The left content object that is being used.
104     *
105     * Return the left content object which is set for this widget.
106     *
107     * @see elm_panes_content_left_set() for details.
108     *
109     * @deprecated use elm_object_part_content_get() instead
110     *
111     * @ingroup Panes
112     */
113    EINA_DEPRECATED EAPI Evas_Object          *elm_panes_content_left_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
114
115    /**
116     * Get the right content of the panes.
117     *
118     * @param obj The panes object
119     * @return The right content object that is being used
120     *
121     * Return the right content object which is set for this widget.
122     *
123     * @see elm_panes_content_right_set() for details.
124     *
125     * @deprecated use elm_object_part_content_get() instead
126     *
127     * @ingroup Panes
128     */
129    EINA_DEPRECATED EAPI Evas_Object          *elm_panes_content_right_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
130
131    /**
132     * Unset the left content used for the panes.
133     *
134     * @param obj The panes object.
135     * @return The left content object that was being used.
136     *
137     * Unparent and return the left content object which was set for this widget.
138     *
139     * @see elm_panes_content_left_set() for details.
140     * @see elm_panes_content_left_get().
141     *
142     * @deprecated use elm_object_part_content_unset() instead
143     *
144     * @ingroup Panes
145     */
146    EINA_DEPRECATED EAPI Evas_Object          *elm_panes_content_left_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
147
148    /**
149     * Unset the right content used for the panes.
150     *
151     * @param obj The panes object.
152     * @return The right content object that was being used.
153     *
154     * Unparent and return the right content object which was set for this
155     * widget.
156     *
157     * @see elm_panes_content_right_set() for details.
158     * @see elm_panes_content_right_get().
159     *
160     * @deprecated use elm_object_part_content_unset() instead
161     *
162     * @ingroup Panes
163     */
164    EINA_DEPRECATED EAPI Evas_Object          *elm_panes_content_right_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
165
166    /**
167     * Get the size proportion of panes widget's left side.
168     *
169     * @param obj The panes object.
170     * @return float value between 0.0 and 1.0 representing size proportion
171     * of left side.
172     *
173     * @see elm_panes_content_left_size_set() for more details.
174     *
175     * @ingroup Panes
176     */
177    EAPI double                elm_panes_content_left_size_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
178
179    /**
180     * Set the size proportion of panes widget's left side.
181     *
182     * @param obj The panes object.
183     * @param size Value between 0.0 and 1.0 representing size proportion
184     * of left side.
185     *
186     * By default it's homogeneous, i.e., both sides have the same size.
187     *
188     * If something different is required, it can be set with this function.
189     * For example, if the left content should be displayed over
190     * 75% of the panes size, @p size should be passed as @c 0.75.
191     * This way, right content will be resized to 25% of panes size.
192     *
193     * If displayed vertically, left content is displayed at top, and
194     * right content at bottom.
195     *
196     * @note This proportion will change when user drags the panes bar.
197     *
198     * @see elm_panes_content_left_size_get()
199     *
200     * @ingroup Panes
201     */
202    EAPI void                  elm_panes_content_left_size_set(Evas_Object *obj, double size) EINA_ARG_NONNULL(1);
203
204   /**
205    * Set the orientation of a given panes widget.
206    *
207    * @param obj The panes object.
208    * @param horizontal Use @c EINA_TRUE to make @p obj to be
209    * @b horizontal, @c EINA_FALSE to make it @b vertical.
210    *
211    * Use this function to change how your panes is to be
212    * disposed: vertically or horizontally.
213    *
214    * By default it's displayed horizontally.
215    *
216    * @see elm_panes_horizontal_get()
217    *
218    * @ingroup Panes
219    */
220    EAPI void                  elm_panes_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EINA_ARG_NONNULL(1);
221
222    /**
223     * Retrieve the orientation of a given panes widget.
224     *
225     * @param obj The panes object.
226     * @return @c EINA_TRUE, if @p obj is set to be @b horizontal,
227     * @c EINA_FALSE if it's @b vertical (and on errors).
228     *
229     * @see elm_panes_horizontal_set() for more details.
230     *
231     * @ingroup Panes
232     */
233    EAPI Eina_Bool             elm_panes_horizontal_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
234    EAPI void                  elm_panes_fixed_set(Evas_Object *obj, Eina_Bool fixed) EINA_ARG_NONNULL(1);
235    EAPI Eina_Bool             elm_panes_fixed_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
236
237    /**
238     * @}
239     */
240