2 * @defgroup Popup Popup
5 * @image html popup_inheritance_tree.png
6 * @image latex popup_inheritance_tree.eps
8 * This widget is an enhancement of @ref Notify. In addition to
9 * content area, there are two optional sections, namely title area and
12 * The popup widget displays its content with a particular orientation in
13 * the parent area. This orientation can be one among top, center,
14 * bottom, left, top-left, top-right, bottom-left and bottom-right.
15 * Content part of Popup can be an Evas Object set by application or
16 * it can be Text set by application or set of items containing an
17 * icon and/or text. The content/item-list can be removed using
18 * elm_object_content_set with second parameter passed as NULL.
20 * The following figures show the textual layouts of popup in which Title
21 * Area and Action area area are optional ones. Action area can have
22 * up to 3 buttons handled using elm_object common APIs mentioned
23 * below. If user wants to have more than 3 buttons then these buttons
24 * can be put inside the items of a list as content. User needs to
25 * handle the clicked signal of these action buttons if required. No
26 * event is processed by the widget automatically when clicked on
27 * these action buttons.
31 *|---------------------| |---------------------| |---------------------|
32 *| Title Area | | Title Area | | Title Area |
33 *|Icon| Text | |Icon| Text | |Icon| Text |
34 *|---------------------| |---------------------| |---------------------|
36 *|---------------------| | | | |
37 *| Item 2 | | | | Description |
38 *|---------------------| | Content | | |
40 *|---------------------| | | | |
41 *| . | |---------------------| |---------------------|
42 *| . | | Action Area | | Action Area |
43 *| . | | Btn1 |Btn2|. |Btn3 | | Btn1 |Btn2| |Btn3 |
44 *|---------------------| |---------------------| |---------------------|
45 *| Item N | Content Based Layout Description based Layout
46 *|---------------------|
48 *| Btn1 |Btn2|. |Btn3 |
49 *|---------------------|
54 * Timeout can be set on expiry of which popup instance hides and
55 * sends a smart signal "timeout" to the user. The visible region of
56 * popup is surrounded by a translucent region called Blocked Event
57 * area. By clicking on Blocked Event area, the signal
58 * "block,clicked" is sent to the application. This block event area
59 * can be avoided by using API elm_popup_allow_events_set. When gets
60 * hidden, popup does not get destroyed automatically, application
61 * should destroy the popup instance after use. To control the
62 * maximum height of the internal scroller for item, we use the height
63 * of the action area which is passed by theme based on the number of
64 * buttons currently set to popup.
66 * This widget inherits from the @ref Layout one, so that all the
67 * functions acting on it also work for popup objects (@since 1.8).
69 * This widget emits the following signals, besides the ones sent from
71 * @li @c "timeout" - whenever popup is closed as a result of timeout.
72 * @li @c "block,clicked" - whenever user taps on Blocked Event area.
73 * @li @c "language,changed" - The program's language changed. (@since 1.8)
74 * @li @c "show,finished" - When the popup transition is finished in showing.
76 * Styles available for Popup
79 * Default contents parts of the popup widget that you can use are:
80 * @li "default" - The content of the popup
81 * @li "title,icon" - Title area's icon
82 * @li "button1" - 1st button of the action area
83 * @li "button2" - 2nd button of the action area
84 * @li "button3" - 3rd button of the action area
86 * Default text parts of the popup widget that you can use are:
87 * @li "title,text" - This operates on Title area's label
88 * @li "default" - content-text set in the content area of the widget
90 * Default contents parts of the popup items that you can use are:
91 * @li "default" -Item's icon
93 * Default text parts of the popup items that you can use are:
94 * @li "default" - Item's label
96 * Supported elm_object_item common APIs.
97 * @li @ref elm_object_item_disabled_set
98 * @li @ref elm_object_item_disabled_get
99 * @li @ref elm_object_item_part_text_set
100 * @li @ref elm_object_item_part_text_get
101 * @li @ref elm_object_item_part_content_set
102 * @li @ref elm_object_item_part_content_get
103 * @li @ref elm_object_item_signal_emit
104 * @li @ref elm_object_item_del
106 * Here are some sample code to illustrate Popup usage:
107 * @li @ref popup_example_01_c
108 * @li @ref popup_example_02_c
109 * @li @ref popup_example_03_c
113 * @brief Possible orient values for popup.
115 * These values should be used in conjunction to elm_popup_orient_set() to
116 * set the position in which the popup should appear(relative to its parent)
117 * and in conjunction with elm_popup_orient_get() to know where the popup
124 ELM_POPUP_ORIENT_TOP = 0, /**< Popup should appear in the top of parent, default */
125 ELM_POPUP_ORIENT_CENTER, /**< Popup should appear in the center of parent */
126 ELM_POPUP_ORIENT_BOTTOM, /**< Popup should appear in the bottom of parent */
127 ELM_POPUP_ORIENT_LEFT, /**< Popup should appear in the left of parent */
128 ELM_POPUP_ORIENT_RIGHT, /**< Popup should appear in the right of parent */
129 ELM_POPUP_ORIENT_TOP_LEFT, /**< Popup should appear in the top left of parent */
130 ELM_POPUP_ORIENT_TOP_RIGHT, /**< Popup should appear in the top right of parent */
131 ELM_POPUP_ORIENT_BOTTOM_LEFT, /**< Popup should appear in the bottom left of parent */
132 ELM_POPUP_ORIENT_BOTTOM_RIGHT, /**< Notify should appear in the bottom right of parent */
133 ELM_POPUP_ORIENT_LAST /**< Sentinel value, @b don't use */
137 * @brief Adds a new Popup to the parent
139 * @param parent The parent object
140 * @return The new object or NULL if it cannot be created
144 EAPI Evas_Object *elm_popup_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
147 * @brief Add a new item to a Popup object
149 * Both an item list and a content could not be set at the same time!
150 * once you add an item, the previous content will be removed.
152 * @param obj popup object
153 * @param icon Icon to be set on new item
154 * @param label The Label of the new item
155 * @param func Convenience function called when item selected
156 * @param data Data passed to @p func above
157 * @return A handle to the item added or @c NULL, on errors
160 * @warning When the first item is appended to popup object, any previous content
161 * of the content area is deleted. At a time, only one of content, content-text
162 * and item(s) can be there in a popup content area.
164 EAPI Elm_Object_Item *elm_popup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1);
167 * @brief Sets the wrapping type of content text packed in content
168 * area of popup object.
170 * @param obj The Popup object
171 * @param wrap wrapping type of type Elm_Wrap_Type
174 * @see elm_popup_content_text_wrap_type_get()
176 EAPI void elm_popup_content_text_wrap_type_set(Evas_Object *obj, Elm_Wrap_Type wrap) EINA_ARG_NONNULL(1);
179 * @brief Returns the wrapping type of content text packed in content area of
182 * @param obj The Popup object
183 * @return wrap type of the content text
186 * @see elm_popup_content_text_wrap_type_set
188 EAPI Elm_Wrap_Type elm_popup_content_text_wrap_type_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
191 * @brief Sets the orientation of the popup in the parent region
193 * @param obj The popup object
194 * @param orient the orientation of the popup
196 * Sets the position in which popup will appear in its parent
199 * @see @ref Elm_Popup_Orient for possible values.
201 EAPI void elm_popup_orient_set(Evas_Object *obj, Elm_Popup_Orient orient) EINA_ARG_NONNULL(1);
204 * @brief Returns the orientation of Popup
206 * @param obj The popup object
207 * @return the orientation of the popup
210 * @see elm_popup_orient_set()
211 * @see Elm_Popup_Orient
213 EAPI Elm_Popup_Orient elm_popup_orient_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
216 * @brief Sets a timeout to hide popup automatically
218 * @param obj The popup object
219 * @param timeout The timeout in seconds
221 * This function sets a timeout and starts the timer controlling when the
222 * popup is hidden. Since calling evas_object_show() on a popup restarts
223 * the timer controlling when it is hidden, setting this before the
224 * popup is shown will in effect mean starting the timer when the popup is
225 * shown. Smart signal "timeout" is called afterwards which can be handled
228 * @note Set a value <= 0.0 to disable a running timer.
230 * @note If the value > 0.0 and the popup is previously visible, the
231 * timer will be started with this value, canceling any running timer.
234 EAPI void elm_popup_timeout_set(Evas_Object *obj, double timeout) EINA_ARG_NONNULL(1);
237 * @brief Returns the timeout value set to the popup (in seconds)
239 * @param obj The popup object
240 * @return the timeout value
243 * @see elm_popup_timeout_set()
245 EAPI double elm_popup_timeout_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
248 * @brief Sets whether events should be passed to by a click outside.
250 * @param obj The popup object
251 * @param allow EINA_TRUE Events are passed to lower objects, else not
253 * Enabling allow event will remove the Blocked event area and events will
254 * pass to the lower layer objects otherwise they are blocked.
257 * @see elm_popup_allow_events_get()
258 * @note The default value is EINA_FALSE.
260 EAPI void elm_popup_allow_events_set(Evas_Object *obj, Eina_Bool allow);
263 * @brief Returns value indicating whether allow event is enabled or not
265 * @param obj The popup object
266 * @return EINA_FALSE if Blocked event area is present else EINA_TRUE
269 * @see elm_popup_allow_events_set()
270 * @note By default the Blocked event area is present
272 EAPI Eina_Bool elm_popup_allow_events_get(const Evas_Object *obj);
275 * @brief Set the popup's parent
277 * @param obj The popup object
278 * @param parent The new parent
280 * Once the parent object is set, a previously set one will be disconnected
285 EAPI void elm_popup_parent_set(Evas_Object *obj, Evas_Object *parent);
288 * @brief Get the popup's parent
290 * @param obj The popup object
293 * @see elm_popup_parent_set()
297 EAPI Evas_Object *elm_popup_parent_get(Evas_Object *obj);