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://floralicense.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.
21 #ifndef __DEF_MF_UG_UTIL_H_
22 #define __DEF_MF_UG_UTIL_H_
24 #include <Elementary.h>
28 #include "mf-ug-main.h"
30 #define UG_SAFE_FREE_CHAR(x) do {\
37 #define UG_SAFE_FREE_GSTRING(x) do {\
39 g_string_free(x, TRUE); \
44 #define UG_CHAR_CHECK_NULL_GOTO(arg, dest) do {\
50 #define UG_GSTRING_CHECK_NULL_GOTO(arg, dest) do {\
51 if ((arg) == NULL || (arg->str) == NULL) {\
57 #define UG_SAFE_DEL_NAVI_ITEM(x) do {\
59 elm_object_item_del(x); \
65 #define UG_SAFE_FREE_OBJ(x) do {\
72 #define UG_SAFE_STRCPY(dest, src) \
73 do{if(!dest||!src)break;\
74 strncpy (dest , src, sizeof(dest)-1);\
75 dest[sizeof(dest)-1] = 0; }while(0)
77 #define UG_SAFE_DEL_ECORE_TIMER(timer) do { \
79 ecore_timer_del(timer);\
84 #define goto_if(x, dest) do { \
90 #define ug_ecore_idler_del(idler) do { \
92 ecore_idler_del(idler);\
97 typedef enum _mf_ug_list_play_state mf_ug_list_play_state;
99 enum _mf_ug_list_play_state {
109 typedef enum _mf_ug_select_mode mf_ug_select_mode;
110 enum _mf_ug_select_mode {
123 typedef enum _mf_ug_drm_mode mf_ug_drm_mode;
124 enum _mf_ug_drm_mode {
127 DRM_FILTER_WITHOUT_FL,
133 typedef enum _mf_ug_marked_switch mf_ug_marked_switch;
134 enum _mf_ug_marked_switch {
139 typedef enum _mf_ug_file_filter_type mf_ug_file_filter_type;
140 enum _mf_ug_file_filter_type {
147 SHOW_IMAGE_VIDEO_LIST,
148 SHOW_IMAGE_SOUND_LIST,
149 SHOW_VIDEO_SOUND_LIST,
155 typedef enum _mf_ug_state_mode mf_ug_state_mode;
156 enum _mf_ug_state_mode {
162 typedef enum _mf_ug_mmc_insert_state mf_ug_mmc_insert_state;
163 enum _mf_ug_mmc_insert_state {
168 typedef enum _mf_ug_launch_type mf_ug_launch_type;
169 enum _mf_ug_launch_type {
170 LAUNCH_TYPE_FORK = 0,
176 LAUNCH_TYPE_UNSUPPORT,
180 typedef enum _mf_ug_eina_list_node_type mf_ug_eina_list_node_type;
181 enum _mf_ug_eina_list_node_type {
189 typedef enum _mf_ug_ctrl_bar_type mf_ug_ctrl_bar_type;
190 enum _mf_ug_ctrl_bar_type {
198 typedef enum _mf_ug_view_type mf_ug_view_type;
199 enum _mf_ug_view_type {
205 typedef struct _ugListItemData ugListItemData;
206 struct _ugListItemData {
207 Evas_Object *ug_pCheckBox;
208 Evas_Object *ug_pRadioBox;
209 Evas_Object *ug_pPlaybtn;
210 Elm_Object_Item *ug_pItem;
212 GString *ug_pItemName;
216 bool ug_bRealThumbFlag;
219 typedef struct _ug_dir_event_t ug_dir_event_t;
220 struct _ug_dir_event_t {
225 typedef enum _mf_ug_theme_type mf_ug_theme_type;
226 enum _mf_ug_theme_type {
227 UG_THEME_INVALID = -1,
229 UG_THEME_NBEAT_BLACK = 1,
233 typedef enum _mf_ug_more_type_e mf_ug_more_type_e;
235 enum _mf_ug_more_type_e{ /* softkey / contextual popup */
237 UG_MORE_CREATE_FOLDER,
242 typedef enum _mf_ug_file_name_type_e mf_ug_file_name_type_e;
243 enum _mf_ug_file_name_type_e {
244 FILE_NAME_WITH_BRACKETS,
245 FILE_NAME_WITH_UNDERLINE,
249 typedef enum __mf_ug_thumbnail_type_e mf_ug_thumbnail_type_e;
250 enum __mf_ug_thumbnail_type_e {
251 MF_UG_THUMBNAIL_TYPE_DEFAULT,
252 MF_UG_THUMBNAIL_TYPE_THUMBNAIL,
253 MF_UG_THUMBNAIL_TYPE_MAX
256 bool mf_ug_util_is_mass_storage_on();
257 int mf_ug_util_create_dir_monitor(void *data);
258 int mf_ug_util_set_mmc_state_cb(void *data);
259 int mf_ug_util_get_mmc_state(int *mmc_card);
260 char *mf_ug_util_get_send_result(void *data);
261 bool mf_ug_util_is_genlist_selected(void *data);
263 void mf_ug_list_play_play_music_item(ugListItemData *data);
264 void mf_ug_list_play_destory_playing_file(void *data);
265 void mf_ug_list_play_update_item_icon(void *data);
267 void mf_ug_util_storage_insert_action(void *data, char *pItemLabel);
268 void mf_ug_util_destory_mmc_state_cb();
269 void mf_ug_util_destory_dir_monitor(void *data);
270 void mf_ug_util_get_params_path(Eina_List **dest_list, const char *path_list);
271 void mf_ug_util_free_eina_list_data(Eina_List **list, mf_ug_eina_list_node_type node_type);
272 void mf_ug_util_set_current_state(void *data, int state);
273 int mf_ug_util_add_dir_watch(const char *path, void *data);
274 mf_ug_launch_type mf_ug_util_get_file_launch_type(char *path);
276 void mf_ug_util_destory_mass_storage_callback();
277 mf_ug_theme_type mf_ug_util_get_theme(void);
278 int mf_ug_file_attr_get_parent_path(const char *path, char **parent_path);
279 char *mf_ug_util_upper_folder_name_get(void *data, GString *fullpath);
280 void mf_ug_util_operation_alloc_failed(void *data);
281 int mf_ug_util_remove_dir_watch(void);
282 void mf_ug_util_sort_the_file_list(void *data);
283 int mf_ug_util_check_disk_space(void *data);
284 long mf_ug_util_character_count_get(const char *original);
286 #endif /* __DEF_MYFILE_UTIL_H_ */