This page contains a list of classes, methods, and enumerated types available in the
Google Picker API. All of these elements belong to the namespace
There are 2 types of classes and enumerated types: those which are used to build and configure
the Google Picker, and those which are returned by the Google Picker once the user has
selected an item.
Configuration Classes and Types
The following classes and enumerated types are used to build and configure
the Google Picker.
DocsUploadView to upload documents to Google Drive.
|Allows the user to select a folder in Google Drive to upload to.|
|Sets the upload destination to the specified folder. This overrides |
setIncludeFolders to false.
DocsView is a subclass of
View that can be used for Google Drive views.
DocsView(ViewId | undefined)
|Constructor. The |
ViewId must be one of the Google Drive views. Default is
|Shows shared drives and the files they contain. Note: |
Feature.SUPPORT_DRIVES needs to be enabled when enabling this.
|Show folders in the view items. Do not combine with |
setIncludeFolders(true) is set,
setOwnedByMe is ignored.
|Allows the user to select a folder in Google Drive.|
|Selects which mode the view uses to display the documents.|
DocsView.setOwnedByMe(boolean | undefined)
|Filters the documents based on whether they are owned by the user, or shared with the user. Do not combine this setting with |
setIncludeFolders(true) is set,
setOwnedByMe is ignored.
|Sets the initial parent folder to display.|
|Filters the documents based on whether they are starred by the user.|
DocsViewMode is an enumerated type for displaying data within a DocsView. Use these values in calls to
|Display documents in a thumbnail grid.|
|Display documents in a detailed list.|
Feature is an enumerated type, for turning on/off features for various views. Use these values in calls to
|Show only documents owned by the user when showing items from Google Drive.|
|Allow user to choose more than one item.|
|Hide the navigation pane. If the navigation pane is hidden, users can only select from the first view chosen.|
|For photo uploads, controls whether per-photo selection (as opposed to per-album) selection is enabled.|
|Whether shared drive items should be included in results. Before enabling this make sure to refer to Google Drive API documentation for enabling shared drives and make any necessary Drive Rest API changes.|
Picker is the top level object representing the UI action with the user. These objects are not created directly, but instead use the
|Get a boolean indicating the current Picker visibility.|
|Specify the callback method called whenever the user has selected an item (or canceled.)|
|Specify a relay URL to circumvent cross-domain issues.|
|Control the visibility of the Picker object.|
|Disposes the Picker object.|
PickerBuilder is used to create
Picker objects. Except where noted otherwise, the return type of methods below is of type
PickerBuilder, allowing you to chain one call after another. See the Google Picker code sample for typical use.
|Add a |
View to the navigation pane.
|Add a |
ViewGroup to the top-level navigation pane.
|Construct the Picker object. The Picker object is returned.|
|Disable a picker feature.|
|Enable a picker feature.|
|Get the relay URL, used for gadgets.rpc.|
|Get the dialog title.|
|Disable the title bar from being shown. To re-enable, call |
setTitle with a non-empty title or undefined.
|Check if a picker |
Feature is enabled.
|Sets the Google Drive App ID needed to allow application to access the user's files via the Google Drive API.|
|Set the callback method. This method is called when the user selects items or cancels. The callback method receives a single callback object. The structure of the callback object is described in the JSON Guide.|
|Sets the Browser API key obtained from Google API Console. See the Developer's Guide for details on how to obtain the Browser API key.|
|Set the document.|
|ISO 639 language code. If the language is not supported, en-US is used. This method provides an alternative to setting the locale at google.load() time. See the Developer's Guide for a list of supported locales.|
|Sets the maximum number of items a user can select.|
|Sets an OAuth token to use for authenticating the current user. Depending on the scope of the token, only certain views display data. Valid scopes are Google Docs, Drive, Photos, YouTube.|
|Sets the origin of the Google Picker dialog. The origin should be set to the |
window.location.protocol + '//' + window.location.host of the top-most page, if your application is running in an iframe.
|Set the relay URL, used for gadgets.rpc.|
|Set the list of selectable MIME types. Use commas to separate MIME types if more than one is required.|
|Set the preferred dialog size. The dialog is auto-centered. It has a minimum size of (566,350) and a maximum size of (1051,650).|
|Set the dialog title.|
|Returns the URI generated by this builder.|
ResourceId is a static class used to generate resource IDs suitable for the Google Documents List API.
|Map a document object to a resource ID.|
View is the abstract base class for the various View classes, such as
|Returns the ViewId for this view.|
|Sets the MIME types included in the view. Use commas to separate MIME types if more than one is required. If you don't set MIME types, files of all MIME types are displayed in the view.|
|For views involving searches, prepopulate the search query with these terms.|
ViewGroup is a visual grouping of views. The root item of the ViewGroup itself must be a
ViewId is an enumerated type, used for constructing
|All Google Drive document types.|
|Google Drive photos.|
|Google Drive photos and videos.|
|Google Drive videos.|
|Google Drive Documents.|
|Google Drive Drawings.|
|Google Drive Folders. |
|Google Drive Forms.|
|PDF files stored in Google Drive.|
|Google Drive Presentations.|
|Google Drive Spreadsheets.|
The following enumerated types are found in callback data returned by the Google Picker API.
Action is an enumerated type representing the action taken by the user to dismiss the dialog. This value is in the
Response.ACTION field in the callback data.
|User canceled the Google Picker dialog.|
|User has chosen at least one item.|
Document is an enumerated type used to convey information about a specific selected item. Only fields which are relevant to the selected item are returned. This value is in the
Response.DOCUMENTS field in the callback data.
|A user-contributed description of the selected item.|
|The duration of a selected video.|
|A URL for this item suitable for embedding in a web page.|
|A URL to an icon for this item.|
|The ID for the selected item.|
|Returns true if the selected item was just uploaded.|
|The timestamp describing when this item was last edited.|
|The MIME type of this item.|
|The name of this item.|
|The number of children contained in this item. For example, the number of files in the selected folder.|
|The parent ID of this item. For example, the folder containing this file.|
ServiceId describing the service this item was selected from.
|An array of |
Thumbnails which describe the attributes of a photo or video. Thumbnails aren't returned if the selected items belong to Google Drive.
Type of the selected item.
|A URL to this item.|
Response is an enumerated type used to convey information about the user's selected items.
Action type representing the action taken by the user to dismiss the dialog.
|An array of |
Documents selected by the user.
|The IDs of the parent folders for the selected items. (For example, IDs of the parent folders whose files were selected.)|
View the user selected these items from.
ServiceId is an enumerated type used to describe the service the item was selected from. This value is in the
Document.SERVICE_ID field of the selected
Thumbnail is an enumerated type used to convey information about a selected photo or video. This value can be found in the
Document.THUMBNAILS field of a selected
|The height of the photo or video in pixels.|
|The width of the photo or video in pixels.|
|A URL to the selected photo or video.|
Type is an enumerated type used to categorize the selected item. This value can be found in the
Document.TYPE field of a selected
|The item is a document.|
|The item is a photo.|
|The item is a video.|