elm genlist: Fixed a bug with decorate all mode + tree effect. Delete tree effect...
[framework/uifw/elementary.git] / src / lib / elc_ctxpopup.h
index 1235a4e..67a7b9f 100644 (file)
@@ -1,10 +1,11 @@
 /**
  * @defgroup Ctxpopup Ctxpopup
+ * @ingroup Elementary
  *
  * @image html img/widget/ctxpopup/preview-00.png
  * @image latex img/widget/ctxpopup/preview-00.eps
  *
- * @brief Context popup widet.
+ * @brief Context popup widget.
  *
  * A ctxpopup is a widget that, when shown, pops up a list of items.
  * It automatically chooses an area inside its parent object's view
  * items have a label and/or an icon. It is intended for a small
  * number of items (hence the use of list, not genlist).
  *
- * @note Ctxpopup is a especialization of @ref Hover.
+ * @note Ctxpopup is a specialization of @ref Hover.
  *
  * Signals that you can add callbacks for are:
  * "dismissed" - the ctxpopup was dismissed
  *
- * Default contents parts of the ctxpopup widget that you can use for are:
+ * Default content parts of the ctxpopup widget that you can use for are:
  * @li "default" - A content of the ctxpopup
  *
- * Default contents parts of the ctxpopup items that you can use for are:
+ * Default content parts of the ctxpopup items that you can use for are:
  * @li "icon" - An icon in the title area
  *
  * Default text parts of the ctxpopup items that you can use for are:
  * @li "default" - Title label in the title area
  *
+ * Supported elm_object common APIs.
+ * @li @ref elm_object_disabled_set
+ * @li @ref elm_object_disabled_get
+ * @li @ref elm_object_part_content_set
+ * @li @ref elm_object_part_content_get
+ * @li @ref elm_object_part_content_unset
+ * @li @ref elm_object_signal_emit
+ * @li @ref elm_object_signal_callback_add
+ * @li @ref elm_object_signal_callback_del
+ *
+ * Supported elm_object_item common APIs.
+ * @li @ref elm_object_item_disabled_set
+ * @li @ref elm_object_item_disabled_get
+ * @li @ref elm_object_item_part_text_set
+ * @li @ref elm_object_item_part_text_get
+ * @li @ref elm_object_item_part_content_set
+ * @li @ref elm_object_item_part_content_get
+ * @li @ref elm_object_item_signal_emit
+ *
  * @ref tutorial_ctxpopup shows the usage of a good deal of the API.
  * @{
  */
 
-typedef enum _Elm_Ctxpopup_Direction
+typedef enum
 {
-   ELM_CTXPOPUP_DIRECTION_DOWN, /**< ctxpopup show appear below clicked
-                                     area */
-   ELM_CTXPOPUP_DIRECTION_RIGHT, /**< ctxpopup show appear to the right of
-                                      the clicked area */
-   ELM_CTXPOPUP_DIRECTION_LEFT, /**< ctxpopup show appear to the left of
-                                     the clicked area */
-   ELM_CTXPOPUP_DIRECTION_UP, /**< ctxpopup show appear above the clicked
-                                   area */
+   ELM_CTXPOPUP_DIRECTION_DOWN, /**< ctxpopup show appear below clicked area */
+   ELM_CTXPOPUP_DIRECTION_RIGHT, /**< ctxpopup show appear to the right of the clicked area */
+   ELM_CTXPOPUP_DIRECTION_LEFT, /**< ctxpopup show appear to the left of the clicked area */
+   ELM_CTXPOPUP_DIRECTION_UP, /**< ctxpopup show appear above the clicked area */
    ELM_CTXPOPUP_DIRECTION_UNKNOWN, /**< ctxpopup does not determine it's direction yet*/
 } Elm_Ctxpopup_Direction; /**< Direction in which to show the popup */
 
@@ -53,15 +69,13 @@ typedef enum _Elm_Ctxpopup_Direction
  *
  * @ingroup Ctxpopup
  */
-EAPI Evas_Object *
-                                  elm_ctxpopup_add(Evas_Object *parent)
-EINA_ARG_NONNULL(1);
+EAPI Evas_Object                 *elm_ctxpopup_add(Evas_Object *parent);
 
 /**
  * @brief Set the Ctxpopup's parent
  *
  * @param obj The ctxpopup object
- * @param area The parent to use
+ * @param parent The parent to use
  *
  * Set the parent object.
  *
@@ -73,7 +87,7 @@ EINA_ARG_NONNULL(1);
  *
  * @ingroup Ctxpopup
  */
-EAPI void                         elm_ctxpopup_hover_parent_set(Evas_Object *obj, Evas_Object *parent) EINA_ARG_NONNULL(1, 2);
+EAPI void                         elm_ctxpopup_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
 
 /**
  * @brief Get the Ctxpopup's parent
@@ -84,7 +98,7 @@ EAPI void                         elm_ctxpopup_hover_parent_set(Evas_Object *obj
  *
  * @ingroup Ctxpopup
  */
-EAPI Evas_Object                 *elm_ctxpopup_hover_parent_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI Evas_Object                 *elm_ctxpopup_hover_parent_get(const Evas_Object *obj);
 
 /**
  * @brief Clear all items in the given ctxpopup object.
@@ -93,7 +107,7 @@ EAPI Evas_Object                 *elm_ctxpopup_hover_parent_get(const Evas_Objec
  *
  * @ingroup Ctxpopup
  */
-EAPI void                         elm_ctxpopup_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI void                         elm_ctxpopup_clear(Evas_Object *obj);
 
 /**
  * @brief Change the ctxpopup's orientation to horizontal or vertical.
@@ -103,7 +117,7 @@ EAPI void                         elm_ctxpopup_clear(Evas_Object *obj) EINA_ARG_
  *
  * @ingroup Ctxpopup
  */
-EAPI void                         elm_ctxpopup_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EINA_ARG_NONNULL(1);
+EAPI void                         elm_ctxpopup_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
 
 /**
  * @brief Get the value of current ctxpopup object's orientation.
@@ -115,7 +129,7 @@ EAPI void                         elm_ctxpopup_horizontal_set(Evas_Object *obj,
  *
  * @ingroup Ctxpopup
  */
-EAPI Eina_Bool                    elm_ctxpopup_horizontal_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI Eina_Bool                    elm_ctxpopup_horizontal_get(const Evas_Object *obj);
 
 /**
  * @brief Add a new item to a ctxpopup object.
@@ -130,147 +144,11 @@ EAPI Eina_Bool                    elm_ctxpopup_horizontal_get(const Evas_Object
  * @warning Ctxpopup can't hold both an item list and a content at the same
  * time. When an item is added, any previous content will be removed.
  *
- * @see elm_ctxpopup_content_set()
- *
- * @ingroup Ctxpopup
- */
-Elm_Object_Item                  *elm_ctxpopup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Delete the given item in a ctxpopup object.
- *
- * @param it Ctxpopup item to be deleted
- *
- * @see elm_ctxpopup_item_append()
- *
- * @ingroup Ctxpopup
- */
-EAPI void                         elm_ctxpopup_item_del(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Set the ctxpopup item's state as disabled or enabled.
- *
- * @param it Ctxpopup item to be enabled/disabled
- * @param disabled @c EINA_TRUE to disable it, @c EINA_FALSE to enable it
- *
- * When disabled the item is greyed out to indicate it's state.
- * @deprecated use elm_object_item_disabled_set() instead
- *
- * @ingroup Ctxpopup
- */
-EINA_DEPRECATED EAPI void         elm_ctxpopup_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Get the ctxpopup item's disabled/enabled state.
- *
- * @param it Ctxpopup item to be enabled/disabled
- * @return disabled @c EINA_TRUE, if disabled, @c EINA_FALSE otherwise
- *
- * @see elm_ctxpopup_item_disabled_set()
- * @deprecated use elm_object_item_disabled_get() instead
- *
- * @ingroup Ctxpopup
- */
-EAPI Eina_Bool                    elm_ctxpopup_item_disabled_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Get the icon object for the given ctxpopup item.
- *
- * @param it Ctxpopup item
- * @return icon object or @c NULL, if the item does not have icon or an error
- * occurred
- *
- * @see elm_ctxpopup_item_append()
- * @see elm_ctxpopup_item_icon_set()
- *
- * @deprecated use elm_object_item_part_content_get() instead
- *
- * @ingroup Ctxpopup
- */
-EINA_DEPRECATED EAPI Evas_Object *elm_ctxpopup_item_icon_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Sets the side icon associated with the ctxpopup item
- *
- * @param it Ctxpopup item
- * @param icon Icon object to be set
- *
- * Once the icon object is set, a previously set one will be deleted.
- * @warning Setting the same icon for two items will cause the icon to
- * dissapear from the first item.
- *
- * @see elm_ctxpopup_item_append()
- *
- * @deprecated use elm_object_item_part_content_set() instead
- *
- * @ingroup Ctxpopup
- */
-EINA_DEPRECATED EAPI void         elm_ctxpopup_item_icon_set(Elm_Object_Item *it, Evas_Object *icon) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Get the label for the given ctxpopup item.
- *
- * @param it Ctxpopup item
- * @return label string or @c NULL, if the item does not have label or an
- * error occured
- *
- * @see elm_ctxpopup_item_append()
- * @see elm_ctxpopup_item_label_set()
- *
- * @deprecated use elm_object_item_text_get() instead
- *
- * @ingroup Ctxpopup
- */
-EINA_DEPRECATED EAPI const char  *elm_ctxpopup_item_label_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
-
-/**
- * @brief (Re)set the label on the given ctxpopup item.
- *
- * @param it Ctxpopup item
- * @param label String to set as label
- *
- * @deprecated use elm_object_item_text_set() instead
- *
- * @ingroup Ctxpopup
- */
-EINA_DEPRECATED EAPI void         elm_ctxpopup_item_label_set(Elm_Object_Item *it, const char *label) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Set an elm widget as the content of the ctxpopup.
- *
- * @param obj Ctxpopup object
- * @param content Content to be swallowed
- *
- * If the content object is already set, a previous one will bedeleted. If
- * you want to keep that old content object, use the
- * elm_ctxpopup_content_unset() function.
- *
- * @warning Ctxpopup can't hold both a item list and a content at the same
- * time. When a content is set, any previous items will be removed.
- *
- * @deprecated use elm_object_content_set() instead
- *
- * @ingroup Ctxpopup
- */
-EINA_DEPRECATED EAPI void         elm_ctxpopup_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @brief Unset the ctxpopup content
- *
- * @param obj Ctxpopup object
- * @return The content that was being used
- *
- * Unparent and return the content object which was set for this widget.
- *
- * @deprecated use elm_object_content_unset()
- *
- * @see elm_ctxpopup_content_set()
- *
- * @deprecated use elm_object_content_unset() instead
+ * @see elm_object_content_set()
  *
  * @ingroup Ctxpopup
  */
-EINA_DEPRECATED EAPI Evas_Object *elm_ctxpopup_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI Elm_Object_Item             *elm_ctxpopup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data);
 
 /**
  * @brief Set the direction priority of a ctxpopup.
@@ -289,7 +167,7 @@ EINA_DEPRECATED EAPI Evas_Object *elm_ctxpopup_content_unset(Evas_Object *obj) E
  *
  * @ingroup Ctxpopup
  */
-EAPI void                         elm_ctxpopup_direction_priority_set(Evas_Object *obj, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth) EINA_ARG_NONNULL(1);
+EAPI void                         elm_ctxpopup_direction_priority_set(Evas_Object *obj, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth);
 
 /**
  * @brief Get the direction priority of a ctxpopup.
@@ -304,7 +182,7 @@ EAPI void                         elm_ctxpopup_direction_priority_set(Evas_Objec
  *
  * @ingroup Ctxpopup
  */
-EAPI void                         elm_ctxpopup_direction_priority_get(Evas_Object *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth) EINA_ARG_NONNULL(1);
+EAPI void                         elm_ctxpopup_direction_priority_get(Evas_Object *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth);
 
 /**
  * @brief Get the current direction of a ctxpopup.
@@ -316,7 +194,17 @@ EAPI void                         elm_ctxpopup_direction_priority_get(Evas_Objec
  *
  * @ingroup Ctxpopup
  */
-EAPI Elm_Ctxpopup_Direction       elm_ctxpopup_direction_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI Elm_Ctxpopup_Direction       elm_ctxpopup_direction_get(const Evas_Object *obj);
+
+/**
+ * @brief Dismiss a ctxpopup object
+ *
+ * @param obj The ctxpopup object
+ * Use this function to simulate clicking outside the ctxpopup to dismiss it.
+ * In this way, the ctxpopup will be hidden and the "clicked" signal will be
+ * emitted.
+ */
+EAPI void                         elm_ctxpopup_dismiss(Evas_Object *obj);
 
 /**
  * @}