41e59b78cf3bf299aef95bfe09a8ad2772105170
[framework/multimedia/libmedia-service.git] / src / include / visual / media-svc-util.h
1 /*
2  * libmedia-service
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@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
22 /** 
23  * This file defines the error code of media service
24  *
25  * @file        media-svc-util.h
26  * @author              Hyunjun Ko <zzoon.ko@samsung.com>
27  * @version     1.0
28  * @brief       This file defines the error code of media service 
29  */
30
31 /**
32 * @ingroup MEDIA-SVC
33 * @defgroup     MEDIA_SVC_UTIL error code table
34 * @{
35 */
36
37
38 #ifndef _MEDIA_SVC_UTIL_H_
39 #define _MEDIA_SVC_UTIL_H_
40         
41 #include <glib.h>
42 #include <stdbool.h>
43
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47
48 #define MB_SVC_PATH_PHONE       "/opt/media"    /**< File path prefix of files stored in phone */
49 #define MB_SVC_PATH_MMC         "/opt/storage/sdcard"   /**< File path prefix of files stored in mmc card */
50
51
52 /**
53 * @fn    int _mb_svc_get_file_display_name (const char* file_path, char* file_name);
54 * This function gets file name by file full path
55 *
56 * @return                        This function returns 0 on success, and -1 on failure.
57 * @param[in]                    file_path           file full path
58 * @param[out]                   file_name      file name
59 * @exception                    None.
60 * @remark                        
61 *                                                             
62 *                                                          
63 */      
64
65 bool    
66 _mb_svc_get_file_display_name (const char* file_path, char* file_name);
67
68  
69  /**
70  * @fn    int _mb_svc_get_file_parent_path(const char* file_path, char* parent_path);
71  * This function gets file parent path
72  *
73  * @return                                                This function returns 0 on success, and -1 on failure.
74  * @param[in]                                    file_path                file full path
75  * @param[out]                                   parent_path      file parent path
76  * @exception                                    None.
77  * @remark                                                
78  *                                                                                                                         
79  *                                                                                                                      
80  */  
81
82 bool
83 _mb_svc_get_file_parent_path(const char* file_path, char* parent_path);
84
85 /**
86 * @fn    int _mb_svc_get_dir_display_name (const char* dir_path, char* dir_name);
87 * This function gets directory name
88 *
89 * @return                        This function returns 0 on success, and -1 on failure.
90 * @param[in]                    dir_path           directory path
91 * @param[out]                   dir_name     directory name
92 * @exception                    None.
93 * @remark                        
94 *                                                             
95 *                                                          
96 */      
97 bool    
98 _mb_svc_get_dir_display_name (const char* dir_path, char* dir_name);
99
100 /**
101 * @fn    int _mb_svc_get_dir_parent_path(const char* dir_path, char* parent_path);
102 * This function gets directory parent path
103 *
104 * @return                        This function returns 0 on success, and -1 on failure.
105 * @param[in]                    dir_path           directory path
106 * @param[out]                   parent_path      directory parent path
107 * @exception                    None.
108 * @remark                        
109 *                                                             
110 *                                                          
111 */       
112 bool
113 _mb_svc_get_dir_parent_path(const char* dir_path, char* parent_path);
114
115 /**
116 * @fn    int _mb_svc_get_file_dir_modified_date(const char* full_path);
117 * This function gets file modified date
118 *
119 * @return                        This function returns 0 on success, and -1 on failure.
120 * @param[in]                    full_path           file full path
121 * @exception                    None.
122 * @remark                        
123 *                                                             
124 *                                                          
125 */      
126
127 int 
128 _mb_svc_get_file_dir_modified_date(const char* full_path);
129
130 /**
131 * @fn    int _mb_svc_get_store_type_by_full(const char* full_path);
132 * This function gets file store type
133 * @return                        This function returns 0 on success, and -1 on failure.
134 * @param[in]                    full_path           file full path
135 * @exception                    None.
136 * @remark                        
137 *                                                             
138 *                                                          
139 */       
140 int
141 _mb_svc_get_store_type_by_full(const char* full_path);
142
143 /**
144 * @fn    int _mb_svc_get_rel_path_by_full(const char* full_path, char* path);
145 * This function gets file relative path
146 *
147 * @return                        This function returns 0 on success, and -1 on failure.
148 * @param[in]                    full_path           file full path
149 * @param[out]                   path     file relative path
150 * @exception                    None.
151 * @remark                        
152 *                                                             
153 *                                                          
154 */        
155 int
156 _mb_svc_get_rel_path_by_full(const char* full_path, char* path);
157
158 /**
159 * @fn    int _mb_svc_get_file_ext (const char* file_path, char* file_ext);
160 * This function gets file extension
161 *
162 * @return                        This function returns 0 on success, and -1 on failure.
163 * @param[in]                    file_path           file full path
164 * @param[out]                   file_ext       pointer to file extention
165 * @exception                    None.
166 * @remark                        
167 *                                                             
168 *                                                          
169 */       
170 bool
171 _mb_svc_get_file_ext (const char* file_path, char* file_ext);
172
173 /**
174 * @fn    int _mb_svc_glist_free(GList** glist, bool is_free_element);
175 * This function frees glist and maybe free each items in glist
176 *
177 * @return                        This function returns 0 on success, and -1 on failure.
178 * @param[in]                    glist           the glist to be freed
179 * @param[in]                 is_free_element    falg to declare if to free items in glist
180 * @exception                    None.
181 * @remark                        
182 *                                                             
183 *                                                          
184 */      
185
186 bool
187 _mb_svc_glist_free(GList** glist, bool is_free_element);
188
189 /**
190 * @fn    int _mb_svc_get_file_type(char* file_full_path);
191 * This function gets file type
192 *
193 * @return                        This function returns 0 on success, and -1 on failure.
194 * @param[in]                    file_full_path           file full path
195  * @exception                    None.
196 * @remark
197 *
198 *
199 */
200
201 int
202 _mb_svc_get_file_type(const char* file_full_path);
203
204 bool
205 _mb_svc_get_path_by_full(const char* full_path, char* path, int max_length);
206
207 #ifdef __cplusplus
208 }
209 #endif /* __cplusplus */
210
211
212 #endif /*_MEDIA_SVC_UTIL_H_*/
213
214 /**
215 * @}
216 */
217