Pepper_31_C_interfaces
Public Attributes | List of all members
PPB_FileChooser_Dev_0_6 Struct Reference

#include <ppb_file_chooser_dev.h>

Collaboration diagram for PPB_FileChooser_Dev_0_6:
Collaboration graph

Public Attributes

PP_Resource(* Create )(PP_Instance instance, PP_FileChooserMode_Dev mode, struct PP_Var accept_types)
 
PP_Bool(* IsFileChooser )(PP_Resource resource)
 
int32_t(* Show )(PP_Resource chooser, struct PP_ArrayOutput output, struct PP_CompletionCallback callback)
 

Detailed Description

Definition at line 57 of file ppb_file_chooser_dev.h.

Member Data Documentation

PP_Resource(* PPB_FileChooser_Dev_0_6::Create)(PP_Instance instance, PP_FileChooserMode_Dev mode, struct PP_Var accept_types)

This function creates a file chooser dialog resource. The chooser is associated with a particular instance, so that it may be positioned on the screen relative to the tab containing the instance.

Parameters
[in]instanceA PP_Instance identifying one instance of a module.
[in]modeA PP_FileChooserMode_Dev value that controls the behavior of the file chooser dialog.
[in]accept_typesA comma-separated list of MIME types and file extensions such as "audio/ *,text/plain,.html" (note there should be no space between the '/' and the '*', but one is added to avoid confusing C++ comments). The dialog may restrict selectable files to the specified MIME types and file extensions. If a string in the comma-separated list begins with a period (.) then the string is interpreted as a file extension, otherwise it is interpreted as a MIME-type. An empty string or an undefined var may be given to indicate that all types should be accepted.
Returns
A PP_Resource containing the file chooser if successful or 0 if it could not be created.

Definition at line 79 of file ppb_file_chooser_dev.h.

PP_Bool(* PPB_FileChooser_Dev_0_6::IsFileChooser)(PP_Resource resource)

Determines if the provided resource is a file chooser.

Parameters
[in]resourceA PP_Resource corresponding to a generic resource.
Returns
A PP_Bool that is PP_TRUE if the given resource is a file chooser resource, otherwise PP_FALSE.

Definition at line 91 of file ppb_file_chooser_dev.h.

int32_t(* PPB_FileChooser_Dev_0_6::Show)(PP_Resource chooser, struct PP_ArrayOutput output, struct PP_CompletionCallback callback)

This function displays a previously created file chooser resource as a dialog box, prompting the user to choose a file or files. This function must be called in response to a user gesture, such as a mouse click or touch event. The callback is called with PP_OK on successful completion with a file (or files) selected, PP_ERROR_USERCANCEL if the user selected no file, or another error code from pp_errors.h on failure.

Subtle note: This function will only work when the tab containing the plugin is visible. Show() will fail if the tab is in the background. Since it's not normally possible to get input events while invisible, this is not normally an issue. But there is a race condition because events are processed asynchronously. If the user clicks and switches tabs very quickly, a plugin could believe the tab is visible while Chrome believes it is invisible and the Show() call will fail. This will not generally cause user confusion since the user will have switched tabs and will not want to see a file chooser from a different tab.

Parameters
[in]chooserThe file chooser resource.
[in]outputAn output array which will receive PP_Resource(s) identifying the PPB_FileRef objects that the user selected on success.
[in]callbackA CompletionCallback to be called after the user has closed the file chooser dialog.
Returns
PP_OK_COMPLETIONPENDING if request to show the dialog was successful, another error code from pp_errors.h on failure.

Definition at line 122 of file ppb_file_chooser_dev.h.


The documentation for this struct was generated from the following file: