OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /* From ppb_file_ref.idl modified Wed Oct 5 14:06:02 2011. */ | 6 /* From ppb_file_ref.idl modified Thu Mar 7 12:02:53 2013. */ |
7 | 7 |
8 #ifndef PPAPI_C_PPB_FILE_REF_H_ | 8 #ifndef PPAPI_C_PPB_FILE_REF_H_ |
9 #define PPAPI_C_PPB_FILE_REF_H_ | 9 #define PPAPI_C_PPB_FILE_REF_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
13 #include "ppapi/c/pp_file_info.h" | 13 #include "ppapi/c/pp_file_info.h" |
14 #include "ppapi/c/pp_macros.h" | 14 #include "ppapi/c/pp_macros.h" |
15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
16 #include "ppapi/c/pp_stdint.h" | 16 #include "ppapi/c/pp_stdint.h" |
17 #include "ppapi/c/pp_time.h" | 17 #include "ppapi/c/pp_time.h" |
18 #include "ppapi/c/pp_var.h" | 18 #include "ppapi/c/pp_var.h" |
19 | 19 |
20 #define PPB_FILEREF_INTERFACE_1_0 "PPB_FileRef;1.0" | 20 #define PPB_FILEREF_INTERFACE_1_0 "PPB_FileRef;1.0" |
21 #define PPB_FILEREF_INTERFACE PPB_FILEREF_INTERFACE_1_0 | 21 #define PPB_FILEREF_INTERFACE_1_1 "PPB_FileRef;1.1" |
| 22 #define PPB_FILEREF_INTERFACE PPB_FILEREF_INTERFACE_1_1 |
22 | 23 |
23 /** | 24 /** |
24 * @file | 25 * @file |
25 * This file defines the API to create a file reference or "weak pointer" to a | 26 * This file defines the API to create a file reference or "weak pointer" to a |
26 * file in a file system. | 27 * file in a file system. |
27 */ | 28 */ |
28 | 29 |
29 | 30 |
30 /** | 31 /** |
31 * @addtogroup Interfaces | 32 * @addtogroup Interfaces |
32 * @{ | 33 * @{ |
33 */ | 34 */ |
34 /** | 35 /** |
35 * The <code>PPB_FileRef</code> struct represents a "weak pointer" to a file in | 36 * The <code>PPB_FileRef</code> struct represents a "weak pointer" to a file in |
36 * a file system. This struct contains a <code>PP_FileSystemType</code> | 37 * a file system. This struct contains a <code>PP_FileSystemType</code> |
37 * identifier and a file path string. | 38 * identifier and a file path string. |
38 */ | 39 */ |
39 struct PPB_FileRef_1_0 { | 40 struct PPB_FileRef_1_1 { |
40 /** | 41 /** |
41 * Create() creates a weak pointer to a file in the given file system. File | 42 * Create() creates a weak pointer to a file in the given file system. File |
42 * paths are POSIX style. | 43 * paths are POSIX style. |
43 * | 44 * |
44 * @param[in] resource A <code>PP_Resource</code> corresponding to a file | 45 * @param[in] resource A <code>PP_Resource</code> corresponding to a file |
45 * system. | 46 * system. |
46 * @param[in] path A path to the file. | 47 * @param[in] path A path to the file. |
47 * | 48 * |
48 * @return A <code>PP_Resource</code> corresponding to a file reference if | 49 * @return A <code>PP_Resource</code> corresponding to a file reference if |
49 * successful or 0 if the path is malformed. | 50 * successful or 0 if the path is malformed. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 * @param[in] new_file_ref A <code>PP_Resource</code> corresponding to a new | 171 * @param[in] new_file_ref A <code>PP_Resource</code> corresponding to a new |
171 * file reference. | 172 * file reference. |
172 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 173 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
173 * completion of Rename(). | 174 * completion of Rename(). |
174 * | 175 * |
175 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 176 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
176 */ | 177 */ |
177 int32_t (*Rename)(PP_Resource file_ref, | 178 int32_t (*Rename)(PP_Resource file_ref, |
178 PP_Resource new_file_ref, | 179 PP_Resource new_file_ref, |
179 struct PP_CompletionCallback callback); | 180 struct PP_CompletionCallback callback); |
| 181 /* |
| 182 * Query() queries info about a file or directory. You must have access to |
| 183 * read this file or directory if it exists in the external filesystem. |
| 184 * |
| 185 * @param[in] file_ref A <code>PP_Resource</code> corresponding to a file |
| 186 * reference. |
| 187 * @param[out] info A pointer to a <code>PP_FileInfo</code> which will be |
| 188 * populated with information about the file or directory. |
| 189 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
| 190 * completion of Query(). |
| 191 * |
| 192 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
| 193 */ |
| 194 int32_t (*Query)(PP_Resource file_ref, |
| 195 struct PP_FileInfo* info, |
| 196 struct PP_CompletionCallback callback); |
| 197 }; |
| 198 |
| 199 typedef struct PPB_FileRef_1_1 PPB_FileRef; |
| 200 |
| 201 struct PPB_FileRef_1_0 { |
| 202 PP_Resource (*Create)(PP_Resource file_system, const char* path); |
| 203 PP_Bool (*IsFileRef)(PP_Resource resource); |
| 204 PP_FileSystemType (*GetFileSystemType)(PP_Resource file_ref); |
| 205 struct PP_Var (*GetName)(PP_Resource file_ref); |
| 206 struct PP_Var (*GetPath)(PP_Resource file_ref); |
| 207 PP_Resource (*GetParent)(PP_Resource file_ref); |
| 208 int32_t (*MakeDirectory)(PP_Resource directory_ref, |
| 209 PP_Bool make_ancestors, |
| 210 struct PP_CompletionCallback callback); |
| 211 int32_t (*Touch)(PP_Resource file_ref, |
| 212 PP_Time last_access_time, |
| 213 PP_Time last_modified_time, |
| 214 struct PP_CompletionCallback callback); |
| 215 int32_t (*Delete)(PP_Resource file_ref, |
| 216 struct PP_CompletionCallback callback); |
| 217 int32_t (*Rename)(PP_Resource file_ref, |
| 218 PP_Resource new_file_ref, |
| 219 struct PP_CompletionCallback callback); |
180 }; | 220 }; |
181 | |
182 typedef struct PPB_FileRef_1_0 PPB_FileRef; | |
183 /** | 221 /** |
184 * @} | 222 * @} |
185 */ | 223 */ |
186 | 224 |
187 #endif /* PPAPI_C_PPB_FILE_REF_H_ */ | 225 #endif /* PPAPI_C_PPB_FILE_REF_H_ */ |
188 | 226 |
OLD | NEW |