2 * @defgroup Photocam Photocam
5 * @image html img/widget/photocam/preview-00.png
6 * @image latex img/widget/photocam/preview-00.eps
8 * This is a widget specifically for displaying high-resolution digital
9 * camera photos giving speedy feedback (fast load), low memory footprint
10 * and zooming and panning as well as fitting logic. It is entirely focused
11 * on jpeg images, and takes advantage of properties of the jpeg format (via
12 * evas loader features in the jpeg loader).
14 * Signals that you can add callbacks for are:
15 * @li "clicked" - This is called when a user has clicked the photo without
17 * @li "press" - This is called when a user has pressed down on the photo.
18 * @li "longpressed" - This is called when a user has pressed down on the
19 * photo for a long time without dragging around.
20 * @li "clicked,double" - This is called when a user has double-clicked the
22 * @li "load" - Photo load begins.
23 * @li "loaded" - This is called when the image file load is complete for the
24 * first view (low resolution blurry version).
25 * @li "load,detail" - Photo detailed data load begins.
26 * @li "loaded,detail" - This is called when the image file load is complete
27 * for the detailed image data (full resolution needed).
28 * @li "zoom,start" - Zoom animation started.
29 * @li "zoom,stop" - Zoom animation stopped.
30 * @li "zoom,change" - Zoom changed when using an auto zoom mode.
31 * @li "scroll" - the content has been scrolled (moved)
32 * @li "scroll,anim,start" - scrolling animation has started
33 * @li "scroll,anim,stop" - scrolling animation has stopped
34 * @li "scroll,drag,start" - dragging the contents around has started
35 * @li "scroll,drag,stop" - dragging the contents around has stopped
37 * @ref tutorial_photocam shows the API in action.
42 * @brief Types of zoom available.
46 ELM_PHOTOCAM_ZOOM_MODE_MANUAL = 0, /**< Zoom controlled normally by elm_photocam_zoom_set */
47 ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT, /**< Zoom until photo fits in photocam */
48 ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL, /**< Zoom until photo fills photocam */
49 ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT_IN, /**< Zoom in until photo fits in photocam */
50 ELM_PHOTOCAM_ZOOM_MODE_LAST
51 } Elm_Photocam_Zoom_Mode;
54 * @brief Add a new Photocam object
56 * @param parent The parent object
57 * @return The new object or NULL if it cannot be created
61 EAPI Evas_Object *elm_photocam_add(Evas_Object *parent);
64 * @brief Set the photo file to be shown
66 * @param obj The photocam object
67 * @param file The photo file
68 * @return The return error (see EVAS_LOAD_ERROR_NONE, EVAS_LOAD_ERROR_GENERIC etc.)
70 * This sets (and shows) the specified file (with a relative or absolute
71 * path) and will return a load error (same error that
72 * evas_object_image_load_error_get() will return). The image will change and
73 * adjust its size at this point and begin a background load process for this
74 * photo that at some time in the future will be displayed at the full
79 EAPI Evas_Load_Error elm_photocam_file_set(Evas_Object *obj, const char *file);
82 * @brief Returns the path of the current image file
84 * @param obj The photocam object
85 * @return Returns the path
87 * @see elm_photocam_file_set()
91 EAPI const char *elm_photocam_file_get(const Evas_Object *obj);
94 * @brief Set the zoom level of the photo
96 * @param obj The photocam object
97 * @param zoom The zoom level to set
99 * This sets the zoom level. 1 will be 1:1 pixel for pixel. 2 will be 2:1
100 * (that is 2x2 photo pixels will display as 1 on-screen pixel). 4:1 will be
101 * 4x4 photo pixels as 1 screen pixel, and so on. The @p zoom parameter must
102 * be greater than 0. It is suggested to stick to powers of 2. (1, 2, 4, 8,
107 EAPI void elm_photocam_zoom_set(Evas_Object *obj, double zoom);
110 * @brief Get the zoom level of the photo
112 * @param obj The photocam object
113 * @return The current zoom level
115 * This returns the current zoom level of the photocam object. Note that if
116 * you set the fill mode to other than ELM_PHOTOCAM_ZOOM_MODE_MANUAL
117 * (which is the default), the zoom level may be changed at any time by the
118 * photocam object itself to account for photo size and photocam viewport
121 * @see elm_photocam_zoom_set()
122 * @see elm_photocam_zoom_mode_set()
126 EAPI double elm_photocam_zoom_get(const Evas_Object *obj);
129 * @brief Set the zoom mode
131 * @param obj The photocam object
132 * @param mode The desired mode
134 * This sets the zoom mode to manual or one of several automatic levels.
135 * Manual (ELM_PHOTOCAM_ZOOM_MODE_MANUAL) means that zoom is set manually by
136 * elm_photocam_zoom_set() and will stay at that level until changed by code
137 * or until zoom mode is changed. This is the default mode. The Automatic
138 * modes will allow the photocam object to automatically adjust zoom mode
139 * based on properties. ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT) will adjust zoom so
140 * the photo fits EXACTLY inside the scroll frame with no pixels outside this
141 * region. ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL will be similar but ensure no
142 * pixels within the frame are left unfilled.
146 EAPI void elm_photocam_zoom_mode_set(Evas_Object *obj, Elm_Photocam_Zoom_Mode mode);
149 * @brief Get the zoom mode
151 * @param obj The photocam object
152 * @return The current zoom mode
154 * This gets the current zoom mode of the photocam object.
156 * @see elm_photocam_zoom_mode_set()
160 EAPI Elm_Photocam_Zoom_Mode elm_photocam_zoom_mode_get(const Evas_Object *obj);
163 * @brief Get the current image pixel width and height
165 * @param obj The photocam object
166 * @param w A pointer to the width return
167 * @param h A pointer to the height return
169 * This gets the current photo pixel width and height (for the original).
170 * The size will be returned in the integers @p w and @p h that are pointed
175 EAPI void elm_photocam_image_size_get(const Evas_Object *obj, int *w, int *h);
178 * @brief Get the region of the image that is currently shown
181 * @param x A pointer to the X-coordinate of region
182 * @param y A pointer to the Y-coordinate of region
183 * @param w A pointer to the width
184 * @param h A pointer to the height
186 * @see elm_photocam_image_region_show()
187 * @see elm_photocam_image_region_bring_in()
191 EAPI void elm_photocam_image_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h);
194 * @brief Set the viewed region of the image
196 * @param obj The photocam object
197 * @param x X-coordinate of region in image original pixels
198 * @param y Y-coordinate of region in image original pixels
199 * @param w Width of region in image original pixels
200 * @param h Height of region in image original pixels
202 * This shows the region of the image without using animation.
206 EAPI void elm_photocam_image_region_show(Evas_Object *obj, int x, int y, int w, int h);
209 * @brief Bring in the viewed portion of the image
211 * @param obj The photocam object
212 * @param x X-coordinate of region in image original pixels
213 * @param y Y-coordinate of region in image original pixels
214 * @param w Width of region in image original pixels
215 * @param h Height of region in image original pixels
217 * This shows the region of the image using animation.
221 EAPI void elm_photocam_image_region_bring_in(Evas_Object *obj, int x, int y, int w, int h);
224 * @brief Set the paused state for photocam
226 * @param obj The photocam object
227 * @param paused The pause state to set
229 * This sets the paused state to on(EINA_TRUE) or off (EINA_FALSE) for
230 * photocam. The default is off. This will stop zooming using animation on
231 * zoom level changes and change instantly. This will stop any existing
232 * animations that are running.
236 EAPI void elm_photocam_paused_set(Evas_Object *obj, Eina_Bool paused);
239 * @brief Get the paused state for photocam
241 * @param obj The photocam object
242 * @return The current paused state
244 * This gets the current paused state for the photocam object.
246 * @see elm_photocam_paused_set()
250 EAPI Eina_Bool elm_photocam_paused_get(const Evas_Object *obj);
253 * @brief Get the internal low-res image used for photocam
255 * @param obj The photocam object
256 * @return The internal image object handle, or NULL if none exists
258 * This gets the internal image object inside photocam. Do not modify it. It
259 * is for inspection only, and hooking callbacks to. Nothing else. It may be
260 * deleted at any time as well.
264 EAPI Evas_Object *elm_photocam_internal_image_get(const Evas_Object *obj);
267 * @brief Set the photocam scrolling bouncing.
269 * @param obj The photocam object
270 * @param h_bounce set this to @c EINA_TRUE for horizontal bouncing
271 * @param v_bounce set this to @c EINA_TRUE for vertical bouncing
275 EAPI void elm_photocam_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce);
278 * @brief Get the photocam scrolling bouncing.
280 * @param obj The photocam object
281 * @param h_bounce horizontal bouncing
282 * @param v_bounce vertical bouncing
284 * @see elm_photocam_bounce_set()
288 EAPI void elm_photocam_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce);
291 * @brief Set the gesture state for photocam.
293 * @param obj The photocam object
294 * @param gesture The gesture state to set
296 * This sets the gesture state to on(EINA_TRUE) or off (EINA_FALSE) for
297 * photocam. The default is off. This will start multi touch zooming.
301 EAPI void elm_photocam_gesture_enabled_set(Evas_Object *obj, Eina_Bool gesture);
304 * @brief Get the gesture state for photocam.
306 * @param obj The photocam object
307 * @return The current gesture state
309 * This gets the current gesture state for the photocam object.
311 * @see elm_photocam_gesture_enabled_set()
315 EAPI Eina_Bool elm_photocam_gesture_enabled_get(const Evas_Object *obj);