2 * Copyright 2013 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.
20 #ifndef __DEF_MYFILE_H_
21 #define __DEF_MYFILE_H_
29 #include <media_content.h>
30 #include <Elementary.h>
31 //#include <media-svc-types.h>
34 #include <ui-gadget.h>
40 #include "mf-search.h"
43 #define CTRL_DISABLE_NONE 0x0000
44 #define CTRL_DISABLE_MOVE 0x0001
45 #define CTRL_DISABLE_COPY 0x0002
46 #define CTRL_DISABLE_DELETE 0x0004
47 #define CTRL_DISABLE_SEND 0x0008
48 #define CTRL_DISABLE_LIST_BY 0x0010
49 #define CTRL_DISABLE_CREATE 0x0020
50 #define CTRL_DISABLE_EDIT 0x0040
51 #define CTRL_DISABLE_COPY_MOVE 0x0080
52 #define CTRL_DISABLE_SEARCH 0x0100
53 #define CTRL_DISABLE_MOVE_HERE 0x0200
54 #define CTRL_DISABLE_COPY_HERE 0x0400
55 #define CTRL_DISABLE_CANCEL 0x0800
56 #define CTRL_DISABLE_MORE 0x1000
58 #define CTRL_DISABLE_EDIT_ALL (CTRL_DISABLE_DELETE | CTRL_DISABLE_SEND | CTRL_DISABLE_MORE)
59 #define CTRL_DISABLE_DEFAULT_SEL (CTRL_DISABLE_COPY)
60 #define CTRL_DISABLE_NOCONTENT_VIEW (CTRL_DISABLE_EDIT | CTRL_DISABLE_LIST_BY | CTRL_DISABLE_SEARCH)
61 #define CTRL_DISABLE_USER_FOLDER_SEL (CTRL_DISABLE_DELETE | CTRL_DISABLE_MORE)
62 #define CTRL_DISABLE_DEFAULT_ALL (CTRL_DISABLE_LIST_BY | CTRL_DISABLE_MORE | CTRL_DISABLE_EDIT | CTRL_DISABLE_SEARCH)
63 #define CTRL_DISABLE_OTG_ROOT ~CTRL_DISABLE_SEARCH
64 #define CTRL_DISABLE_SYSFOLDER_SELECT (CTRL_DISABLE_MOVE_HERE)
65 #define CTRL_DISABLE_OTG_OPT_ROOT (CTRL_DISABLE_MOVE_HERE | CTRL_DISABLE_COPY_HERE | CTRL_DISABLE_CREATE)
68 #define myfile_ret_if(expr) do { \
70 mf_debug("!!! CHECK ERROR !!! (%s) -> %s() return!!!", #expr, __FUNCTION__); \
74 #define myfile_retv_if(expr, val) do { \
76 mf_debug("!!! CHECK ERROR !!! (%s) -> %s() return !!!", #expr, __FUNCTION__); \
80 #define myfile_retm_if(expr, fmt, arg...) do { \
82 mf_debug(fmt, ##arg); \
83 mf_debug("!!! CHECK ERROR !!! (%s) -> %s() return !!!", #expr, __FUNCTION__); \
87 #define myfile_retvm_if(expr, val, fmt, arg...) do { \
89 mf_debug(fmt, ##arg); \
90 mf_debug("!!! CHECK ERROR !!! (%s) -> %s() return !!!", #expr, __FUNCTION__); \
95 /*********** Global Definitions ***********/
96 typedef void (*mfCallBack) (void *, Evas_Object *, void *);
98 typedef struct _oper_record oper_record;
100 struct _oper_record {
104 typedef struct _myfileNaviBar myfileNaviBar;
106 struct _myfileNaviBar {
108 char *pNaviLabel; /*indicate which storage is pointed by this navibar*/
109 oper_record pre_operation;
111 MORE_TYPE pre_more; /*for tab function only*/
113 bool naviFlagEditStart;
114 bool naviFlagEditJoin; /*to indicate if pop in refresh needed*/
117 typedef struct _mfEditView mfEditView;
120 Evas_Object *pGenlist;
121 Evas_Object *pGengrid;
122 //Evas_Object *pSelectAllCheckBox;
123 //Evas_Object *pSelectAllLayout;
124 Evas_Object *pPathInfo;
125 Evas_Object *pInfoBox;
126 Eina_Bool bSelectAllChecked;
130 #ifdef MYFILE_SPLIT_VIEW
131 typedef struct __mfSplitData mfSplitData;
132 struct __mfSplitData {
133 Evas_Object *pMainLayout;
136 Evas_Object *pSplitLeftGenlist;
137 //Evas_Object *pSelectAllLayout;
138 //Evas_Object *pSelectAllCheckBox;
139 Elm_Object_Item *phone_item;
140 Elm_Object_Item *mmc_item;
141 Elm_Object_Item *otg_item;
142 bool bFlagSplitViewCreate;
143 bool bFlagPortraitViewCreate;
147 typedef struct _myfileMainWindow myfileMainWindow;
148 struct _myfileMainWindow {
149 /* root window size */
157 Evas_Object *pWindow;
158 Evas_Object *pBackGround;
159 Evas_Object *pConformant;
160 Evas_Object *pMainLayout;
161 Evas_Object *pTabBar;
162 Eina_List *plistNaviBar;
164 Evas_Object *pNormalPopup;
165 Evas_Object *pContextPopup;
167 Evas_Object *pEditField;
169 Ecore_Event_Handler *event;
170 Ecore_Event_Handler *font_event;
172 Evas_Object *pLabelLayout;
173 Evas_Object *pProgressPopup;
174 Evas_Object *pFinishPopup;
175 Evas_Object *pMmcRemovedPopup;
176 Evas_Object *pProgressLayout;
177 Evas_Object *pOperationNotify;
178 Evas_Object *pSearchEntry;
179 Evas_Object *pSearchLabel;
182 Evas_Object *pNaviBar;
183 Evas_Object *pNaviLayout;
184 Evas_Object *pNaviLeftBtn;
185 Evas_Object *pNaviCtrlBar;
186 Evas_Object *pNaviSearchBar;
187 Evas_Object *pNaviBox;
188 Evas_Object *pNaviGenlist;
189 Evas_Object *pNaviGengrid;
190 Evas_Object *pNaviPathInfo;
191 Evas_Object *pNaviInfoBox;
192 Evas_Object *pTrayBox;
194 const Elm_Object_Item *pSearchViewSweepItem;
195 const Elm_Object_Item *pPreSearchViewSweepItem;
196 Ecore_Timer *pSearchViewTimer;
197 Ecore_Timer *pPopupTimer;
199 #ifdef MYFILE_SPLIT_VIEW
201 Evas_Object *pNaviSplitContent;
203 Elm_Object_Item *pNaviItem;
205 #ifdef MYFILE_SPLIT_VIEW
206 mfSplitData sSplitData;
208 mfEditView pEditView;
211 typedef struct _myfileStatus myfileStatus;
213 struct _myfileStatus {
215 int more; /** current mode **/
216 int preMore; /** the mode before operation **/
217 int rotation_type; /** current rotation type **/
219 int folder_count; /** current new created folders count **/
220 int theme_type; /** current theme type **/
221 int iRadioValue; /** current the radio box selected item value **/
222 int flagViewType; /** current view type, List view or Thumbnail view **/
223 int iFolderSortType; /* for list by operation */
224 int iStorageState; /** current storage state **/
225 int iCtrlDisableItem;
227 int iSelectedSortType;
232 Eina_Bool flagRootView;
233 Eina_Bool flagNoContent;
234 Eina_Bool flagFolderSelect;
235 Eina_Bool flagFileSelect;
236 Eina_Bool flagStorageRemoved;
237 Eina_Bool flagNaviPush;
238 Eina_Bool flagIcuInit;
239 Eina_Bool flagLCDLock; /*lcd lock status*/
240 Eina_Bool flagCtxPopShow;
241 Eina_Bool flagSearchAll;
242 Eina_Bool flagTabbarShow;
245 Evas_Object *pRadioGroup;
246 GString *path; /* current path */
249 int navi_item_selected;
251 Elm_Object_Item *pPreNaviItem;
253 UDateTimePatternGenerator *generator;
254 UDateFormat *formatter;
256 mf_search_handle search_handler;
258 #ifdef MYFILE_SPLIT_VIEW
262 bool view_mode_start;
265 Ecore_Timer *rotation_timer;
268 #ifdef MYFILE_MOTION_FEATURE
269 void (*doubletab_event_handler)(Evas_Object *data);
271 Ecore_Idler *app_init_idler;
272 Ecore_Idler *popup_del_idler;
273 Ecore_Idler *navi_content_idler;
274 Evas_Object *old_content;
276 bool b_run_background; /* 20121008 added for fix PLM P121001-0404 temporary */
280 typedef struct _myfileFileOperation myfileFileOperation;
281 struct _myfileFileOperation {
284 char *file_name_suffix;
286 /*clicked item name */
287 GString *clicked_item;
289 /*mmc operation flag */
290 gboolean bmmc_is_removing;
293 ui_gadget_h ugImageViewer;
295 /* operation error number */
299 /* pipe for inotify */
301 Ecore_Pipe *sync_pipe;
302 gboolean same_storage;
306 GString *destination;
307 gboolean refresh_type;
309 Ecore_Pipe *inotify_pipe;
311 /* progress bar data record */
312 Evas_Object *progress_bar;
313 Evas_Object *persent_label;
314 Evas_Object *count_label;
315 unsigned int current_count;
316 unsigned long total_file_size;
317 unsigned long finished_size;
322 Eina_List *search_result_list;
323 Eina_List *default_dir_list;
324 Eina_List *user_dir_list;
325 Eina_List *folder_list;
326 Eina_List *file_list;
327 Eina_List *category_list;
331 mf_fo_request *pRequest;
335 Elm_Object_Item *pGenlistItem;
338 Ecore_Timer *search_IME_hide_timer;
339 Elm_Object_Item *rename_item;
341 #ifdef MYFILE_USB_OTG
342 Eina_List *otg_dev_list;
343 Eina_List *otg_dev_removed_list;
346 Eina_List *job_pop_list; /*to record the job handler for to_content_pop*/
347 Ecore_Job *job_push; /*to record the job handler for push a new view*/
348 bool iOperationSuccessFlag; /*used for confirm whether the operation fininsh successfully, not canceled and failed*/
350 Elm_Object_Item *idle_delete_item;
353 typedef struct _myfileFileRecord myfileFileRecord;
355 struct _myfileFileRecord {
356 /* operation property */
357 Eina_List *operation_property;
359 /* value saver for bluetooth / protection */
360 Eina_List *value_saver;
361 Eina_List *selected_files;
362 Eina_List *selected_dest_files;
363 Eina_List *backup_file_list;
366 typedef struct _myfileSharedGadget myfileSharedGadget;
367 struct _myfileSharedGadget {
368 int is_password_correct;
370 /*SGController *sg_controller;for privacy lock*/
374 Evas_Object *rootpath_box;
375 Evas_Object *rootpath_layout;
376 Elm_Object_Item *rootpath_navi_item;
378 typedef struct _myfileOtg myfileOtg;
380 struct _myfileBundle {
381 service_h recv_service;
389 typedef struct _myfileBundle myfileBundle;
392 myfileMainWindow mf_MainWindow;
393 myfileStatus mf_Status;
394 myfileFileOperation mf_FileOperation;
395 myfileFileRecord mf_FileRecordList;
396 myfileSharedGadget mf_SharedGadget;
398 myfileBundle mf_Bundle;
402 /*handler list node struct*/
403 typedef struct _myfileEcoreHandleNode myfileEcoreHandleNode;
404 struct _myfileEcoreHandleNode {
410 typedef enum _MF_ACTION mfAction;
417 #define _EDJ(o) elm_layout_edje_get(o)
418 Evas_Object *mf_main_load_edj(Evas_Object * parent, const char *file, const char *group);
419 #define GET_SYS_STR(str) dgettext("sys_string", str)
420 #define GET_STR(str) _(str)
422 #endif /* __DEF_MYFILE_H_ */