add object_item_tooltip api
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 4 Jan 2012 00:15:03 +0000 (00:15 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 4 Jan 2012 00:15:03 +0000 (00:15 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@66816 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/Elementary.h.in
src/lib/elm_main.c
src/lib/elm_object_item.h

index 721c6de..bc2f300 100644 (file)
@@ -149,8 +149,8 @@ EAPI extern Elm_Version *elm_version;
 
 /* include these first for general used definitions */
 #include <elm_general.h>
-#include <elm_object_item.h>
 #include <elm_tooltip.h>
+#include <elm_object_item.h>
 
 /* special widgets - types used elsewhere */
 #include <elm_icon.h>
index e46e608..e165b8d 100644 (file)
@@ -2133,3 +2133,40 @@ EAPI void elm_object_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb del_cb)
 {
    _elm_widget_item_del_cb_set((Elm_Widget_Item *) it, del_cb);
 }
+
+EAPI void
+elm_object_item_tooltip_content_cb_set(Elm_Object_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb)
+{
+   elm_widget_item_tooltip_content_cb_set(item, func, data, del_cb);
+}
+
+EAPI void
+elm_object_item_tooltip_unset(Elm_Object_Item *item)
+{
+   elm_widget_item_tooltip_unset(item);
+}
+
+EAPI Eina_Bool
+elm_object_item_tooltip_window_mode_set(Elm_Object_Item *item, Eina_Bool disable)
+{
+   return elm_widget_item_tooltip_window_mode_set(item, disable);
+}
+
+EAPI Eina_Bool
+elm_object_item_tooltip_window_mode_get(const Elm_Object_Item *item)
+{
+   return elm_widget_item_tooltip_window_mode_get(item);
+}
+
+EAPI void
+elm_object_item_tooltip_style_set(Elm_Object_Item *item, const char *style)
+{
+   elm_widget_item_tooltip_style_set(item, style);
+}
+
+EAPI const char *
+elm_object_item_tooltip_style_get(const Elm_Object_Item *item)
+{
+   return elm_widget_item_tooltip_style_get(item);
+}
+
index 5b0d025..c3eac84 100644 (file)
@@ -183,3 +183,112 @@ EAPI void                         elm_object_item_del_cb_set(Elm_Object_Item *it
 
 // XXX: One more API is to be added.
 //EAPI void                       elm_object_item_del(Elm_Object_Item *it);
+
+
+/**
+ * Set the text to be shown in a given object item's tooltips.
+ *
+ * @param item Target item.
+ * @param text The text to set in the content.
+ *
+ * Setup the text as tooltip to object. The item can have only one tooltip,
+ * so any previous tooltip data - set with this function or
+ * elm_object_item_tooltip_content_cb_set() - is removed.
+ *
+ * @see elm_object_tooltip_text_set() for more details.
+ *
+ * @ingroup General
+ */
+EAPI void                         elm_object_item_tooltip_text_set(Elm_Object_Item *item, const char *text);
+
+/**
+ * @brief Disable size restrictions on an object's tooltip
+ * @param item The tooltip's anchor object
+ * @param disable If EINA_TRUE, size restrictions are disabled
+ * @return EINA_FALSE on failure, EINA_TRUE on success
+ *
+ * This function allows a tooltip to expand beyond its parant window's canvas.
+ * It will instead be limited only by the size of the display.
+ */
+EAPI Eina_Bool                    elm_object_item_tooltip_window_mode_set(Elm_Object_Item *item, Eina_Bool disable);
+
+/**
+ * @brief Retrieve size restriction state of an object's tooltip
+ * @param obj The tooltip's anchor object
+ * @return If EINA_TRUE, size restrictions are disabled
+ *
+ * This function returns whether a tooltip is allowed to expand beyond
+ * its parant window's canvas.
+ * It will instead be limited only by the size of the display.
+ */
+EAPI Eina_Bool                    elm_object_item_tooltip_window_mode_get(const Elm_Object_Item *item);
+
+/**
+ * Set the content to be shown in the tooltip item.
+ *
+ * Setup the tooltip to item. The item can have only one tooltip,
+ * so any previous tooltip data is removed. @p func(with @p data) will
+ * be called every time that need show the tooltip and it should
+ * return a valid Evas_Object. This object is then managed fully by
+ * tooltip system and is deleted when the tooltip is gone.
+ *
+ * @param item the object item being attached a tooltip.
+ * @param func the function used to create the tooltip contents.
+ * @param data what to provide to @a func as callback data/context.
+ * @param del_cb called when data is not needed anymore, either when
+ *        another callback replaces @a func, the tooltip is unset with
+ *        elm_object_item_tooltip_unset() or the owner @a item
+ *        dies. This callback receives as the first parameter the
+ *        given @a data, and @c event_info is the item.
+ *
+ * @see elm_object_tooltip_content_cb_set() for more details.
+ *
+ * @ingroup General
+ */
+EAPI void                         elm_object_item_tooltip_content_cb_set(Elm_Object_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb);
+
+/**
+ * Unset tooltip from item.
+ *
+ * @param item object item to remove previously set tooltip.
+ *
+ * Remove tooltip from item. The callback provided as del_cb to
+ * elm_object_item_tooltip_content_cb_set() will be called to notify
+ * it is not used anymore.
+ *
+ * @see elm_object_tooltip_unset() for more details.
+ * @see elm_object_item_tooltip_content_cb_set()
+ *
+ * @ingroup General
+ */
+EAPI void                         elm_object_item_tooltip_unset(Elm_Object_Item *item);
+
+/**
+ * Sets a different style for this item tooltip.
+ *
+ * @note before you set a style you should define a tooltip with
+ *       elm_object_item_tooltip_content_cb_set() or
+ *       elm_object_item_tooltip_text_set()
+ *
+ * @param item object item with tooltip already set.
+ * @param style the theme style to use (default, transparent, ...)
+ *
+ * @see elm_object_tooltip_style_set() for more details.
+ *
+ * @ingroup General
+ */
+EAPI void                         elm_object_item_tooltip_style_set(Elm_Object_Item *item, const char *style);
+
+/**
+ * Get the style for this item tooltip.
+ *
+ * @param item object item with tooltip already set.
+ * @return style the theme style in use, defaults to "default". If the
+ *         object does not have a tooltip set, then NULL is returned.
+ *
+ * @see elm_object_tooltip_style_get() for more details.
+ * @see elm_object_item_tooltip_style_set()
+ *
+ * @ingroup General
+ */
+EAPI const char                  *elm_object_item_tooltip_style_get(const Elm_Object_Item *item);