2 * @defgroup Photocam Photocam
4 * @image html img/widget/photocam/preview-00.png
5 * @image latex img/widget/photocam/preview-00.eps
7 * This is a widget specifically for displaying high-resolution digital
8 * camera photos giving speedy feedback (fast load), low memory footprint
9 * and zooming and panning as well as fitting logic. It is entirely focused
10 * on jpeg images, and takes advantage of properties of the jpeg format (via
11 * evas loader features in the jpeg loader).
13 * Signals that you can add callbacks for are:
14 * @li "clicked" - This is called when a user has clicked the photo without
16 * @li "press" - This is called when a user has pressed down on the photo.
17 * @li "longpressed" - This is called when a user has pressed down on the
18 * photo for a long time without dragging around.
19 * @li "clicked,double" - This is called when a user has double-clicked the
21 * @li "load" - Photo load begins.
22 * @li "loaded" - This is called when the image file load is complete for the
23 * first view (low resolution blurry version).
24 * @li "load,detail" - Photo detailed data load begins.
25 * @li "loaded,detail" - This is called when the image file load is complete
26 * for the detailed image data (full resolution needed).
27 * @li "zoom,start" - Zoom animation started.
28 * @li "zoom,stop" - Zoom animation stopped.
29 * @li "zoom,change" - Zoom changed when using an auto zoom mode.
30 * @li "scroll" - the content has been scrolled (moved)
31 * @li "scroll,anim,start" - scrolling animation has started
32 * @li "scroll,anim,stop" - scrolling animation has stopped
33 * @li "scroll,drag,start" - dragging the contents around has started
34 * @li "scroll,drag,stop" - dragging the contents around has stopped
36 * @ref tutorial_photocam shows the API in action.
41 * @brief Types of zoom available.
45 ELM_PHOTOCAM_ZOOM_MODE_MANUAL = 0, /**< Zoom controlled normally by elm_photocam_zoom_set */
46 ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT, /**< Zoom until photo fits in photocam */
47 ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL, /**< Zoom until photo fills photocam */
48 ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT_IN, /**< Zoom in until photo fits in photocam */
49 ELM_PHOTOCAM_ZOOM_MODE_LAST
50 } Elm_Photocam_Zoom_Mode;
53 * @brief Add a new Photocam object
55 * @param parent The parent object
56 * @return The new object or NULL if it cannot be created
58 EAPI Evas_Object *elm_photocam_add(Evas_Object *parent);
61 * @brief Set the photo file to be shown
63 * @param obj The photocam object
64 * @param file The photo file
65 * @return The return error (see EVAS_LOAD_ERROR_NONE, EVAS_LOAD_ERROR_GENERIC etc.)
67 * This sets (and shows) the specified file (with a relative or absolute
68 * path) and will return a load error (same error that
69 * evas_object_image_load_error_get() will return). The image will change and
70 * adjust its size at this point and begin a background load process for this
71 * photo that at some time in the future will be displayed at the full
74 EAPI Evas_Load_Error elm_photocam_file_set(Evas_Object *obj, const char *file);
77 * @brief Returns the path of the current image file
79 * @param obj The photocam object
80 * @return Returns the path
82 * @see elm_photocam_file_set()
84 EAPI const char *elm_photocam_file_get(const Evas_Object *obj);
87 * @brief Set the zoom level of the photo
89 * @param obj The photocam object
90 * @param zoom The zoom level to set
92 * This sets the zoom level. 1 will be 1:1 pixel for pixel. 2 will be 2:1
93 * (that is 2x2 photo pixels will display as 1 on-screen pixel). 4:1 will be
94 * 4x4 photo pixels as 1 screen pixel, and so on. The @p zoom parameter must
95 * be greater than 0. It is suggested to stick to powers of 2. (1, 2, 4, 8,
98 EAPI void elm_photocam_zoom_set(Evas_Object *obj, double zoom);
101 * @brief Get the zoom level of the photo
103 * @param obj The photocam object
104 * @return The current zoom level
106 * This returns the current zoom level of the photocam object. Note that if
107 * you set the fill mode to other than ELM_PHOTOCAM_ZOOM_MODE_MANUAL
108 * (which is the default), the zoom level may be changed at any time by the
109 * photocam object itself to account for photo size and photocam viewport
112 * @see elm_photocam_zoom_set()
113 * @see elm_photocam_zoom_mode_set()
115 EAPI double elm_photocam_zoom_get(const Evas_Object *obj);
118 * @brief Set the zoom mode
120 * @param obj The photocam object
121 * @param mode The desired mode
123 * This sets the zoom mode to manual or one of several automatic levels.
124 * Manual (ELM_PHOTOCAM_ZOOM_MODE_MANUAL) means that zoom is set manually by
125 * elm_photocam_zoom_set() and will stay at that level until changed by code
126 * or until zoom mode is changed. This is the default mode. The Automatic
127 * modes will allow the photocam object to automatically adjust zoom mode
128 * based on properties. ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT) will adjust zoom so
129 * the photo fits EXACTLY inside the scroll frame with no pixels outside this
130 * region. ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL will be similar but ensure no
131 * pixels within the frame are left unfilled.
133 EAPI void elm_photocam_zoom_mode_set(Evas_Object *obj, Elm_Photocam_Zoom_Mode mode);
136 * @brief Get the zoom mode
138 * @param obj The photocam object
139 * @return The current zoom mode
141 * This gets the current zoom mode of the photocam object.
143 * @see elm_photocam_zoom_mode_set()
145 EAPI Elm_Photocam_Zoom_Mode elm_photocam_zoom_mode_get(const Evas_Object *obj);
148 * @brief Get the current image pixel width and height
150 * @param obj The photocam object
151 * @param w A pointer to the width return
152 * @param h A pointer to the height return
154 * This gets the current photo pixel width and height (for the original).
155 * The size will be returned in the integers @p w and @p h that are pointed
158 EAPI void elm_photocam_image_size_get(const Evas_Object *obj, int *w, int *h);
161 * @brief Get the region of the image that is currently shown
164 * @param x A pointer to the X-coordinate of region
165 * @param y A pointer to the Y-coordinate of region
166 * @param w A pointer to the width
167 * @param h A pointer to the height
169 * @see elm_photocam_image_region_show()
170 * @see elm_photocam_image_region_bring_in()
172 EAPI void elm_photocam_image_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h);
175 * @brief Set the viewed region of the image
177 * @param obj The photocam object
178 * @param x X-coordinate of region in image original pixels
179 * @param y Y-coordinate of region in image original pixels
180 * @param w Width of region in image original pixels
181 * @param h Height of region in image original pixels
183 * This shows the region of the image without using animation.
185 EAPI void elm_photocam_image_region_show(Evas_Object *obj, int x, int y, int w, int h);
188 * @brief Bring in the viewed portion of the image
190 * @param obj The photocam object
191 * @param x X-coordinate of region in image original pixels
192 * @param y Y-coordinate of region in image original pixels
193 * @param w Width of region in image original pixels
194 * @param h Height of region in image original pixels
196 * This shows the region of the image using animation.
198 EAPI void elm_photocam_image_region_bring_in(Evas_Object *obj, int x, int y, int w, int h);
201 * @brief Set the paused state for photocam
203 * @param obj The photocam object
204 * @param paused The pause state to set
206 * This sets the paused state to on(EINA_TRUE) or off (EINA_FALSE) for
207 * photocam. The default is off. This will stop zooming using animation on
208 * zoom level changes and change instantly. This will stop any existing
209 * animations that are running.
211 EAPI void elm_photocam_paused_set(Evas_Object *obj, Eina_Bool paused);
214 * @brief Get the paused state for photocam
216 * @param obj The photocam object
217 * @return The current paused state
219 * This gets the current paused state for the photocam object.
221 * @see elm_photocam_paused_set()
223 EAPI Eina_Bool elm_photocam_paused_get(const Evas_Object *obj);
226 * @brief Get the internal low-res image used for photocam
228 * @param obj The photocam object
229 * @return The internal image object handle, or NULL if none exists
231 * This gets the internal image object inside photocam. Do not modify it. It
232 * is for inspection only, and hooking callbacks to. Nothing else. It may be
233 * deleted at any time as well.
235 EAPI Evas_Object *elm_photocam_internal_image_get(const Evas_Object *obj);
238 * @brief Set the photocam scrolling bouncing.
240 * @param obj The photocam object
241 * @param h_bounce set this to @c EINA_TRUE for horizontal bouncing
242 * @param v_bounce set this to @c EINA_TRUE for vertical bouncing
244 EAPI void elm_photocam_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce);
247 * @brief Get the photocam scrolling bouncing.
249 * @param obj The photocam object
250 * @param h_bounce horizontal bouncing
251 * @param v_bounce vertical bouncing
253 * @see elm_photocam_bounce_set()
255 EAPI void elm_photocam_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce);
258 * @brief Set the gesture state for photocam.
260 * @param obj The photocam object
261 * @param gesture The gesture state to set
263 * This sets the gesture state to on(EINA_TRUE) or off (EINA_FALSE) for
264 * photocam. The default is off. This will start multi touch zooming.
266 EAPI void elm_photocam_gesture_set(Evas_Object *obj, Eina_Bool gesture);
269 * @brief Get the gesture state for photocam.
271 * @param obj The photocam object
272 * @return The current gesture state
274 * This gets the current gesture state for the photocam object.
276 * @see elm_photocam_gesture_set()
278 EAPI Eina_Bool elm_photocam_gesture_get(const Evas_Object *obj);