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 dev/ppb_file_chooser_dev.idl modified Mon Nov 14 10:36:01 2011. */ | 6 /* From dev/ppb_file_chooser_dev.idl modified Thu Mar 15 09:29:39 2012. */ |
7 | 7 |
8 #ifndef PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ | 8 #ifndef PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ |
9 #define PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ | 9 #define PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ |
10 | 10 |
| 11 #include "ppapi/c/pp_array_output.h" |
11 #include "ppapi/c/pp_bool.h" | 12 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_completion_callback.h" | 13 #include "ppapi/c/pp_completion_callback.h" |
13 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
14 #include "ppapi/c/pp_macros.h" | 15 #include "ppapi/c/pp_macros.h" |
15 #include "ppapi/c/pp_resource.h" | 16 #include "ppapi/c/pp_resource.h" |
16 #include "ppapi/c/pp_stdint.h" | 17 #include "ppapi/c/pp_stdint.h" |
17 #include "ppapi/c/pp_var.h" | 18 #include "ppapi/c/pp_var.h" |
18 | 19 |
19 #define PPB_FILECHOOSER_DEV_INTERFACE_0_5 "PPB_FileChooser(Dev);0.5" | 20 #define PPB_FILECHOOSER_DEV_INTERFACE_0_5 "PPB_FileChooser(Dev);0.5" |
20 #define PPB_FILECHOOSER_DEV_INTERFACE PPB_FILECHOOSER_DEV_INTERFACE_0_5 | 21 #define PPB_FILECHOOSER_DEV_INTERFACE_0_6 "PPB_FileChooser(Dev);0.6" |
| 22 #define PPB_FILECHOOSER_DEV_INTERFACE PPB_FILECHOOSER_DEV_INTERFACE_0_6 |
21 | 23 |
22 /** | 24 /** |
23 * @file | 25 * @file |
24 * This file defines the <code>PPB_FileChooser_Dev</code> interface. | 26 * This file defines the <code>PPB_FileChooser_Dev</code> interface. |
25 */ | 27 */ |
26 | 28 |
27 | 29 |
28 /** | 30 /** |
29 * @addtogroup Enums | 31 * @addtogroup Enums |
30 * @{ | 32 * @{ |
(...skipping 14 matching lines...) Expand all Loading... |
45 } PP_FileChooserMode_Dev; | 47 } PP_FileChooserMode_Dev; |
46 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FileChooserMode_Dev, 4); | 48 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FileChooserMode_Dev, 4); |
47 /** | 49 /** |
48 * @} | 50 * @} |
49 */ | 51 */ |
50 | 52 |
51 /** | 53 /** |
52 * @addtogroup Interfaces | 54 * @addtogroup Interfaces |
53 * @{ | 55 * @{ |
54 */ | 56 */ |
55 struct PPB_FileChooser_Dev_0_5 { | 57 struct PPB_FileChooser_Dev_0_6 { |
56 /** | 58 /** |
57 * This function creates a file chooser dialog resource. The chooser is | 59 * This function creates a file chooser dialog resource. The chooser is |
58 * associated with a particular instance, so that it may be positioned on the | 60 * associated with a particular instance, so that it may be positioned on the |
59 * screen relative to the tab containing the instance. | 61 * screen relative to the tab containing the instance. |
60 * | 62 * |
61 * @param[in] instance A <code>PP_Instance</code> identifying one instance | 63 * @param[in] instance A <code>PP_Instance</code> identifying one instance |
62 * of a module. | 64 * of a module. |
63 * @param[in] mode A <code>PP_FileChooserMode_Dev</code> value that controls | 65 * @param[in] mode A <code>PP_FileChooserMode_Dev</code> value that controls |
64 * the behavior of the file chooser dialog. | 66 * the behavior of the file chooser dialog. |
65 * @param[in] accept_mime_types A comma-separated list of MIME types such as | 67 * @param[in] accept_mime_types A comma-separated list of MIME types such as |
(...skipping 21 matching lines...) Expand all Loading... |
87 PP_Bool (*IsFileChooser)(PP_Resource resource); | 89 PP_Bool (*IsFileChooser)(PP_Resource resource); |
88 /** | 90 /** |
89 * This function displays a previously created file chooser resource as a | 91 * This function displays a previously created file chooser resource as a |
90 * dialog box, prompting the user to choose a file or files. This function | 92 * dialog box, prompting the user to choose a file or files. This function |
91 * must be called in response to a user gesture, such as a mouse click or | 93 * must be called in response to a user gesture, such as a mouse click or |
92 * touch event. The callback is called with PP_OK on successful completion | 94 * touch event. The callback is called with PP_OK on successful completion |
93 * with a file (or files) selected, PP_ERROR_USERCANCEL if the user selected | 95 * with a file (or files) selected, PP_ERROR_USERCANCEL if the user selected |
94 * no file, or another error code from pp_errors.h on failure. | 96 * no file, or another error code from pp_errors.h on failure. |
95 * | 97 * |
96 * @param[in] chooser The file chooser resource. | 98 * @param[in] chooser The file chooser resource. |
| 99 * |
| 100 * @param[in] output An output array which will receive PP_Resource(s) |
| 101 * identifying the <code>PPB_FileRef</code> objects that the user selected on |
| 102 * success. |
| 103 * |
97 * @param[in] callback A <code>CompletionCallback</code> to be called after | 104 * @param[in] callback A <code>CompletionCallback</code> to be called after |
98 * the user has closed the file chooser dialog. | 105 * the user has closed the file chooser dialog. |
99 * | 106 * |
100 * @return PP_OK_COMPLETIONPENDING if request to show the dialog was | 107 * @return PP_OK_COMPLETIONPENDING if request to show the dialog was |
101 * successful, another error code from pp_errors.h on failure. | 108 * successful, another error code from pp_errors.h on failure. |
102 */ | 109 */ |
| 110 int32_t (*Show)(PP_Resource chooser, |
| 111 struct PP_ArrayOutput output, |
| 112 struct PP_CompletionCallback callback); |
| 113 }; |
| 114 |
| 115 typedef struct PPB_FileChooser_Dev_0_6 PPB_FileChooser_Dev; |
| 116 |
| 117 struct PPB_FileChooser_Dev_0_5 { |
| 118 PP_Resource (*Create)(PP_Instance instance, |
| 119 PP_FileChooserMode_Dev mode, |
| 120 struct PP_Var accept_mime_types); |
| 121 PP_Bool (*IsFileChooser)(PP_Resource resource); |
103 int32_t (*Show)(PP_Resource chooser, struct PP_CompletionCallback callback); | 122 int32_t (*Show)(PP_Resource chooser, struct PP_CompletionCallback callback); |
104 /** | |
105 * After a successful completion callback call from Show, this method may be | |
106 * used to query the chosen files. It should be called in a loop until it | |
107 * returns 0. Their file system type will be PP_FileSystemType_External. If | |
108 * the user chose no files or canceled the dialog, then this method will | |
109 * simply return 0 the first time it is called. | |
110 * | |
111 * @param[in] chooser The file chooser resource. | |
112 * | |
113 * @return A <code>PP_Resource</code> containing the next file chosen by the | |
114 * user, or 0 if there are no more files. | |
115 */ | |
116 PP_Resource (*GetNextChosenFile)(PP_Resource chooser); | 123 PP_Resource (*GetNextChosenFile)(PP_Resource chooser); |
117 }; | 124 }; |
118 | |
119 typedef struct PPB_FileChooser_Dev_0_5 PPB_FileChooser_Dev; | |
120 /** | 125 /** |
121 * @} | 126 * @} |
122 */ | 127 */ |
123 | 128 |
124 #endif /* PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ */ | 129 #endif /* PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ */ |
125 | 130 |
OLD | NEW |