2 * @defgroup Image Image
4 * @image html img/widget/image/preview-00.png
5 * @image latex img/widget/image/preview-00.eps
8 * An object that allows one to load an image file to it. It can be used
9 * anywhere like any other elementary widget.
11 * This widget provides most of the functionality provided from @ref Bg or @ref
12 * Icon, but with a slightly different API (use the one that fits better your
15 * The features not provided by those two other image widgets are:
16 * @li allowing to get the basic @c Evas_Object with elm_image_object_get();
17 * @li change the object orientation with elm_image_orient_set();
18 * @li and turning the image editable with elm_image_editable_set().
20 * Signals that you can add callbacks for are:
22 * @li @c "clicked" - This is called when a user has clicked the image
24 * An example of usage for this API follows:
25 * @li @ref tutorial_image
34 * Possible orientation options for elm_image_orient_set().
36 * @image html elm_image_orient_set.png
37 * @image latex elm_image_orient_set.eps width=\textwidth
43 ELM_IMAGE_ORIENT_NONE = 0, /**< no orientation change */
44 ELM_IMAGE_ORIENT_0 = 0, /**< no orientation change */
45 ELM_IMAGE_ROTATE_90 = 1, /**< rotate 90 degrees clockwise */
46 ELM_IMAGE_ROTATE_180 = 2, /**< rotate 180 degrees clockwise */
47 ELM_IMAGE_ROTATE_270 = 3, /**< rotate 90 degrees counter-clockwise (i.e. 270 degrees clockwise) */
48 ELM_IMAGE_FLIP_HORIZONTAL = 4, /**< flip image horizontally */
49 ELM_IMAGE_FLIP_VERTICAL = 5, /**< flip image vertically */
50 ELM_IMAGE_FLIP_TRANSPOSE = 6, /**< flip the image along the y = (width - x) line (bottom-left to top-right) */
51 ELM_IMAGE_FLIP_TRANSVERSE = 7 /**< flip the image along the y = x line (top-left to bottom-right) */
55 * Add a new image to the parent.
57 * @param parent The parent object
58 * @return The new object or NULL if it cannot be created
60 * @see elm_image_file_set()
64 EAPI Evas_Object *elm_image_add(Evas_Object *parent);
67 * Set the file that will be used as image.
69 * @param obj The image object
70 * @param file The path to file that will be used as image
71 * @param group The group that the image belongs in edje file (if it's an
74 * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
76 * @see elm_image_file_get()
80 EAPI Eina_Bool elm_image_file_set(Evas_Object *obj, const char *file, const char *group);
83 * Get the file that will be used as image.
85 * @param obj The image object
86 * @param file The path to file
87 * @param group The group that the image belongs in edje file
89 * @see elm_image_file_set()
93 EAPI void elm_image_file_get(const Evas_Object *obj, const char **file, const char **group);
96 * Set the smooth effect for an image.
98 * @param obj The image object
99 * @param smooth @c EINA_TRUE if smooth scaling should be used, @c EINA_FALSE
100 * otherwise. Default is @c EINA_TRUE.
102 * Set the scaling algorithm to be used when scaling the image. Smooth
103 * scaling provides a better resulting image, but is slower.
105 * The smooth scaling should be disabled when making animations that change
106 * the image size, since it will be faster. Animations that don't require
107 * resizing of the image can keep the smooth scaling enabled (even if the
108 * image is already scaled, since the scaled image will be cached).
110 * @see elm_image_smooth_get()
114 EAPI void elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth);
117 * Get the smooth effect for an image.
119 * @param obj The image object
120 * @return @c EINA_TRUE if smooth scaling is enabled, @c EINA_FALSE otherwise.
122 * @see elm_image_smooth_get()
126 EAPI Eina_Bool elm_image_smooth_get(const Evas_Object *obj);
129 * Gets the current size of the image.
131 * @param obj The image object.
132 * @param w Pointer to store width, or NULL.
133 * @param h Pointer to store height, or NULL.
135 * This is the real size of the image, not the size of the object.
138 * On error, neither w and h will be fileld with 0.
141 >>>>>>> remotes/origin/upstream
144 EAPI void elm_image_object_size_get(const Evas_Object *obj, int *w, int *h);
147 * Disable scaling of this object.
149 * @param obj The image object.
150 * @param no_scale @c EINA_TRUE if the object is not scalable, @c EINA_FALSE
151 * otherwise. Default is @c EINA_FALSE.
153 * This function disables scaling of the elm_image widget through the
154 * function elm_object_scale_set(). However, this does not affect the widget
155 * size/resize in any way. For that effect, take a look at
157 * elm_image_scale_set().
159 * @see elm_image_no_scale_get()
160 * @see elm_image_scale_set()
162 * elm_image_resizable_set().
164 * @see elm_image_no_scale_get()
165 * @see elm_image_resizable_set()
166 >>>>>>> remotes/origin/upstream
167 * @see elm_object_scale_set()
171 EAPI void elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale);
174 * Get whether scaling is disabled on the object.
176 * @param obj The image object
177 * @return @c EINA_TRUE if scaling is disabled, @c EINA_FALSE otherwise
179 * @see elm_image_no_scale_set()
183 EAPI Eina_Bool elm_image_no_scale_get(const Evas_Object *obj);
186 * Set if the object is (up/down) resizable.
188 * @param obj The image object
190 * @param scale_up A bool to set if the object is resizable up. Default is
192 * @param scale_down A bool to set if the object is resizable down. Default
195 * This function limits the image resize ability. If @p scale_up is set to
196 * @c EINA_FALSE, the object can't have its height or width resized to a value
197 * higher than the original image size. Same is valid for @p scale_down.
199 * @see elm_image_scale_get()
203 EAPI void elm_image_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down);
205 * @param size_up A bool to set if the object is resizable up. Default is
207 * @param size_down A bool to set if the object is resizable down. Default
210 * This function limits the image resize ability. If @p size_up is set to
211 * @c EINA_FALSE, the object can't have its height or width resized to a value
212 * higher than the original image size. Same is valid for @p size_down.
214 * @see elm_image_resizable_get()
218 EAPI void elm_image_resizable_set(Evas_Object *obj, Eina_Bool size_up, Eina_Bool size_down);
219 >>>>>>> remotes/origin/upstream
222 * Get if the object is (up/down) resizable.
224 * @param obj The image object
226 * @param scale_up A bool to set if the object is resizable up
227 * @param scale_down A bool to set if the object is resizable down
229 * @see elm_image_scale_set()
233 EAPI void elm_image_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down);
235 * @param size_up A bool to set if the object is resizable up
236 * @param size_down A bool to set if the object is resizable down
238 * @see elm_image_resizable_set()
242 EAPI void elm_image_resizable_get(const Evas_Object *obj, Eina_Bool *size_up, Eina_Bool *size_down);
243 >>>>>>> remotes/origin/upstream
246 * Set if the image fills the entire object area, when keeping the aspect ratio.
248 * @param obj The image object
249 * @param fill_outside @c EINA_TRUE if the object is filled outside,
250 * @c EINA_FALSE otherwise. Default is @c EINA_FALSE.
252 * When the image should keep its aspect ratio even if resized to another
253 * aspect ratio, there are two possibilities to resize it: keep the entire
254 * image inside the limits of height and width of the object (@p fill_outside
255 * is @c EINA_FALSE) or let the extra width or height go outside of the object,
256 * and the image will fill the entire object (@p fill_outside is @c EINA_TRUE).
258 * @note This option will have no effect if
259 * elm_image_aspect_fixed_set() is set to @c EINA_FALSE.
261 * @see elm_image_fill_outside_get()
262 * @see elm_image_aspect_fixed_set()
266 EAPI void elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside);
269 * Get if the object is filled outside
271 * @param obj The image object
272 * @return @c EINA_TRUE if the object is filled outside, @c EINA_FALSE otherwise.
274 * @see elm_image_fill_outside_set()
278 EAPI Eina_Bool elm_image_fill_outside_get(const Evas_Object *obj);
283 * Enable or disable preloading of the image
285 * @param obj The image object
286 * @param disabled If EINA_TRUE, preloading will be disabled
289 EAPI void elm_image_preload_disabled_set(Evas_Object *obj, Eina_Bool disabled);
292 >>>>>>> remotes/origin/upstream
293 * Set the prescale size for the image
295 * @param obj The image object
296 * @param size The prescale size. This value is used for both width and
299 * This function sets a new size for pixmap representation of the given
300 * image. It allows the image to be loaded already in the specified size,
301 * reducing the memory usage and load time when loading a big image with load
302 * size set to a smaller size.
304 * It's equivalent to the elm_bg_load_size_set() function for bg.
306 * @note this is just a hint, the real size of the pixmap may differ
307 * depending on the type of image being loaded, being bigger than requested.
309 * @see elm_image_prescale_get()
310 * @see elm_bg_load_size_set()
314 EAPI void elm_image_prescale_set(Evas_Object *obj, int size);
317 * Get the prescale size for the image
319 * @param obj The image object
320 * @return The prescale size
322 * @see elm_image_prescale_set()
326 EAPI int elm_image_prescale_get(const Evas_Object *obj);
329 * Set the image orientation.
331 * @param obj The image object
332 * @param orient The image orientation @ref Elm_Image_Orient
333 * Default is #ELM_IMAGE_ORIENT_NONE.
335 * This function allows to rotate or flip the given image.
337 * @see elm_image_orient_get()
338 * @see @ref Elm_Image_Orient
342 EAPI void elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient);
345 * Get the image orientation.
347 * @param obj The image object
348 * @return The image orientation @ref Elm_Image_Orient
350 * @see elm_image_orient_set()
351 * @see @ref Elm_Image_Orient
355 EAPI Elm_Image_Orient elm_image_orient_get(const Evas_Object *obj);
358 * Make the image 'editable'.
360 * @param obj Image object.
361 * @param set Turn on or off editability. Default is @c EINA_FALSE.
363 * This means the image is a valid drag target for drag and drop, and can be
368 EAPI void elm_image_editable_set(Evas_Object *obj, Eina_Bool set);
372 * Check if the image 'editable'.
374 * Check if the image is 'editable'.
375 >>>>>>> remotes/origin/upstream
377 * @param obj Image object.
378 * @return Editability.
380 * A return value of EINA_TRUE means the image is a valid drag target
381 * for drag and drop, and can be cut or pasted too.
385 EAPI Eina_Bool elm_image_editable_get(const Evas_Object *obj);
389 * Get the basic Evas_Image object from this object (widget).
391 * Get the inlined image object of the image widget.
392 >>>>>>> remotes/origin/upstream
394 * @param obj The image object to get the inlined image from
395 * @return The inlined image object, or NULL if none exists
397 * This function allows one to get the underlying @c Evas_Object of type
398 * Image from this elementary widget. It can be useful to do things like get
399 * the pixel data, save the image to a file, etc.
401 * @note Be careful to not manipulate it, as it is under control of
406 EAPI Evas_Object *elm_image_object_get(const Evas_Object *obj);
409 * Set whether the original aspect ratio of the image should be kept on resize.
411 * @param obj The image object.
412 * @param fixed @c EINA_TRUE if the image should retain the aspect,
413 * @c EINA_FALSE otherwise.
415 * The original aspect ratio (width / height) of the image is usually
416 * distorted to match the object's size. Enabling this option will retain
417 * this original aspect, and the way that the image is fit into the object's
418 * area depends on the option set by elm_image_fill_outside_set().
420 * @see elm_image_aspect_fixed_get()
421 * @see elm_image_fill_outside_set()
425 EAPI void elm_image_aspect_fixed_set(Evas_Object *obj, Eina_Bool fixed);
428 * Get if the object retains the original aspect ratio.
430 * @param obj The image object.
431 * @return @c EINA_TRUE if the object keeps the original aspect, @c EINA_FALSE
436 EAPI Eina_Bool elm_image_aspect_fixed_get(const Evas_Object *obj);