2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * About invoking gallery UG view. F.E.
20 * struct ug_cbs cbs = {0, };
21 * bundle* param = NULL;
23 * cbs.layout_cb = test_ug_layout_cb;
24 * cbs.result_cb = test_ug_return_cb;
25 * cbs.destroy_cb = test_ug_closed_cb;
27 * param = bundle_create();
29 * bundle_add( param, "launch-type", "select-one" );
30 * bundle_add( param, "return-type", "vconf");
31 * bundle_add( param, "file-type", "all" );
33 * struct ui_gadget *ext_ug = ug_create( NULL, "gallery-efl", UG_MODE_FULLVIEW, param, &cbs );
39 * It's added for wallpaper setting and contact caller ID setting.
40 * If caller pass "select-setas", after image tapped, image viewer would be invoke, then user can
41 * apply setting in image viewer.
42 * It's unnecessary to pass parameter of return-type in set-as case..
45 * And for set-as case, bundle parameter "setas-type" is used to specify different kind of setting, there are two set-as types:
47 * This is for wallpaper setting.
49 * This is for contact caller ID setting.
50 * And there are another two bundle parameters for callerid, both of them are optional , that is:
52 * It's added to set the size of caller ID, f.e.
53 * If you want to set the size as 200x200, you can set bundler parameter like :
54 * bundle_add( param, "callerid-size", "200" );
56 * It's added to specify the saved path of call ID, and note that this is a full path, f.e..
57 * You can pass path string like :
58 * bundle_add( param, "callerid-path", "/opt/media/test_folder/test_caller_id_1.jpg");
61 * Launching ug comand: ug-launcher -F -n gallery-efl -d "launch-type,select-setas" -d "file-type,image" -d "setas-type,wallpaper"
62 * Launching ug comand: ug-launcher -F -n gallery-efl -d "launch-type,select-setas" -d "file-type,image" -d "setas-type,callerid" \
63 * -d "callerid-size,200" -d "callerid-path,/opt/media/test_folder/test_caller_id_1.jpg"
65 * (2)"select-one" and "select-multiple"
66 * In this case, after image(s) tapped, it will be added to list and return path(s) to caller if done button tapped.
67 * Note that, caller must pass return-type, ug will return path(s) strings of selected image(s).
69 * Launching ug comand: ug-launcher -F -n gallery-efl -d "launch-type,select-one" -d "return-type,vconf" -d "file-type,all"
70 * ug-launcher -F -n gallery-efl -d "launch-type,select-multiple" -d "return-type,vconf" -d "file-type,all"
72 * Note that, file-type is optional while select-type is select-one or select-multiple.
75 * User can set file type via parameter "file-type", there are "image", "video" and "all", here, "all" including image and video.
76 * But for now in imageviewer, wallpaper setting only support image type.
81 #ifndef __GALLERY_EFL_H__
82 #define __GALLERY_EFL_H__
86 #include <Elementary.h>
89 #include <vconf-keys.h>
91 #include <ui-gadget-module.h>
92 #include <visual-svc.h>
99 #endif /* __cplusplus */
101 #define GALLERY_RES_DIR "/opt/apps/org.tizen.gallery/res/"
102 #define GALLERY_ICON_DIR GALLERY_RES_DIR"icons/default/small/"
103 #define GALLERY_EDJ_DIR GALLERY_RES_DIR"edje/"
104 #define GALLERY_BLACK_EDJ_FILE GALLERY_EDJ_DIR"gl-black-theme.edj"
105 #define GE_UG_RES_DIR "/opt/ug/res/"
106 #define GE_IMAGES_DIR GE_UG_RES_DIR"images/gallery-efl/images/"
107 #define GE_EDJ_DIR GE_UG_RES_DIR"edje/gallery-efl/"
108 #define GE_EDJ_FILE GE_EDJ_DIR"gallery-efl.edj"
110 #define GE_GRP_GRIDVIEW "gallery_efl/gridview"
111 #define GE_GRP_ALBUMVIEW "gallery_efl/albumview"
112 #define GE_GRP_NOCONTENTS "gallery_efl/nocontents"
114 #define GE_CBAR_STYLE_DEFAULT "gallery/default"
115 #define GE_NAVIFRAME_STYLE_DEFAULT "gallery/default"
116 #define GE_CHECKBOX_STYLE_GRID "gallery_efl/grid"
118 #define DEFAULT_ICON GALLERY_ICON_DIR"org.tizen.gallery.png"
119 #define GE_LOCK_ICON GE_IMAGES_DIR"T01_icon_lock.png"
120 #define GE_THUMB_BOOKMARK GE_IMAGES_DIR"T01_icon_thumbnail_bookmark.png"
121 #define GE_DEFAULT_THUMB_ICON GE_IMAGES_DIR"T01_Nocontents_broken.png"
122 #define GE_CBAR_ICON_DONE GE_IMAGES_DIR"T01_controlbar_icon_done.png"
124 #define GE_ROOT_PATH_PHONE "/opt/media"
125 #define GE_ROOT_PATH_MMC "/opt/storage/sdcard"
127 #define GE_ALBUM_ALL_ID "GALLERY_ALBUM_ALL_ALBUMS_ID"
128 /* String length of mtye item id */
129 #define GE_MTYPE_ITEN_ID_LEN_MAX 37
131 #define GE_BASE_WIN_WIDTH 720
132 #define GE_BASE_WIN_HEIGHT 1280
134 #define GE_GRID_ITEM_SIZE_W 178
135 #define GE_GRID_ITEM_SIZE_H 182
137 #define GE_GRID_ITEM_ZOOM_LEVEL_01 4
138 #define GE_GRID_ITEM_ZOOM_LEVEL_02 2
139 #define GE_GRID_ITEM_ZOOM_LEVEL_01_CNT 1
140 #define GE_GRID_ITEM_ZOOM_LEVEL_02_CNT 6
142 #define GE_LIST_ICON_WIDTH 133
143 #define GE_LIST_ICON_HEIGHT 100
145 #define GE_ALBUM_COVER_THUMB_NUM 7 /* There are 7 thumbnails of 'Camera shots' and 'All' cover*/
146 #define GE_ALBUM_COVER_THUMB_NUM_SEC 4 /* Other albums cover have maximum 4 thumbnails */
147 #define GE_ALBUM_ITEM_WIDTH 358
148 #define GE_ALBUM_ITEM_HEIGHT 360
149 #define GE_COVER_SIZE 318
150 #define GE_COVER_PAD 3
151 #define GE_COVER_ICON_S (GE_COVER_SIZE - 2 * GE_COVER_PAD)
152 #define GE_COVER_GRID_S 102
153 #define GE_COVER_2X_GRID_S (GE_COVER_ICON_S - GE_COVER_GRID_S - GE_COVER_PAD)
155 #define GE_SELINFO_TEXT_LEN_MAX 64
156 #define GE_ALBUM_DATE_LEN_MAX 256
157 #define GE_MAX_BYTES_FOR_CHAR 3
158 #define GE_ALBUM_NAME_LEN_MAX (255 * GE_MAX_BYTES_FOR_CHAR + 1)
159 #define GE_VIDEO_DURATION_MAX 256
160 #define GE_NOCONTENTS_LABEL_LEN_MAX 512
161 #define GE_FILE_PATH_LEN_MAX (4095 * GE_MAX_BYTES_FOR_CHAR + 1)
162 #define GE_DIR_PATH_LEN_MAX GE_FILE_PATH_LEN_MAX
164 #define GE_TIME_SECOND_MILLISECOND 1000 // 1s=1000ms
165 #define GE_TIME_USEC_PER_SEC 1000000L
166 #define GE_TIME_MINUTE_SECOND 60 // 1min=60s
167 #define GE_TIME_HOUR_MINUTE 60 // 1h=60min
168 #define GE_TIME_HOUR_SECOND (GE_TIME_HOUR_MINUTE * GE_TIME_MINUTE_SECOND) // 1h=(60x60)s
170 #define GE_FIRST_VIEW_START_POS 0
171 #define GE_FIRST_VIEW_END_POS 47
172 #define GE_GET_UNTIL_LAST_RECORD 65536 /* Fixme: Do not use 65536. */
173 #define GE_GET_ALL_RECORDS -1
175 #define GE_BUNDLE_LAUNCH_TYPE "launch-type"
176 #define GE_BUNDLE_FILE_TYPE "file-type"
177 #define GE_BUNDLE_SETAS_TYPE "setas-type"
178 #define GE_BUNDLE_CALLERID_SIZE "callerid-size"
179 #define GE_BUNDLE_CALLERID_PATH "callerid-path"
180 #define GE_BUNDLE_HOMESCREEN_PATH "homescreen-path"
181 #define GE_BUNDLE_LOCKSCREEN_PATH "lockscreen-path"
183 #define GE_ALBUM_SELECT_ONE "select-album"
184 #define GE_ALBUM_SELECT_RETURN_ID "album-id"
185 #define GE_ALBUM_SELECT_RETURN_PATH "folder-path"
187 #define GE_FILE_SELECT_ONE "select-one"
188 #define GE_FILE_SELECT_MULTIPLE "select-multiple"
189 #define GE_FILE_SELECT_SETAS "select-setas"
190 #define GE_FILE_SELECT_IMFT "select-imft"
192 #define GE_FILE_SELECT_TYPE_IMAGE "image"
193 #define GE_FILE_SELECT_TYPE_VIDEO "video"
194 #define GE_FILE_SELECT_TYPE_ALL "all"
196 #define GE_FILE_SELECT_SETAS_WALLPALER "wallpaper"
197 #define GE_FILE_SELECT_SETAS_CALLERID "callerid"
199 #define GE_FILE_SELECT_RETURN_COUNT "count"
200 #define GE_FILE_SELECT_RETURN_PATH "path"
202 #define GE_FILE_SELECT_RETURN_QUIT "ug-quit"
203 #define GE_FILE_SELECT_QUIT_STATE "normal"
205 #define GE_SETAS_CALLERID_CROP_IMAGE_PATH "crop-image-path"
206 #define GE_SETAS_IMAGE_PATH "image-path"
208 /*Image viewer UG bundle parameters*/
209 #define GE_IMAGEVIEWER_CALLERID_SIZE "Area size"
210 #define GE_IMAGEVIEWER_CALLERID_PATH "CallerID path"
212 #define GE_IMAGEVIEWER_CROP_IMAGE_PATH "crop_image_path"
213 #define GE_IMAGEVIEWER_IMAGE_PATH "image_path"
215 #define GE_IMAGEVIEWER_HOMESCREEN_PATH "Wallpaper path"
216 #define GE_IMAGEVIEWER_LOCKSCREEN_PATH "Lockscreen path"
217 #define GE_IMAGEVIEWER_RETURN_ERROR "Error"
218 /*Image viewer UG bundle parameters-End*/
221 GE_Album_Select_None,
228 GE_File_Select_Multiple,
229 GE_File_Select_Setas,
234 GE_File_Select_Setas_None,
235 GE_File_Select_Setas_Wallpaper,
236 GE_File_Select_Setas_CallerID,
237 } ge_file_select_setas;
240 GE_File_Select_Type_None,
241 GE_File_Select_Type_Image,
242 GE_File_Select_Type_Video,
243 GE_File_Select_Type_All,
246 typedef enum view_by_mode_e
249 GE_ThumbnailView_Mode,
250 GE_ThumbnailEdit_Mode,
253 typedef enum _ge_ug_exit_mode {
255 GE_UG_EXIT_MASS_STORAGE,
261 GE_UPDATE_MMC_REMOVED,
265 typedef struct _ge_ugdata ge_ugdata;
273 Elm_Object_Item *griditem;
282 typedef struct _gl_item {
285 Elm_Object_Item *elm_item;
286 Evas_Object* check_obj;
298 Evas_Object *ly_main;
301 /* add more variables here */
302 Evas_Object *navi_bar;
304 Evas_Object *albums_view;
305 Evas_Object *albums_view_ly;
306 Evas_Object *thumbs_view;
307 Evas_Object *thumbs_view_ly;
308 Elm_Object_Item *thumbs_nf_it;
309 Evas_Object *thumbs_nocontents;
310 Ecore_Idler* grid_append_idler;
311 Evas_Object *nocontents;
312 Ecore_Event_Handler* event_handler;
314 Ecore_Timer *del_timer;
317 MediaSvcHandle *db_handle;
318 ge_cluster_list* cluster_list;
319 struct ui_gadget *ug_called_by_me;
320 struct ui_gadget *ug;
321 bundle *bundle; /*added for "ug_send_result"*/
322 /* It's thumbnails icon size, not grid item size */
324 Ecore_Timer *thumbs_clicked_timer;
326 int album_select_mode;
327 int file_select_mode;
329 int file_select_contact_id;
330 int file_select_setas_mode;
331 char* file_setas_callid_size;
332 char* file_setas_callid_path;
333 char* file_setas_image_path;
334 char* file_setas_crop_image_path;
335 char albums_view_title[GE_ALBUM_NAME_LEN_MAX];
336 char* file_setas_homescreen_path;
337 char* file_setas_lockscreen_path;
339 Evas_Object *selectioninfo_ly;
340 Evas_Object *selectioninfo;
343 bool b_inited_view; /* true: show albums view; false: show popup */
344 /* Update view in timer if UMS OFF */
345 Ecore_Timer *ums_update_timer;
349 #define GE_DEL_TIMER(timer) if(timer){ecore_timer_del(timer); timer = NULL;}
350 #define GE_DEL_IDLER(idler) if(idler){ecore_idler_del(idler); idler = NULL;}
351 #define GE_DEL_OBJ(obj) if(obj){evas_object_del(obj); obj = NULL;}
352 #define GE_FREE_MEM(mem) if(mem){free(mem); mem = NULL;}
355 ge_view_mode _ge_get_view_mode(void);
356 void _ge_set_view_mode(ge_view_mode mode);
361 #endif /* __cplusplus */
364 #endif /* __GALLERY_EFL_H__ */