elementary/datetime - elm_datetime - Open source patch : Separator parsing logic...
[framework/uifw/elementary.git] / src / lib / elm_hover.h
1 /**
2  * @defgroup Hover Hover
3  *
4  * @image html img/widget/hover/preview-00.png
5  * @image latex img/widget/hover/preview-00.eps
6  *
7  * A Hover object will hover over its @p parent object at the @p target
8  * location. Anything in the background will be given a darker coloring to
9  * indicate that the hover object is on top (at the default theme). When the
10  * hover is clicked it is dismissed(hidden), if the contents of the hover are
11  * clicked that @b doesn't cause the hover to be dismissed.
12  *
13  * A Hover object has two parents. One parent that owns it during creation
14  * and the other parent being the one over which the hover object spans.
15  *
16  *
17  * @note The hover object will take up the entire space of @p target
18  * object.
19  *
20  * Elementary has the following styles for the hover widget:
21  * @li default
22  * @li popout
23  * @li menu
24  * @li hoversel_vertical
25  *
26  * The following are the available position for content:
27  * @li left
28  * @li top-left
29  * @li top
30  * @li top-right
31  * @li right
32  * @li bottom-right
33  * @li bottom
34  * @li bottom-left
35  * @li middle
36  * @li smart
37  *
38  * Signals that you can add callbacks for are:
39  * @li "clicked" - the user clicked the empty space in the hover to dismiss
40  * @li "smart,changed" - a content object placed under the "smart"
41  *                   policy was replaced to a new slot direction.
42  *
43  * Default content parts of the hover widget that you can use for are:
44  * @li "left"
45  * @li "top-left"
46  * @li "top"
47  * @li "top-right"
48  * @li "right"
49  * @li "bottom-right"
50  * @li "bottom"
51  * @li "bottom-left"
52  * @li "middle"
53  * @li "smart"
54  *
55  * @note These content parts indicates the direction that the content will be
56  * displayed
57  *
58  * All directions may have contents at the same time, except for
59  * "smart". This is a special placement hint and its use case
60  * depends of the calculations coming from
61  * elm_hover_best_content_location_get(). Its use is for cases when
62  * one desires only one hover content, but with a dynamic special
63  * placement within the hover area. The content's geometry, whenever
64  * it changes, will be used to decide on a best location, not
65  * extrapolating the hover's parent object view to show it in (still
66  * being the hover's target determinant of its medium part -- move and
67  * resize it to simulate finger sizes, for example). If one of the
68  * directions other than "smart" are used, a previously content set
69  * using it will be deleted, and vice-versa.
70  *
71  * Supported elm_object common APIs.
72  * @li elm_object_signal_emit
73  * @li elm_object_signal_callback_add
74  * @li elm_object_signal_callback_del
75  * @li elm_object_part_content_set
76  * @li elm_object_part_content_get
77  * @li elm_object_part_content_unset
78  *
79  * See @ref tutorial_hover for more information.
80  *
81  * @{
82  */
83
84 /**
85  * @typedef Elm_Hover_Axis
86  *
87  * The orientation axis for the hover object
88  */
89 typedef enum
90 {
91    ELM_HOVER_AXIS_NONE, /**< ELM_HOVER_AXIS_NONE -- no preferred orientation */
92    ELM_HOVER_AXIS_HORIZONTAL, /**< ELM_HOVER_AXIS_HORIZONTAL -- horizontal */
93    ELM_HOVER_AXIS_VERTICAL, /**< ELM_HOVER_AXIS_VERTICAL -- vertical */
94    ELM_HOVER_AXIS_BOTH /**< ELM_HOVER_AXIS_BOTH -- both */
95 } Elm_Hover_Axis;
96
97 /**
98  * @brief Adds a hover object to @p parent
99  *
100  * @param parent The parent object
101  * @return The hover object or NULL if one could not be created
102  */
103 EAPI Evas_Object *elm_hover_add(Evas_Object *parent);
104
105 /**
106  * @brief Sets the target object for the hover.
107  *
108  * @param obj The hover object
109  * @param target The object to center the hover onto.
110  *
111  * This function will cause the hover to be centered on the target object.
112  */
113 EAPI void         elm_hover_target_set(Evas_Object *obj, Evas_Object *target);
114
115 /**
116  * @brief Gets the target object for the hover.
117  *
118  * @param obj The hover object
119  * @return The target object for the hover.
120  *
121  * @see elm_hover_target_set()
122  */
123 EAPI Evas_Object *elm_hover_target_get(const Evas_Object *obj);
124
125 /**
126  * @brief Sets the parent object for the hover.
127  *
128  * @param obj The hover object
129  * @param parent The object to locate the hover over.
130  *
131  * This function will cause the hover to take up the entire space that the
132  * parent object fills.
133  */
134 EAPI void         elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
135
136 /**
137  * @brief Gets the parent object for the hover.
138  *
139  * @param obj The hover object
140  * @return The parent object to locate the hover over.
141  *
142  * @see elm_hover_parent_set()
143  */
144 EAPI Evas_Object *elm_hover_parent_get(const Evas_Object *obj);
145
146 /**
147  * @brief Returns the best swallow location for content in the hover.
148  *
149  * @param obj The hover object
150  * @param pref_axis The preferred orientation axis for the hover object to use
151  * @return The edje location to place content into the hover or @c
152  *         NULL, on errors.
153  *
154  * Best is defined here as the location at which there is the most available
155  * space.
156  *
157  * @p pref_axis may be one of
158  * - @c ELM_HOVER_AXIS_NONE -- no preferred orientation
159  * - @c ELM_HOVER_AXIS_HORIZONTAL -- horizontal
160  * - @c ELM_HOVER_AXIS_VERTICAL -- vertical
161  * - @c ELM_HOVER_AXIS_BOTH -- both
162  *
163  * If ELM_HOVER_AXIS_HORIZONTAL is chosen the returned position will
164  * necessarily be along the horizontal axis("left" or "right"). If
165  * ELM_HOVER_AXIS_VERTICAL is chosen the returned position will necessarily
166  * be along the vertical axis("top" or "bottom"). Choosing
167  * ELM_HOVER_AXIS_BOTH or ELM_HOVER_AXIS_NONE has the same effect and the
168  * returned position may be in either axis.
169  *
170  * @see elm_object_part_content_set()
171  */
172 EAPI const char  *elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_axis);
173
174 /**
175  * @brief Dismiss a hover object
176  *
177  * @param obj The hover object
178  * Use this function to simulate clicking outside the hover to dismiss it.
179  * In this way, the hover will be hidden and the "clicked" signal will be emitted.
180  */
181 EAPI void elm_hover_dismiss(Evas_Object *obj);
182 /**
183  * @}
184  */