e5bf36cdd4661f91050ed9e9709d102327224e2d
[framework/api/application.git] / include / app_storage_private.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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. 
15  */
16
17
18 #ifndef __TIZEN_APPFW_STORAGE_PRIVATE_H__
19 #define __TIZEN_APPFW_STORAGE_PRIVATE_H__
20
21 #include <tizen.h>
22
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27
28 typedef int (*storage_dev_get_state)(void);
29 typedef int (*storage_dev_set_state_cb)(void *data);
30 typedef void (*storage_dev_unset_state_cb)(void);
31 typedef int (*storage_dev_get_space)(unsigned long long *total, unsigned long long *available);
32
33 typedef struct storage_device_s
34 {
35         storage_type_e type;
36         char *path;
37         storage_dev_get_state get_state;
38         storage_dev_set_state_cb set_state_cb;
39         storage_dev_unset_state_cb unset_state_cb;
40         storage_dev_get_space get_space;
41 } *storage_device_h;
42
43 typedef struct storage_info_s
44 {
45         int id;
46         storage_device_h device;
47         storage_state_e state;
48         storage_state_changed_cb state_cb;
49         void *state_cb_data;
50 } *storage_info_h;
51
52 void storage_dispatch_state_event(storage_state_e state, void* data);
53
54 int storage_statfs(const char *directory, unsigned long long *total, unsigned long long *available);
55
56 #ifdef __cplusplus
57 }
58 #endif
59
60 #endif /* __TIZEN_APPFW_STORAGE_PRIVATE_H__ */