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 {
119 IMPORT_PATH_SELECT_MODE,
124 typedef enum _mf_ug_drm_mode mf_ug_drm_mode;
125 enum _mf_ug_drm_mode {
128 DRM_FILTER_WITHOUT_FL,
134 typedef enum _mf_ug_marked_switch mf_ug_marked_switch;
135 enum _mf_ug_marked_switch {
140 typedef enum _mf_ug_file_filter_type mf_ug_file_filter_type;
141 enum _mf_ug_file_filter_type {
148 SHOW_IMAGE_VIDEO_LIST,
149 SHOW_IMAGE_SOUND_LIST,
150 SHOW_VIDEO_SOUND_LIST,
156 typedef enum _mf_ug_state_mode mf_ug_state_mode;
157 enum _mf_ug_state_mode {
163 typedef enum _mf_ug_mmc_insert_state mf_ug_mmc_insert_state;
164 enum _mf_ug_mmc_insert_state {
169 typedef enum _mf_ug_launch_type mf_ug_launch_type;
170 enum _mf_ug_launch_type {
171 LAUNCH_TYPE_FORK = 0,
177 LAUNCH_TYPE_UNSUPPORT,
181 typedef enum _mf_ug_eina_list_node_type mf_ug_eina_list_node_type;
182 enum _mf_ug_eina_list_node_type {
190 typedef enum _mf_ug_ctrl_bar_type mf_ug_ctrl_bar_type;
191 enum _mf_ug_ctrl_bar_type {
199 typedef enum _mf_ug_view_type mf_ug_view_type;
200 enum _mf_ug_view_type {
206 typedef struct _ugListItemData ugListItemData;
207 struct _ugListItemData {
208 Evas_Object *ug_pCheckBox;
209 Evas_Object *ug_pRadioBox;
210 Evas_Object *ug_pPlaybtn;
211 Elm_Object_Item *ug_pItem;
213 GString *ug_pItemName;
217 bool ug_bRealThumbFlag;
220 typedef struct _ug_dir_event_t ug_dir_event_t;
221 struct _ug_dir_event_t {
226 typedef enum _mf_ug_theme_type mf_ug_theme_type;
227 enum _mf_ug_theme_type {
228 UG_THEME_INVALID = -1,
230 UG_THEME_NBEAT_BLACK = 1,
234 typedef enum _mf_ug_more_type_e mf_ug_more_type_e;
236 enum _mf_ug_more_type_e{ /* softkey / contextual popup */
238 UG_MORE_CREATE_FOLDER,
243 typedef enum _mf_ug_file_name_type_e mf_ug_file_name_type_e;
244 enum _mf_ug_file_name_type_e {
245 FILE_NAME_WITH_BRACKETS,
246 FILE_NAME_WITH_UNDERLINE,
250 typedef enum __mf_ug_thumbnail_type_e mf_ug_thumbnail_type_e;
251 enum __mf_ug_thumbnail_type_e {
252 MF_UG_THUMBNAIL_TYPE_DEFAULT,
253 MF_UG_THUMBNAIL_TYPE_THUMBNAIL,
254 MF_UG_THUMBNAIL_TYPE_MAX
257 bool mf_ug_util_is_mass_storage_on();
258 int mf_ug_util_create_dir_monitor(void *data);
259 int mf_ug_util_set_mmc_state_cb(void *data);
260 int mf_ug_util_get_mmc_state(int *mmc_card);
261 char *mf_ug_util_get_send_result(void *data);
262 bool mf_ug_util_is_genlist_selected(void *data);
264 void mf_ug_list_play_play_music_item(ugListItemData *data);
265 void mf_ug_list_play_destory_playing_file(void *data);
266 void mf_ug_list_play_update_item_icon(void *data);
268 void mf_ug_util_storage_insert_action(void *data, char *pItemLabel);
269 void mf_ug_util_destory_mmc_state_cb();
270 void mf_ug_util_destory_dir_monitor(void *data);
271 void mf_ug_util_get_params_path(Eina_List **dest_list, const char *path_list);
272 void mf_ug_util_free_eina_list_data(Eina_List **list, mf_ug_eina_list_node_type node_type);
273 void mf_ug_util_set_current_state(void *data, int state);
274 int mf_ug_util_add_dir_watch(const char *path, void *data);
275 mf_ug_launch_type mf_ug_util_get_file_launch_type(char *path);
277 void mf_ug_util_destory_mass_storage_callback();
278 mf_ug_theme_type mf_ug_util_get_theme(void);
279 int mf_ug_file_attr_get_parent_path(const char *path, char **parent_path);
280 char *mf_ug_util_upper_folder_name_get(void *data, GString *fullpath);
281 void mf_ug_util_operation_alloc_failed(void *data);
282 int mf_ug_util_remove_dir_watch(void);
283 void mf_ug_util_sort_the_file_list(void *data);
284 int mf_ug_util_check_disk_space(void *data);
285 long mf_ug_util_character_count_get(const char *original);
287 #endif /* __DEF_MYFILE_UTIL_H_ */