Add 3.0 APIs and sync APIs same as 2.4
[platform/core/convergence/service-adaptor.git] / client / sal_service_storage.h
1 /*
2  * Service Storage
3  *
4  * Copyright (c) 2014 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
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
20 #ifndef __SERVICE_STORAGE_H__
21 #define __SERVICE_STORAGE_H__
22
23 #ifndef API
24 #define API __attribute__ ((visibility("default")))
25 #endif
26
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31
32 #include "sal_service_adaptor.h"
33 #include "sal_service_task.h"
34
35 #define SERVICE_STORAGE_CLOUD_REMOVE_FILE_URI   "http://tizen.org/service-adaptor/storage/cloud/remove_file"
36 #define SERVICE_STORAGE_CLOUD_DOWNLOAD_FILE_URI "http://tizen.org/service-adaptor/storage/cloud/download_file"
37 #define SERVICE_STORAGE_CLOUD_UPLOAD_FILE_URI   "http://tizen.org/service-adaptor/storage/cloud/upload_file"
38 #define SERVICE_STORAGE_CLOUD_DOWNLOAD_FILE_THUMBNAIL_URI       "http://tizen.org/service-adaptor/storage/cloud/download_file_thumbnail"
39 #define SERVICE_STORAGE_CLOUD_GET_FILE_LIST_URI "http://tizen.org/service-adaptor/storage/cloud/get_file_list"
40
41 typedef struct _service_storage_cloud_file_s *service_storage_cloud_file_h;
42
43 typedef bool (*service_storage_cloud_file_cb)(int result, service_storage_cloud_file_h file, void *user_data);
44
45 /*==================================================================================================
46                                          FUNCTION PROTOTYPES
47 ==================================================================================================*/
48
49 int service_storage_cloud_file_create(service_plugin_h plugin, service_storage_cloud_file_h *file);
50 int service_storage_cloud_file_clone(service_storage_cloud_file_h src_file, service_storage_cloud_file_h *dst_file);
51
52 int service_storage_cloud_file_destroy(service_storage_cloud_file_h file);
53 int service_storage_cloud_file_set_callback(service_storage_cloud_file_h file, service_storage_cloud_file_cb callback, void *user_data);
54 int service_storage_cloud_file_unset_callback(service_storage_cloud_file_h file);
55 int service_storage_cloud_file_set_cloud_path(service_storage_cloud_file_h file, const char *cloud_path);
56 int service_storage_cloud_file_get_cloud_path(service_storage_cloud_file_h file, char **cloud_path);
57 int service_storage_cloud_file_set_local_path(service_storage_cloud_file_h file, const char *local_path);
58 int service_storage_cloud_file_get_local_path(service_storage_cloud_file_h file, char **local_path);
59 int service_storage_cloud_file_set_size(service_storage_cloud_file_h file, unsigned long long size);
60 int service_storage_cloud_file_get_size(service_storage_cloud_file_h file, unsigned long long *size);
61 int service_storage_cloud_file_set_operation(service_storage_cloud_file_h file, const char *operation);
62 int service_storage_cloud_file_get_operation(service_storage_cloud_file_h file, char **operation);
63 int service_storage_cloud_file_is_directory(service_storage_cloud_file_h file, bool *is_dir);
64 int service_storage_cloud_file_foreach_file(service_storage_cloud_file_h file, service_storage_cloud_file_cb callback, void *user_data);
65 int service_storage_cloud_file_create_task(service_storage_cloud_file_h file, service_task_h *task);
66 int service_storage_cloud_file_destroy_task(service_task_h task);
67
68 #ifdef __cplusplus
69 }
70 #endif
71
72 #endif /* __SERVICE_STORAGE_H__ */