Removed smooth scrolling. Patch by Jiyoun Park <jy0703.park@samsung.com>
[framework/uifw/elementary.git] / src / lib / elm_icon.h
index 23fdb9f..08d6c11 100644 (file)
@@ -1,5 +1,6 @@
 /**
  * @defgroup Icon Icon
+ * @ingroup Elementary
  *
  * @image html img/widget/icon/preview-00.png
  * @image latex img/widget/icon/preview-00.eps
  *
  * "clicked" - This is called when a user has clicked the icon
  *
+ * Supported elm_object common APIs.
+ * @li @ref elm_object_signal_emit
+ * @li @ref elm_object_signal_callback_add
+ * @li @ref elm_object_signal_callback_del
+ *
  * An example of usage for this API follows:
  * @li @ref tutorial_icon
  */
@@ -72,7 +78,7 @@
  * @{
  */
 
-typedef enum _Elm_Icon_Type
+typedef enum
 {
    ELM_ICON_NONE,
    ELM_ICON_FILE,
@@ -88,7 +94,7 @@ typedef enum _Elm_Icon_Type
  *
  * @ingroup Icon
  */
-typedef enum _Elm_Icon_Lookup_Order
+typedef enum
 {
    ELM_ICON_LOOKUP_FDO_THEME, /**< icon look up order: freedesktop, theme */
    ELM_ICON_LOOKUP_THEME_FDO, /**< icon look up order: theme, freedesktop */
@@ -106,9 +112,7 @@ typedef enum _Elm_Icon_Lookup_Order
  *
  * @ingroup Icon
  */
-EAPI Evas_Object *
-                           elm_icon_add(Evas_Object *parent)
-EINA_ARG_NONNULL(1);
+EAPI Evas_Object          *elm_icon_add(Evas_Object *parent);
 
 /**
  * Set the file that will be used as icon.
@@ -126,7 +130,7 @@ EINA_ARG_NONNULL(1);
  *
  * @ingroup Icon
  */
-EAPI Eina_Bool             elm_icon_file_set(Evas_Object *obj, const char *file, const char *group) EINA_ARG_NONNULL(1, 2);
+EAPI Eina_Bool             elm_icon_file_set(Evas_Object *obj, const char *file, const char *group);
 
 /**
  * Set a location in memory to be used as an icon
@@ -149,7 +153,7 @@ EAPI Eina_Bool             elm_icon_file_set(Evas_Object *obj, const char *file,
  *
  * @ingroup Icon
  */
-EAPI Eina_Bool             elm_icon_memfile_set(Evas_Object *obj, const void *img, size_t size, const char *format, const char *key) EINA_ARG_NONNULL(1, 2);
+EAPI Eina_Bool             elm_icon_memfile_set(Evas_Object *obj, const void *img, size_t size, const char *format, const char *key);
 
 /**
  * Get the file that will be used as icon.
@@ -162,7 +166,7 @@ EAPI Eina_Bool             elm_icon_memfile_set(Evas_Object *obj, const void *im
  *
  * @ingroup Icon
  */
-EAPI void                  elm_icon_file_get(const Evas_Object *obj, const char **file, const char **group) EINA_ARG_NONNULL(1);
+EAPI void                  elm_icon_file_get(const Evas_Object *obj, const char **file, const char **group);
 
 /**
  * Set the file that will be used, but use a generated thumbnail.
@@ -181,7 +185,7 @@ EAPI void                  elm_icon_file_get(const Evas_Object *obj, const char
  *
  * @ingroup Icon
  */
-EAPI void                  elm_icon_thumb_set(Evas_Object *obj, const char *file, const char *group) EINA_ARG_NONNULL(1, 2);
+EAPI void                  elm_icon_thumb_set(Evas_Object *obj, const char *file, const char *group);
 
 /**
  * Set the icon by icon standards names.
@@ -208,7 +212,7 @@ EAPI void                  elm_icon_thumb_set(Evas_Object *obj, const char *file
  *
  * @ingroup Icon
  */
-EAPI Eina_Bool             elm_icon_standard_set(Evas_Object *obj, const char *name) EINA_ARG_NONNULL(1);
+EAPI Eina_Bool             elm_icon_standard_set(Evas_Object *obj, const char *name);
 
 /**
  * Get the icon name set by icon standard names.
@@ -223,7 +227,7 @@ EAPI Eina_Bool             elm_icon_standard_set(Evas_Object *obj, const char *n
  *
  * @ingroup Icon
  */
-EAPI const char           *elm_icon_standard_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI const char           *elm_icon_standard_get(const Evas_Object *obj);
 
 /**
  * Set the smooth scaling for an icon object.
@@ -244,7 +248,7 @@ EAPI const char           *elm_icon_standard_get(const Evas_Object *obj) EINA_AR
  *
  * @ingroup Icon
  */
-EAPI void                  elm_icon_smooth_set(Evas_Object *obj, Eina_Bool smooth) EINA_ARG_NONNULL(1);
+EAPI void                  elm_icon_smooth_set(Evas_Object *obj, Eina_Bool smooth);
 
 /**
  * Get whether smooth scaling is enabled for an icon object.
@@ -256,7 +260,7 @@ EAPI void                  elm_icon_smooth_set(Evas_Object *obj, Eina_Bool smoot
  *
  * @ingroup Icon
  */
-EAPI Eina_Bool             elm_icon_smooth_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI Eina_Bool             elm_icon_smooth_get(const Evas_Object *obj);
 
 /**
  * Disable scaling of this object.
@@ -268,15 +272,15 @@ EAPI Eina_Bool             elm_icon_smooth_get(const Evas_Object *obj) EINA_ARG_
  * This function disables scaling of the icon object through the function
  * elm_object_scale_set(). However, this does not affect the object
  * size/resize in any way. For that effect, take a look at
- * elm_icon_scale_set().
+ * elm_icon_resizable_set().
  *
  * @see elm_icon_no_scale_get()
- * @see elm_icon_scale_set()
+ * @see elm_icon_resizable_set()
  * @see elm_object_scale_set()
  *
  * @ingroup Icon
  */
-EAPI void                  elm_icon_no_scale_set(Evas_Object *obj, Eina_Bool no_scale) EINA_ARG_NONNULL(1);
+EAPI void                  elm_icon_no_scale_set(Evas_Object *obj, Eina_Bool no_scale);
 
 /**
  * Get whether scaling is disabled on the object.
@@ -288,39 +292,39 @@ EAPI void                  elm_icon_no_scale_set(Evas_Object *obj, Eina_Bool no_
  *
  * @ingroup Icon
  */
-EAPI Eina_Bool             elm_icon_no_scale_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI Eina_Bool             elm_icon_no_scale_get(const Evas_Object *obj);
 
 /**
  * Set if the object is (up/down) resizable.
  *
  * @param obj The icon object
- * @param scale_up A bool to set if the object is resizable up. Default is
+ * @param size_up A bool to set if the object is resizable up. Default is
  * @c EINA_TRUE.
- * @param scale_down A bool to set if the object is resizable down. Default
+ * @param size_down A bool to set if the object is resizable down. Default
  * is @c EINA_TRUE.
  *
- * This function limits the icon object resize ability. If @p scale_up is set to
+ * This function limits the icon object resize ability. If @p size_up is set to
  * @c EINA_FALSE, the object can't have its height or width resized to a value
- * higher than the original icon size. Same is valid for @p scale_down.
+ * higher than the original icon size. Same is valid for @p size_down.
  *
- * @see elm_icon_scale_get()
+ * @see elm_icon_resizable_get()
  *
  * @ingroup Icon
  */
-EAPI void                  elm_icon_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down) EINA_ARG_NONNULL(1);
+EAPI void                  elm_icon_resizable_set(Evas_Object *obj, Eina_Bool size_up, Eina_Bool size_down);
 
 /**
  * Get if the object is (up/down) resizable.
  *
  * @param obj The icon object
- * @param scale_up A bool to set if the object is resizable up
- * @param scale_down A bool to set if the object is resizable down
+ * @param size_up A bool to set if the object is resizable up
+ * @param size_down A bool to set if the object is resizable down
  *
- * @see elm_icon_scale_set()
+ * @see elm_icon_resizable_set()
  *
  * @ingroup Icon
  */
-EAPI void                  elm_icon_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down) EINA_ARG_NONNULL(1);
+EAPI void                  elm_icon_resizable_get(const Evas_Object *obj, Eina_Bool *size_up, Eina_Bool *size_down);
 
 /**
  * Get the object's image size
@@ -331,7 +335,7 @@ EAPI void                  elm_icon_scale_get(const Evas_Object *obj, Eina_Bool
  *
  * @ingroup Icon
  */
-EAPI void                  elm_icon_size_get(const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1);
+EAPI void                  elm_icon_size_get(const Evas_Object *obj, int *w, int *h);
 
 /**
  * Set if the icon fill the entire object area.
@@ -357,7 +361,7 @@ EAPI void                  elm_icon_size_get(const Evas_Object *obj, int *w, int
  *
  * @ingroup Icon
  */
-EAPI void                  elm_icon_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside) EINA_ARG_NONNULL(1);
+EAPI void                  elm_icon_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside);
 
 /**
  * Get if the object is filled outside.
@@ -369,7 +373,7 @@ EAPI void                  elm_icon_fill_outside_set(Evas_Object *obj, Eina_Bool
  *
  * @ingroup Icon
  */
-EAPI Eina_Bool             elm_icon_fill_outside_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI Eina_Bool             elm_icon_fill_outside_get(const Evas_Object *obj);
 
 /**
  * Set the prescale size for the icon.
@@ -393,7 +397,7 @@ EAPI Eina_Bool             elm_icon_fill_outside_get(const Evas_Object *obj) EIN
  *
  * @ingroup Icon
  */
-EAPI void                  elm_icon_prescale_set(Evas_Object *obj, int size) EINA_ARG_NONNULL(1);
+EAPI void                  elm_icon_prescale_set(Evas_Object *obj, int size);
 
 /**
  * Get the prescale size for the icon.
@@ -405,7 +409,7 @@ EAPI void                  elm_icon_prescale_set(Evas_Object *obj, int size) EIN
  *
  * @ingroup Icon
  */
-EAPI int                   elm_icon_prescale_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI int                   elm_icon_prescale_get(const Evas_Object *obj);
 
 /**
  * Gets the image object of the icon. DO NOT MODIFY THIS.
@@ -415,7 +419,7 @@ EAPI int                   elm_icon_prescale_get(const Evas_Object *obj) EINA_AR
  *
  * @ingroup Icon
  */
-EAPI Evas_Object          *elm_icon_object_get(Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI Evas_Object          *elm_icon_object_get(Evas_Object *obj);
 
 /**
  * Sets the icon lookup order used by elm_icon_standard_set().
@@ -430,7 +434,7 @@ EAPI Evas_Object          *elm_icon_object_get(Evas_Object *obj) EINA_ARG_NONNUL
  *
  * @ingroup Icon
  */
-EAPI void                  elm_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order) EINA_ARG_NONNULL(1);
+EAPI void                  elm_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order);
 
 /**
  * Gets the icon lookup order.
@@ -443,16 +447,16 @@ EAPI void                  elm_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_
  *
  * @ingroup Icon
  */
-EAPI Elm_Icon_Lookup_Order elm_icon_order_lookup_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI Elm_Icon_Lookup_Order elm_icon_order_lookup_get(const Evas_Object *obj);
 
 /**
  * Enable or disable preloading of the icon
  *
  * @param obj The icon object
- * @param disable If EINA_TRUE, preloading will be disabled
+ * @param disabled If EINA_TRUE, preloading will be disabled
  * @ingroup Icon
  */
-EAPI void                  elm_icon_preload_set(Evas_Object *obj, Eina_Bool disable) EINA_ARG_NONNULL(1);
+EAPI void                  elm_icon_preload_disabled_set(Evas_Object *obj, Eina_Bool disabled);
 
 /**
  * Get if the icon supports animation or not.
@@ -463,16 +467,16 @@ EAPI void                  elm_icon_preload_set(Evas_Object *obj, Eina_Bool disa
  *
  * Return if this elm icon's image can be animated. Currently Evas only
  * supports gif animation. If the return value is EINA_FALSE, other
- * elm_icon_animated_XXX APIs won't work.
+ * elm_icon_animated_xxx APIs won't work.
  * @ingroup Icon
  */
-EAPI Eina_Bool             elm_icon_animated_available_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI Eina_Bool             elm_icon_animated_available_get(const Evas_Object *obj);
 
 /**
  * Set animation mode of the icon.
  *
  * @param obj The icon object
- * @param anim @c EINA_TRUE if the object do animation job,
+ * @param animated @c EINA_TRUE if the object do animation job,
  * @c EINA_FALSE otherwise. Default is @c EINA_FALSE.
  *
  * Since the default animation mode is set to EINA_FALSE,
@@ -482,7 +486,7 @@ EAPI Eina_Bool             elm_icon_animated_available_get(const Evas_Object *ob
  * Set it to EINA_TRUE when the icon needs to be animated.
  * @ingroup Icon
  */
-EAPI void                  elm_icon_animated_set(Evas_Object *obj, Eina_Bool animated) EINA_ARG_NONNULL(1);
+EAPI void                  elm_icon_animated_set(Evas_Object *obj, Eina_Bool animated);
 
 /**
  * Get animation mode of the icon.
@@ -492,7 +496,7 @@ EAPI void                  elm_icon_animated_set(Evas_Object *obj, Eina_Bool ani
  * @see elm_icon_animated_set
  * @ingroup Icon
  */
-EAPI Eina_Bool             elm_icon_animated_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI Eina_Bool             elm_icon_animated_get(const Evas_Object *obj);
 
 /**
  * Set animation play mode of the icon.
@@ -501,7 +505,7 @@ EAPI Eina_Bool             elm_icon_animated_get(const Evas_Object *obj) EINA_AR
  * @param play @c EINA_TRUE the object play animation images,
  * @c EINA_FALSE otherwise. Default is @c EINA_FALSE.
  *
- * To play elm icon's animation, set play to EINA_TURE.
+ * To play elm icon's animation, set play to EINA_TRUE.
  * For example, you make gif player using this set/get API and click event.
  * This literally lets you control current play or paused state. To have
  * this work with animated GIF files for example, you first, before
@@ -509,12 +513,12 @@ EAPI Eina_Bool             elm_icon_animated_get(const Evas_Object *obj) EINA_AR
  * at all on the icon.
  *
  * 1. Click event occurs
- * 2. Check play flag using elm_icon_animaged_play_get
+ * 2. Check play flag using elm_icon_animated_play_get
  * 3. If elm icon was playing, set play to EINA_FALSE.
  *    Then animation will be stopped and vice versa
  * @ingroup Icon
  */
-EAPI void                  elm_icon_animated_play_set(Evas_Object *obj, Eina_Bool play) EINA_ARG_NONNULL(1);
+EAPI void                  elm_icon_animated_play_set(Evas_Object *obj, Eina_Bool play);
 
 /**
  * Get animation play mode of the icon.
@@ -525,7 +529,37 @@ EAPI void                  elm_icon_animated_play_set(Evas_Object *obj, Eina_Boo
  * @see elm_icon_animated_play_get
  * @ingroup Icon
  */
-EAPI Eina_Bool             elm_icon_animated_play_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+EAPI Eina_Bool             elm_icon_animated_play_get(const Evas_Object *obj);
+
+/**
+ * Set whether the original aspect ratio of the icon should be kept on resize.
+ *
+ * @param obj The icon object.
+ * @param fixed @c EINA_TRUE if the icon should retain the aspect,
+ * @c EINA_FALSE otherwise.
+ *
+ * The original aspect ratio (width / height) of the icon is usually
+ * distorted to match the object's size. Enabling this option will retain
+ * this original aspect, and the way that the icon is fit into the object's
+ * area depends on the option set by elm_icon_fill_outside_set().
+ *
+ * @see elm_icon_aspect_fixed_get()
+ * @see elm_icon_fill_outside_set()
+ *
+ * @ingroup Icon
+ */
+EAPI void             elm_icon_aspect_fixed_set(Evas_Object *obj, Eina_Bool fixed);
+
+/**
+ * Get if the object retains the original aspect ratio.
+ *
+ * @param obj The icon object.
+ * @return @c EINA_TRUE if the object keeps the original aspect, @c EINA_FALSE
+ * otherwise.
+ *
+ * @ingroup Icon
+ */
+EAPI Eina_Bool        elm_icon_aspect_fixed_get(const Evas_Object *obj);
 
 /**
  * @}