2 * @defgroup Hover Hover
5 * @image html hover_inheritance_tree.png
6 * @image latex hover_inheritance_tree.eps
8 * @image html img/widget/hover/preview-00.png
9 * @image latex img/widget/hover/preview-00.eps
11 * A Hover object will hover over its @p parent object at the @p target
12 * location. Anything in the background will be given a darker coloring to
13 * indicate that the hover object is on top (at the default theme). When the
14 * hover is clicked it is dismissed(hidden), if the contents of the hover are
15 * clicked that @b doesn't cause the hover to be dismissed.
17 * A Hover object has two parents. One parent that owns it during creation
18 * and the other parent being the one over which the hover object spans.
21 * @note The hover object will take up the entire space of @p target
24 * Elementary has the following styles for the hover widget:
28 * @li hoversel_vertical
30 * This widget inherits from the @ref Layout one, so that all the
31 * functions acting on it also work for hover objects.
33 * This widget emits the following signals, besides the ones sent from
35 * @li @c "clicked" - the user clicked the empty space in the hover to dismiss
36 * @li @c "smart,changed" - a content object placed under the "smart"
37 * policy was replaced to a new slot direction.
39 * Default content parts of the hover widget that you can use for are:
45 * @li @c "bottom-right"
47 * @li @c "bottom-left"
51 * @note These content parts indicates the direction that the content will be
54 * All directions may have contents at the same time, except for
55 * "smart". This is a special placement hint and its use case
56 * depends of the calculations coming from
57 * elm_hover_best_content_location_get(). Its use is for cases when
58 * one desires only one hover content, but with a dynamic special
59 * placement within the hover area. The content's geometry, whenever
60 * it changes, will be used to decide on a best location, not
61 * extrapolating the hover's parent object view to show it in (still
62 * being the hover's target determinant of its medium part -- move and
63 * resize it to simulate finger sizes, for example). If one of the
64 * directions other than "smart" are used, a previously content set
65 * using it will be deleted, and vice-versa.
67 * Supported elm_object common APIs.
68 * @li @ref elm_object_signal_emit
69 * @li @ref elm_object_signal_callback_add
70 * @li @ref elm_object_signal_callback_del
71 * @li @ref elm_object_part_content_set
72 * @li @ref elm_object_part_content_get
73 * @li @ref elm_object_part_content_unset
75 * See @ref tutorial_hover for more information.
81 * @typedef Elm_Hover_Axis
83 * The orientation axis for the hover object
87 ELM_HOVER_AXIS_NONE, /**< ELM_HOVER_AXIS_NONE -- no preferred orientation */
88 ELM_HOVER_AXIS_HORIZONTAL, /**< ELM_HOVER_AXIS_HORIZONTAL -- horizontal */
89 ELM_HOVER_AXIS_VERTICAL, /**< ELM_HOVER_AXIS_VERTICAL -- vertical */
90 ELM_HOVER_AXIS_BOTH /**< ELM_HOVER_AXIS_BOTH -- both */
94 * @brief Adds a hover object to @p parent
96 * @param parent The parent object
97 * @return The hover object or NULL if one could not be created
101 EAPI Evas_Object *elm_hover_add(Evas_Object *parent);
104 * @brief Sets the target object for the hover.
106 * @param obj The hover object
107 * @param target The object to center the hover onto.
109 * This function will cause the hover to be centered on the target object.
113 EAPI void elm_hover_target_set(Evas_Object *obj, Evas_Object *target);
116 * @brief Gets the target object for the hover.
118 * @param obj The hover object
119 * @return The target object for the hover.
121 * @see elm_hover_target_set()
125 EAPI Evas_Object *elm_hover_target_get(const Evas_Object *obj);
128 * @brief Sets the parent object for the hover.
130 * @param obj The hover object
131 * @param parent The object to locate the hover over.
133 * This function will cause the hover to take up the entire space that the
134 * parent object fills.
138 EAPI void elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
141 * @brief Gets the parent object for the hover.
143 * @param obj The hover object
144 * @return The parent object to locate the hover over.
146 * @see elm_hover_parent_set()
150 EAPI Evas_Object *elm_hover_parent_get(const Evas_Object *obj);
153 * @brief Returns the best swallow location for content in the hover.
155 * @param obj The hover object
156 * @param pref_axis The preferred orientation axis for the hover object to use
157 * @return The edje location to place content into the hover or @c
160 * Best is defined here as the location at which there is the most available
163 * @p pref_axis may be one of
164 * - @c ELM_HOVER_AXIS_NONE -- no preferred orientation
165 * - @c ELM_HOVER_AXIS_HORIZONTAL -- horizontal
166 * - @c ELM_HOVER_AXIS_VERTICAL -- vertical
167 * - @c ELM_HOVER_AXIS_BOTH -- both
169 * If ELM_HOVER_AXIS_HORIZONTAL is chosen the returned position will
170 * necessarily be along the horizontal axis("left" or "right"). If
171 * ELM_HOVER_AXIS_VERTICAL is chosen the returned position will necessarily
172 * be along the vertical axis("top" or "bottom"). Choosing
173 * ELM_HOVER_AXIS_BOTH or ELM_HOVER_AXIS_NONE has the same effect and the
174 * returned position may be in either axis.
176 * @see elm_object_part_content_set()
180 EAPI const char *elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_axis);
183 * @brief Dismiss a hover object
185 * @param obj The hover object
186 * Use this function to simulate clicking outside the hover to dismiss it.
187 * In this way, the hover will be hidden and the "clicked" signal will be emitted.
191 EAPI void elm_hover_dismiss(Evas_Object *obj);