3 * @defgroup Hover Hover
6 * @image html hover_inheritance_tree.png
7 * @image latex hover_inheritance_tree.eps
9 * @image html img/widget/hover/preview-00.png
10 * @image latex img/widget/hover/preview-00.eps
12 * A Hover object hovers over its @a parent object at the @a target
13 * location. Anything in the background is given a darker coloring to
14 * indicate that the hover object is on top (at the default theme). When the
15 * hover is clicked it is dismissed(hidden), if the contents of the hover are
16 * clicked that @b doesn't cause the hover to be dismissed.
18 * A Hover object has two parents. One parent that owns it during creation
19 * and the other parent being the one over which the hover object spans.
22 * @remarks The hover object takes up the entire space of the @a target
25 * Elementary has the following styles for the hover widget:
29 * @li hoversel_vertical
31 * This widget inherits from the @ref Layout one, so that all the
32 * functions acting on it also work for hover objects.
34 * This widget emits the following signals, besides the ones sent from
36 * @li @c "clicked" - The user clicked the empty space in the hover to dismiss.
37 * @li @c "smart,changed" - A content object placed under the "smart"
38 * policy is replaced to a new slot direction.
40 * The default content parts of the hover widget that you can use are:
46 * @li @c "bottom-right"
48 * @li @c "bottom-left"
52 * @remarks These content parts indicate the direction in which the content is
55 * All directions may have contents at the same time, except for
56 * "smart". This is a special placement hint and its use case
57 * depends on the calculations coming from
58 * elm_hover_best_content_location_get(). Its use is for cases when
59 * one desires only one hover content, but with a dynamic special
60 * placement within the hover area. The content's geometry, whenever
61 * it changes, is used to decide on the best location, not
62 * extrapolating the hover's parent object view to show it in (still
63 * being the hover's target determinant of its medium part, move and
64 * resize it to simulate finger sizes, for example). If one of the
65 * directions other than "smart" are used, a previous content set
66 * using it is deleted, and vice-versa.
68 * Supported common elm_object APIs.
69 * @li @ref elm_object_signal_emit
70 * @li @ref elm_object_signal_callback_add
71 * @li @ref elm_object_signal_callback_del
72 * @li @ref elm_object_part_content_set
73 * @li @ref elm_object_part_content_get
74 * @li @ref elm_object_part_content_unset
80 * @typedef Elm_Hover_Axis
82 * @brief Enumeration that defines the orientation axis for the hover object.
86 ELM_HOVER_AXIS_NONE, /**< ELM_HOVER_AXIS_NONE -- no preferred orientation */
87 ELM_HOVER_AXIS_HORIZONTAL, /**< ELM_HOVER_AXIS_HORIZONTAL -- horizontal */
88 ELM_HOVER_AXIS_VERTICAL, /**< ELM_HOVER_AXIS_VERTICAL -- vertical */
89 ELM_HOVER_AXIS_BOTH /**< ELM_HOVER_AXIS_BOTH -- both */
93 * @brief Adds a hover object to @a parent.
95 * @param[in] parent The parent object
96 * @return The hover object, otherwise @c NULL if it could not be created
100 EAPI Evas_Object *elm_hover_add(Evas_Object *parent);
103 * @brief Sets the target object for the hover.
105 * @details This function causes the hover to be centered on the target object
107 * @param[in] obj The hover object
108 * @param[in] target The object to center the hover onto
112 EAPI void elm_hover_target_set(Evas_Object *obj, Evas_Object *target);
115 * @brief Gets the target object for the hover.
117 * @param[in] obj The hover object
118 * @return The target object for the hover
120 * @see elm_hover_target_set()
124 EAPI Evas_Object *elm_hover_target_get(const Evas_Object *obj);
127 * @brief Sets the parent object for the hover.
129 * @details This function causes the hover to take up the entire space that the
130 * parent object fills.
132 * @param[in] obj The hover object
133 * @param[in] parent The object to locate the hover over
137 EAPI void elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
140 * @brief Gets the parent object for the hover.
142 * @param[in] obj The hover object
143 * @return The parent object to locate the hover over
147 EAPI Evas_Object *elm_hover_parent_get(const Evas_Object *obj);
150 * @brief Gets the best swallow location for content in the hover.
152 * @remarks Best is defined here as the location at which the most available
155 * @remarks @a pref_axis may be one of
156 * - @c ELM_HOVER_AXIS_NONE -- no preferred orientation
157 * - @c ELM_HOVER_AXIS_HORIZONTAL -- horizontal
158 * - @c ELM_HOVER_AXIS_VERTICAL -- vertical
159 * - @c ELM_HOVER_AXIS_BOTH -- both
161 * If @c ELM_HOVER_AXIS_HORIZONTAL is chosen the returned position is
162 * necessarily along the horizontal axis("left" or "right"). If
163 * @c ELM_HOVER_AXIS_VERTICAL is chosen the returned position is necessarily
164 * along the vertical axis("top" or "bottom"). Choosing
165 * @c ELM_HOVER_AXIS_BOTH or @c ELM_HOVER_AXIS_NONE has the same effect and the
166 * returned position may be in either axes.
168 * @param[in] obj The hover object
169 * @param[in] pref_axis The preferred orientation axis for the hover object to use
170 * @return The edje location to place content into the hover,
171 * otherwise @c NULL in case of an error
173 * @see elm_object_part_content_set()
177 EAPI const char *elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_axis);
180 * @brief Dismisses a hover object.
182 * @remarks Use this function to simulate clicking outside the hover to dismiss it.
183 * In this way, the hover is hidden and the "clicked" signal is emitted.
185 * @param[in] obj The hover object
189 EAPI void elm_hover_dismiss(Evas_Object *obj);