Add APIs of 2.4
[platform/core/convergence/service-adaptor.git] / client / sal_service_storage_internal.h
1 /*
2  * Service Storage Internal
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_INTERNAL_H__
21 #define __SERVICE_STORAGE_INTERNAL_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 <glib.h>
33
34 #include "sal_service_adaptor.h"
35 #include "sal_service_storage.h"
36
37 typedef struct _service_storage_cloud_file_s
38 {
39         service_plugin_h plugin;
40         service_storage_cloud_file_cb callback;
41         void *user_data;
42
43         bool is_dir;
44         char *dir_path;
45         char *local_path;
46         char *cloud_path;
47         unsigned long long size;
48         char *operation;
49
50         GList *files;
51 } service_storage_cloud_file_s;
52
53 /*==================================================================================================
54                                          FUNCTION PROTOTYPES
55 ==================================================================================================*/
56
57 int service_storage_cloud_start(service_storage_cloud_file_h file);
58 int service_storage_cloud_stop(service_storage_cloud_file_h file);
59
60 /*==================================================================================================
61                                        2.4 FUNCTION PROTOTYPES
62 ==================================================================================================*/
63
64 /**
65  * Storage adaptor content type
66  */
67 typedef enum _service_storage_file_content_type_e
68 {
69         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_DEFAULT               = -1,    // initalize value
70
71         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_IMGAE                 = 160,
72         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_VIDEO                 = 161,
73         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_SOUND                 = 162,
74         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_MUSIC                 = 163,
75         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_OTHER                 = 164,
76         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_DOCUMENT              = 165,
77         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_THUMBNAIL             = 166,
78
79         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_CHUNK_MASK            = 320,
80         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_IMGAE_CHUNK           = 480,
81         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_VIDEO_CHUNK           = 481,
82         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_SOUND_CHUNK           = 482,
83         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_MUSIC_CHUNK           = 483,
84         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_OTHER_CHUNK           = 484,
85         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_DOCUMENT_CHUNK        = 485,
86         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_THUMBNAIL_CHUNK       = 486,
87
88         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_FOLDER                = 1024,
89         SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_METADATA              = 2048,
90 } service_storage_content_type_e;
91
92 typedef struct _service_storage_media_meta_s
93 {
94         char *mime_type;
95         char *title;
96         char *album;
97         char *artist;
98         char *genere;
99         char *recorded_date;
100         int width;
101         int height;
102         int duration;
103         char *copyright;
104         char *track_num;
105         char *description;
106         char *composer;
107         char *year;
108         int bitrate;
109         int samplerate;
110         int channel;
111         char *extra_media_meta;
112 } service_storage_media_meta_s;
113
114 typedef struct _service_storage_cloud_meta_s
115 {
116         char *service_name;
117         unsigned long long usage_byte;
118         unsigned long long quota_byte;
119         char *extra_cloud_meta;
120 } service_storage_cloud_meta_s;
121
122 /**
123 * @brief Describes file information description
124 */
125 struct _service_storage_file_s
126 {
127         char    *plugin_name;           /**< specifies plugin name generated file_info */
128         char    *object_id;             /**< specifies file object id be used in storage */
129         char    *storage_path;          /**< specifies file path in storage */
130         unsigned long long file_size;   /**< specifies file size (recomend byte)*/
131         unsigned long long created_time;        /**< specifies timestamp */
132         unsigned long long modified_time;       /**< specifies timestamp */
133         int     file_info_index;        /**< specifies file info index (wide use; e.g : chunk upload, multi download)*/
134         service_storage_content_type_e content_type; /**< specifies file content type (reference service_adaptor_file_content_type_e)  */
135
136         service_storage_media_meta_s *media_meta;
137         service_storage_cloud_meta_s *cloud_meta;
138         char    *extra_file_info;               /**< specifies content name in metadata */
139 };
140
141
142 typedef struct _service_storage_file_s service_storage_file_s;
143
144 /**
145 * @brief The handle for File Description
146 */
147 typedef struct _service_storage_file_s *service_storage_file_h;
148
149 #ifdef __cplusplus
150 }
151 #endif
152
153 #endif /* __SERVICE_STORAGE_INTERNAL_H__ */