tizen 2.3 release
[apps/home/settings.git] / setting-storage / include / setting-storage.h
1 /*
2  * setting
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19 #ifndef __SETTING_STORAGE_H__
20 #define __SETTING_STORAGE_H__
21
22 #include <string.h>
23 #include <pthread.h>
24 #include <cairo.h>
25
26 #include <Elementary.h>
27 #include <dd-deviced.h>
28 #include <package-manager.h>
29
30 #include "setting-common-view.h"
31 #include "setting-common-draw-widget.h"
32 #include "setting-storage-string.h"
33
34 extern const char *storageUg_MMC_stat;
35 extern const char *storageUg_ENCRYPT_stat;
36
37
38 #define SETTING_STORAGE_PIE_RECT_OFFSET (36 * WIDGET_SCALE_FACTOR)
39 #define SETTING_STORAGE_DEFAULT_STORAGE_APP_DESP_SIZE (240 * WIDGET_SCALE_FACTOR)
40
41 #define SETTING_STORAGE_POPUP_TIMER     2
42 #define SETTING_STORAGE_PROGRESSBAR_TIMEOUT 10
43
44
45 #define SAFE_STRDUP(src) (src)?strdup(src):NULL
46
47 typedef struct _Setting_Storage_Status {
48         double  dTotal;
49         double  dAvail;
50 } Setting_Storage_Status;
51
52
53 typedef struct _SettingStorageUG SettingStorageUG;
54
55 typedef struct
56 {
57         pthread_t tid;
58
59         double video_total;
60         double audio_total;
61         double misces_total;
62
63         SettingStorageUG *ad;
64 }storageUg_worker_data;
65
66 struct _SettingStorageUG {
67         ui_gadget_h ug;
68
69         setting_view *main_view;
70         setting_view *default_view;
71         setting_view *misces_view;
72
73         Evas_Object *win;
74         Evas_Object *lo_parent;
75         Evas_Object *navi;
76
77         Evas_Object *lo_main;
78         Evas_Object *gl_main;
79
80         /* storage setting */
81         Evas_Object *popup;
82         Elm_Genlist_Item_Class itc_2text_3_parent;
83         Elm_Genlist_Item_Class itc_1icon_1text_sub;
84         Elm_Genlist_Item_Class itc_2text_2;
85         Elm_Genlist_Item_Class itc_group_item;
86         Elm_Genlist_Item_Class itc_2text_1icon_3;
87         Elm_Genlist_Item_Class itc_1text;
88         Elm_Genlist_Item_Class itc_1text_1icon;
89         Elm_Genlist_Item_Class itc_pie;
90         Elm_Genlist_Item_Class itc_notice;
91         Elm_Genlist_Item_Class itc_color_item;
92
93         double sz_inter_total;
94         double sz_inter_avail;
95         double sz_sys;
96         double sz_apps;
97         double sz_pics_videos;
98         double sz_audio;
99         double sz_misces;
100
101         Setting_GenGroupItem_Data *total_space;
102         Setting_GenGroupItem_Data *sys_mem;
103         Setting_GenGroupItem_Data *apps;
104         Setting_GenGroupItem_Data *pics_videos;
105         Setting_GenGroupItem_Data *audio;
106         Setting_GenGroupItem_Data *misces;
107         Setting_GenGroupItem_Data *avail;
108         pkgmgr_client *pc;
109
110         /* pie sub_layout*/
111         Elm_Object_Item *pie_it;
112         cairo_t *cr;
113
114         Setting_GenGroupItem_Data *sd_card;
115         Setting_GenGroupItem_Data *sd_mount;
116         Setting_GenGroupItem_Data *sd_total;
117         Setting_GenGroupItem_Data *sd_avail;
118         Setting_GenGroupItem_Data *sd_format;
119         struct mmc_contents mmc_content;
120         int sd_request;
121
122         /* usb otg storage */
123         Setting_GenGroupItem_Data *usb_card;
124         Setting_GenGroupItem_Data *usb_mount;
125         Setting_GenGroupItem_Data *usb_total;
126         Setting_GenGroupItem_Data *usb_available;
127         Setting_GenGroupItem_Data *usb_unmount;
128         Setting_GenGroupItem_Data *usb_format;
129         Elm_Object_Item *usb_sep_item;
130
131         int usb_otg_status;
132         int usb_request;
133         char *usb_otg_path;
134
135         void *size_worker;
136
137         Ecore_Idler *update_idler;
138         Ecore_Timer *update_timer;
139
140         /* default storage */
141         Setting_GenGroupItem_Data *data_bt;
142         Setting_GenGroupItem_Data *data_nfc;
143         Setting_GenGroupItem_Data *data_wifidirect;
144         Setting_GenGroupItem_Data *data_installapp;
145
146         /* miscellaneous files list */
147         Elm_Object_Item *misces_navi_it;
148         Evas_Object *gl_misces;
149         Evas_Object *misces_lo_noitem;
150         Eina_Bool misces_is_select_all;
151         Eina_List *misces_list;
152         Eina_List *misces_sel_list;
153         int misces_sz_all;
154         int misces_checked;
155         void *del_worker;
156         Evas_Object *select_all_layout;
157         Evas_Object *title_left_btn;
158         Evas_Object *title_right_btn;
159
160         int mmc_status;
161 };
162
163 #endif //__SETTING_STORAGE_H__