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 3 * found in the LICENSE file. 4 */ 5 6 /* From trusted/ppb_file_chooser_trusted.idl, 7 * modified Fri Mar 16 10:00:48 2012. 8 */ 9 10 #ifndef PPAPI_C_TRUSTED_PPB_FILE_CHOOSER_TRUSTED_H_ 11 #define PPAPI_C_TRUSTED_PPB_FILE_CHOOSER_TRUSTED_H_ 12 13 #include "ppapi/c/pp_array_output.h" 14 #include "ppapi/c/pp_bool.h" 15 #include "ppapi/c/pp_completion_callback.h" 16 #include "ppapi/c/pp_macros.h" 17 #include "ppapi/c/pp_resource.h" 18 #include "ppapi/c/pp_stdint.h" 19 #include "ppapi/c/pp_var.h" 20 21 #define PPB_FILECHOOSER_TRUSTED_INTERFACE_0_5 "PPB_FileChooserTrusted;0.5" 22 #define PPB_FILECHOOSER_TRUSTED_INTERFACE_0_6 "PPB_FileChooserTrusted;0.6" 23 #define PPB_FILECHOOSER_TRUSTED_INTERFACE PPB_FILECHOOSER_TRUSTED_INTERFACE_0_6 24 25 /** 26 * @file 27 * This file defines the <code>PPB_FileChooser_Trusted</code> interface. 28 */ 29 30 31 /** 32 * @addtogroup Interfaces 33 * @{ 34 */ 35 struct PPB_FileChooserTrusted_0_6 { 36 /** 37 * This function displays a previously created file chooser resource as a 38 * dialog box, prompting the user to choose a file or files to open, or a 39 * single file for saving. The callback is called with PP_OK on successful 40 * completion with a file (or files) selected or PP_ERROR_USERCANCEL if the 41 * user selected no file. 42 * 43 * @param[in] chooser The file chooser resource. 44 * @param[in] save_as A <code>PP_Bool</code> value indicating if this dialog 45 * is choosing a file for saving. 46 * @param[in] suggested_file_name If saving, the suggested name for the 47 * file, otherwise, null or undefined. 48 * @param[in] callback A <code>CompletionCallback</code> to be called after 49 * the user has closed the file chooser dialog. 50 * 51 * @return PP_OK_COMPLETIONPENDING if request to show the dialog was 52 * successful, another error code from pp_errors.h on failure. 53 */ 54 int32_t (*ShowWithoutUserGesture)(PP_Resource chooser, 55 PP_Bool save_as, 56 struct PP_Var suggested_file_name, 57 struct PP_ArrayOutput output, 58 struct PP_CompletionCallback callback); 59 }; 60 61 typedef struct PPB_FileChooserTrusted_0_6 PPB_FileChooserTrusted; 62 63 struct PPB_FileChooserTrusted_0_5 { 64 int32_t (*ShowWithoutUserGesture)(PP_Resource chooser, 65 PP_Bool save_as, 66 struct PP_Var suggested_file_name, 67 struct PP_CompletionCallback callback); 68 }; 69 /** 70 * @} 71 */ 72 73 #endif /* PPAPI_C_TRUSTED_PPB_FILE_CHOOSER_TRUSTED_H_ */ 74 75