f44b12883a1bc891091a6d73fdc4a972316e4bab
[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  * Contact: MyoungJune Park <mj2004.park@samsung.com>
7  * 
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 #ifndef __SETTING_STORAGE_H__
22 #define __SETTING_STORAGE_H__
23
24 #include <stdio.h>
25 #include <Elementary.h>
26
27 #include <glib-object.h>
28
29 #include <setting-common-draw-widget.h>
30 #include <setting-common-view.h>
31
32 #define SETTING_STORAGE_MAX_STR_LEN                     30
33
34 #define SETTING_STORAGE_DIR_PATH_LEN_MAX                4096
35 #define SETTING_STORAGE_FILE_NAME_LEN_MAX               256
36 #define SETTING_STORAGE_CHILDPATH_LEN                   512
37
38
39 #define SETTING_STORAGE_KILOBYTE_VALUE                  1024
40 #define SETTING_STORAGE_MEGABYTE_VALUE                  1048576
41 #define SETTING_STORAGE_GIGABYTE_VALUE                  1073741824
42
43 typedef struct _Setting_Storage_Status {
44         double  dTotal;
45         double  dAvail;
46 } Setting_Storage_Status;
47
48 typedef struct _Node_Info Node_Info;
49 struct _Node_Info {
50         char path[SETTING_STORAGE_DIR_PATH_LEN_MAX + 1];
51         char name[SETTING_STORAGE_FILE_NAME_LEN_MAX + 1];
52         unsigned int size;
53 };
54
55 typedef struct _SettingStorageUG SettingStorageUG;
56
57 /**
58  * Setting Storage UG context
59  * all UG function has void* as an agument. this is casted back to SettingStorageUG 
60  * and the functions access app context.
61  */
62 struct _SettingStorageUG {
63         ui_gadget_h ug;
64
65         /* add more variables here (move your appdata to here) */
66         Evas *evas;
67         Evas_Object *win_main_layout;
68         Evas_Object *win_get;
69
70         Evas_Object *ly_main;
71
72         Evas_Object *genlist;
73         Evas_Object *navibar;
74
75         /* storage setting */
76         Evas_Object *popup;
77         Elm_Genlist_Item_Class itc_2text_3_parent;
78         Elm_Genlist_Item_Class itc_1icon_1text_sub;
79         Elm_Genlist_Item_Class itc_1text_1icon_2;
80         Elm_Genlist_Item_Class itc_2text_2;
81         Elm_Genlist_Item_Class itc_group_item;
82         Elm_Genlist_Item_Class itc_bg_1icon;
83         Elm_Genlist_Item_Class itc_seperator;
84         Elm_Genlist_Item_Class itc_2text_1icon_3;
85         Elm_Genlist_Item_Class itc_1text;
86         Elm_Genlist_Item_Class itc_2text_1icon_4;
87
88         Setting_Storage_Status internal_status;
89         Setting_Storage_Status apps_status;
90         Setting_Storage_Status pics_videos_status;
91         Setting_Storage_Status downloads_status;
92         Setting_Storage_Status others_status;
93
94         Setting_GenGroupItem_Data *internal;
95         Setting_GenGroupItem_Data *apps;
96         Setting_GenGroupItem_Data *pics_videos;
97         Setting_GenGroupItem_Data *downloads;
98         Setting_GenGroupItem_Data *others;
99         Setting_GenGroupItem_Data *avail;
100 };
101
102 extern setting_view setting_view_storage_main;
103
104 #endif                          /* __SETTING_STORAGE_H__ */