Photo
Elementary

## Macros

#define | ELM_PHOTO_CLASS elm_photo_class_get()
| Elementary photo class.

## Functions

Evas_Object * | elm_photo_add (Evas_Object *parent)
| Add a new photo to the parent.
Eina_Bool | elm_photo_file_set (Eo *obj, const char *file)
| Set the file that will be used as the photo widget's image.
void | elm_photo_editable_set (Evas_Object *obj, Eina_Bool set)
| Set editability of the photo.
Eina_Bool | elm_photo_editable_get (const Evas_Object *obj)
| Get editability of the photo.
void | elm_photo_fill_inside_set (Evas_Object *obj, Eina_Bool fill)
| Set if the photo should be completely visible or not.
Eina_Bool | elm_photo_fill_inside_get (const Evas_Object *obj)
| Get if the photo should be completely visible or not.
void | elm_photo_aspect_fixed_set (Evas_Object *obj, Eina_Bool fixed)
| Set whether the original aspect ratio of the photo should be kept on resize.
Eina_Bool | elm_photo_aspect_fixed_get (const Evas_Object *obj)
| Get if the object keeps the original aspect ratio.
void | elm_photo_size_set (Evas_Object *obj, int size)
| Set the size that will be used on the photo.
int | elm_photo_size_get (const Evas_Object *obj)
| Get the size that will be used on the photo.
void | elm_photo_thumb_set (Evas_Object *obj, const char *file, const char *group)
| Set the file that will be used as thumbnail in the photo.

## Detailed Description

The Elementary photo widget is intended for displaying a photo, for ex., a person's image (contact). Simple, yet with a very specific purpose. It has a decorative frame around the inner image itself, on the default theme. If and while no photo is set on it, it displays a person icon, indicating it's a photo placeholder.

This widget relies on an internal Icon, so that the APIs of these two widgets are similar (drag and drop is also possible here, for example).

Signals that you can add callbacks for are:

- `"clicked"` - This is called when a user has clicked the photo
- `"drag,start"` - One has started dragging the inner image out of the photo's frame
- `"drag,end"` - One has dropped the dragged image somewhere

## Function Documentation

## elm_photo_add()

Evas_Object * elm_photo_add | ( | Evas_Object * | parent | ) |

Add a new photo to the parent.

Parameters

  parent | The parent object

Returns
  The new object or NULL if it cannot be created

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## elm_photo_file_set()

Eina_Bool elm_photo_file_set | ( | Eo * | obj,
|  | const char * | file )

Set the file that will be used as the photo widget's image.

Returns
  `EINA_TRUE` on success, `EINA_FALSE` otherwise

Note
  Use `NULL` on file to set the photo widget back to it's initial state, which indicates "no photo".

Parameters

  [in] | file | The path to file that will be used as obj's image.

## elm_photo_editable_set()

void elm_photo_editable_set | ( | Evas_Object * | obj,
|  | Eina_Bool | set )

Set editability of the photo.

An editable photo can be dragged to or from, and can be cut or pasted too. Note that pasting an image or dropping an item on the image will delete the existing content.

Parameters

  [in] | set | To set of clear editability.

References elm_image_editable_set().

## elm_photo_editable_get()

Eina_Bool elm_photo_editable_get | ( | const Evas_Object * | obj | ) |

Get editability of the photo.

Returns
  To set of clear editability.

References EINA_FALSE, and elm_image_editable_get().

## elm_photo_fill_inside_set()

void elm_photo_fill_inside_set | ( | Evas_Object * | obj,
|  | Eina_Bool | fill )

Set if the photo should be completely visible or not.

Parameters

  [in] | fill | Photo visibility.

References elm_image_fill_outside_set().

## elm_photo_fill_inside_get()

Eina_Bool elm_photo_fill_inside_get | ( | const Evas_Object * | obj | ) |

Get if the photo should be completely visible or not.

Returns
  Photo visibility.

References EINA_FALSE.

## elm_photo_aspect_fixed_set()

void elm_photo_aspect_fixed_set | ( | Evas_Object * | obj,
|  | Eina_Bool | fixed )

Set whether the original aspect ratio of the photo should be kept on resize.

The original aspect ratio (width / height) of the photo is usually distorted to match the object's size. Enabling this option will fix this original aspect, and the way that the photo is fit into the object's area.

See also elm_photo_aspect_fixed_get.

Parameters

  [in] | fixed | `true` if the photo should fix the aspect, `false` otherwise.

References elm_image_aspect_fixed_set().

## elm_photo_aspect_fixed_get()

Eina_Bool elm_photo_aspect_fixed_get | ( | const Evas_Object * | obj | ) |

Get if the object keeps the original aspect ratio.

Returns
  `true` if the photo should fix the aspect, `false` otherwise.

References EINA_FALSE, and elm_image_aspect_fixed_get().

## elm_photo_size_set()

void elm_photo_size_set | ( | Evas_Object * | obj,
|  | int | size )

Set the size that will be used on the photo.

Parameters

  [in] | size | The size of the photo

References elm_image_prescale_set().

## elm_photo_size_get()

int elm_photo_size_get | ( | const Evas_Object * | obj | ) |

Get the size that will be used on the photo.

Returns
  The size of the photo

## elm_photo_thumb_set()

void elm_photo_thumb_set | ( | Evas_Object * | obj,
|  | const char * | file,
|  | const char * | group )

Set the file that will be used as thumbnail in the photo.

Parameters

  [in] | group | The key used in case of an EET file.

References eina_stringshare_replace(), and elm_icon_thumb_set().