Native Client

Enums

Enumeration List

enum  PP_Bool
enum  PP_CompletionCallback_Flag
enum  
enum  PP_FileType
enum  PP_FileSystemType
enum  PP_VarType
enum  
enum  PP_AudioSampleRate
enum  PP_FileOpenFlags
enum  PP_ImageDataFormat
enum  PP_InputEvent_Type
enum  PP_InputEvent_Modifier
enum  PP_InputEvent_MouseButton
enum  PP_InputEvent_Class
enum  PP_URLRequestProperty
enum  PP_URLResponseProperty

Enumeration Details

anonymous enum

This enumeration contains enumerators of all PPAPI error codes.

Errors are negative valued. Callers should treat all negative values as a failure, even if it's not in the list, since the possible errors are likely to expand and change over time.

Enumerator:
PP_OK 

This value is returned by a function on successful synchronous completion or is passed as a result to a PP_CompletionCallback_Func on successful asynchronous completion.

PP_OK_COMPLETIONPENDING 

This value is returned by a function that accepts a PP_CompletionCallback and cannot complete synchronously.

This code indicates that the given callback will be asynchronously notified of the final result once it is available.

PP_ERROR_FAILED 

This value indicates failure for unspecified reasons.

PP_ERROR_ABORTED 

This value indicates failure due to an asynchronous operation being interrupted.

The most common cause of this error code is destroying a resource that still has a callback pending. All callbacks are guaranteed to execute, so any callbacks pending on a destroyed resource will be issued with PP_ERROR_ABORTED.

If you get an aborted notification that you aren't expecting, check to make sure that the resource you're using is still in scope. A common mistake is to create a resource on the stack, which will destroy the resource as soon as the function returns.

PP_ERROR_BADARGUMENT 

This value indicates failure due to an invalid argument.

PP_ERROR_BADRESOURCE 

This value indicates failure due to an invalid PP_Resource.

PP_ERROR_NOINTERFACE 

This value indicates failure due to an unavailable PPAPI interface.

PP_ERROR_NOACCESS 

This value indicates failure due to insufficient privileges.

PP_ERROR_NOMEMORY 

This value indicates failure due to insufficient memory.

PP_ERROR_NOSPACE 

This value indicates failure due to insufficient storage space.

PP_ERROR_NOQUOTA 

This value indicates failure due to insufficient storage quota.

PP_ERROR_INPROGRESS 

This value indicates failure due to an action already being in progress.

PP_ERROR_NOTSUPPORTED 

This value indicates failure due to a file that does not exist.

The requested command is not supported by the browser.

PP_ERROR_BLOCKS_MAIN_THREAD 

Returned if you try to use a null completion callback to "block until complete" on the main thread.

Blocking the main thread is not permitted to keep the browser responsive (otherwise, you may not be able to handle input events, and there are reentrancy and deadlock issues).

The goal is to provide blocking calls from background threads, but PPAPI calls on background threads are not currently supported. Until this support is complete, you must either do asynchronous operations on the main thread, or provide an adaptor for a blocking background thread to execute the operaitions on the main thread.

PP_ERROR_FILENOTFOUND 
PP_ERROR_FILEEXISTS 

This value indicates failure due to a file that already exists.

PP_ERROR_FILETOOBIG 

This value indicates failure due to a file that is too big.

PP_ERROR_FILECHANGED 

This value indicates failure due to a file having been modified unexpectedly.

PP_ERROR_TIMEDOUT 

This value indicates failure due to a time limit being exceeded.

PP_ERROR_USERCANCEL 

This value indicates that the user cancelled rather than providing expected input.

PP_ERROR_CONTEXT_LOST 

This value indicates that the graphics context was lost due to a power management event.

anonymous enum

This enumeration contains audio frame count constants.

PP_AUDIOMINSAMPLEFRAMECOUNT is the minimum possible frame count. PP_AUDIOMAXSAMPLEFRAMECOUNT is the maximum possible frame count.

Enumerator:
PP_AUDIOMINSAMPLEFRAMECOUNT 
PP_AUDIOMAXSAMPLEFRAMECOUNT 

PP_AudioSampleRate is an enumeration of the different audio sampling rates.

PP_AUDIOSAMPLERATE_44100 is the sample rate used on CDs and PP_AUDIOSAMPLERATE_48000 is the sample rate used on DVDs and Digital Audio Tapes.

Enumerator:
PP_AUDIOSAMPLERATE_NONE 
PP_AUDIOSAMPLERATE_44100 
PP_AUDIOSAMPLERATE_48000 
enum PP_Bool

The PP_Bool enum is a boolean value for use in PPAPI C headers.

The standard bool type is not available to pre-C99 compilers, and is not guaranteed to be compatible between C and C++, whereas the PPAPI C headers can be included from C or C++ code.

Enumerator:
PP_FALSE 
PP_TRUE 

This enumeration contains flags used to control how non-NULL callbacks are scheduled by asynchronous methods.

Enumerator:
PP_COMPLETIONCALLBACK_FLAG_NONE 

By default any non-NULL callback will always invoked asynchronously, on success or error, even if the operation could complete synchronously without blocking.

The method taking such callback will always return PP_OK_COMPLETIONPENDING. The callback will be invoked on the main thread of PPAPI execution.

PP_COMPLETIONCALLBACK_FLAG_OPTIONAL 

This flag allows any method taking such callback to complete synchronously and not call the callback if the operation would not block.

This is useful when performance is an issue, and the operation bandwidth should not be limited to the processing speed of the message loop.

On synchronous method completion, the completion result will be returned by the method itself. Otherwise, the method will return PP_OK_COMPLETIONPENDING, and the callback will be invoked asynchronously on the main thread of PPAPI execution.

The PP_FileOpenFlags enum contains file open constants.

Enumerator:
PP_FILEOPENFLAG_READ 

Requests read access to a file.

PP_FILEOPENFLAG_WRITE 

Requests write access to a file.

May be combined with PP_FILEOPENFLAG_READ to request read and write access.

PP_FILEOPENFLAG_CREATE 

Requests that the file be created if it does not exist.

If the file already exists, then this flag is ignored unless PP_FILEOPENFLAG_EXCLUSIVE was also specified, in which case FileIO::Open() will fail.

PP_FILEOPENFLAG_TRUNCATE 

Requests that the file be truncated to length 0 if it exists and is a regular file.

PP_FILEOPENFLAG_WRITE must also be specified.

PP_FILEOPENFLAG_EXCLUSIVE 

Requests that the file is created when this flag is combined with PP_FILEOPENFLAG_CREATE.

If this flag is specified, and the file already exists, then the FileIO::Open() call will fail.

The PP_FileSystemType enum contains file system type constants.

Enumerator:
PP_FILESYSTEMTYPE_INVALID 

For identified invalid return values.

PP_FILESYSTEMTYPE_EXTERNAL 

For external file system types.

PP_FILESYSTEMTYPE_LOCALPERSISTENT 

For local persistant file system types.

PP_FILESYSTEMTYPE_LOCALTEMPORARY 

For local temporary file system types.

The PP_FileType enum contains file type constants.

Enumerator:
PP_FILETYPE_REGULAR 

A regular file type.

PP_FILETYPE_DIRECTORY 

A directory.

PP_FILETYPE_OTHER 

A catch-all for unidentified types.

PP_ImageDataFormat is an enumeration of the different types of image data formats.

The third part of each enumeration value describes the memory layout from the lowest address to the highest. For example, BGRA means the B component is stored in the lowest address, no matter what endianness the platform is using.

The PREMUL suffix implies pre-multiplied alpha is used. In this mode, the red, green and blue color components of the pixel data supplied to an image data should be pre-multiplied by their alpha value. For example: starting with floating point color components, here is how to convert them to 8-bit premultiplied components for image data:

...components of a pixel, floats ranging from 0 to 1... float red = 1.0f; float green = 0.50f; float blue = 0.0f; float alpha = 0.75f; ...components for image data are 8-bit values ranging from 0 to 255... uint8_t image_data_red_premul = (uint8_t)(red * alpha * 255.0f); uint8_t image_data_green_premul = (uint8_t)(green * alpha * 255.0f); uint8_t image_data_blue_premul = (uint8_t)(blue * alpha * 255.0f); uint8_t image_data_alpha_premul = (uint8_t)(alpha * 255.0f);

Note: The resulting pre-multiplied red, green and blue components should not be greater than the alpha value.

Enumerator:
PP_IMAGEDATAFORMAT_BGRA_PREMUL 
PP_IMAGEDATAFORMAT_RGBA_PREMUL 
Enumerator:
PP_INPUTEVENT_CLASS_MOUSE 

Request mouse input events.

Normally you will request mouse events by calling RequestInputEvents(). The only use case for filtered events (via RequestFilteringInputEvents()) is for instances that have irregular outlines and you want to perform hit testing, which is very uncommon. Requesting non-filtered mouse events will lead to higher performance.

PP_INPUTEVENT_CLASS_KEYBOARD 

Requests keyboard events.

Often you will want to request filtered mode (via RequestFilteringInputEvents) for keyboard events so you can pass on events (by returning false) that you don't handle. For example, if you don't request filtered mode and the user pressed "Page Down" when your instance has focus, the page won't scroll which will be a poor experience.

A small number of tab and window management commands like Alt-F4 are never sent to the page. You can not request these keyboard commands since it would allow pages to trap users on a page.

PP_INPUTEVENT_CLASS_WHEEL 

Identifies scroll wheel input event.

Wheel events must be requested in filtering mode via RequestFilteringInputEvents(). This is because many wheel commands should be forwarded to the page.

Most instances will not need this event. Consuming wheel events by returning true from your filtered event handler will prevent the user from scrolling the page when the mouse is over the instance which can be very annoying.

If you handle wheel events (for example, you have a document viewer which the user can scroll), the recommended behavior is to return false only if the wheel event actually causes your document to scroll. When the user reaches the end of the document, return false to indicating that the event was not handled. This will then forward the event to the containing page for scrolling, producing the nested scrolling behavior users expect from frames in a page.

PP_INPUTEVENT_CLASS_TOUCH 

Identifies touch input events.

Request touch events only if you intend to handle them. If the browser knows you do not need to handle touch events, it can handle them at a higher level and achieve higher performance.

PP_INPUTEVENT_CLASS_IME 

Identifies IME composition input events.

Request this input event class if you allow on-the-spot IME input.

This enumeration contains event modifier constants.

Each modifier is one bit. Retrieve the modifiers from an input event using the GetEventModifiers function on PPB_InputEvent.

Enumerator:
PP_INPUTEVENT_MODIFIER_SHIFTKEY 
PP_INPUTEVENT_MODIFIER_CONTROLKEY 
PP_INPUTEVENT_MODIFIER_ALTKEY 
PP_INPUTEVENT_MODIFIER_METAKEY 
PP_INPUTEVENT_MODIFIER_ISKEYPAD 
PP_INPUTEVENT_MODIFIER_ISAUTOREPEAT 
PP_INPUTEVENT_MODIFIER_LEFTBUTTONDOWN 
PP_INPUTEVENT_MODIFIER_MIDDLEBUTTONDOWN 
PP_INPUTEVENT_MODIFIER_RIGHTBUTTONDOWN 
PP_INPUTEVENT_MODIFIER_CAPSLOCKKEY 
PP_INPUTEVENT_MODIFIER_NUMLOCKKEY 

This enumeration contains constants representing each mouse button.

To get the mouse button for a mouse down or up event, use GetMouseButton on PPB_InputEvent.

Enumerator:
PP_INPUTEVENT_MOUSEBUTTON_NONE 
PP_INPUTEVENT_MOUSEBUTTON_LEFT 
PP_INPUTEVENT_MOUSEBUTTON_MIDDLE 
PP_INPUTEVENT_MOUSEBUTTON_RIGHT 

This enumeration contains the types of input events.

Enumerator:
PP_INPUTEVENT_TYPE_UNDEFINED 
PP_INPUTEVENT_TYPE_MOUSEDOWN 

Notification that a mouse button was pressed.

Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class.

PP_INPUTEVENT_TYPE_MOUSEUP 

Notification that a mouse button was released.

Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class.

PP_INPUTEVENT_TYPE_MOUSEMOVE 

Notification that a mouse button was moved when it is over the instance or dragged out of it.

Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class.

PP_INPUTEVENT_TYPE_MOUSEENTER 

Notification that the mouse entered the instance's bounds.

Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class.

PP_INPUTEVENT_TYPE_MOUSELEAVE 

Notification that a mouse left the instance's bounds.

Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class.

PP_INPUTEVENT_TYPE_WHEEL 

Notification that the scroll wheel was used.

Register for this event using the PP_INPUTEVENT_CLASS_WHEEL class.

PP_INPUTEVENT_TYPE_RAWKEYDOWN 

Notification that a key transitioned from "up" to "down".

Register for this event using the PP_INPUTEVENT_CLASS_KEYBOARD class.

PP_INPUTEVENT_TYPE_KEYDOWN 

Notification that a key was pressed.

This does not necessarily correspond to a character depending on the key and language. Use the PP_INPUTEVENT_TYPE_CHAR for character input.

Register for this event using the PP_INPUTEVENT_CLASS_KEYBOARD class.

PP_INPUTEVENT_TYPE_KEYUP 

Notification that a key was released.

Register for this event using the PP_INPUTEVENT_CLASS_KEYBOARD class.

PP_INPUTEVENT_TYPE_CHAR 

Notification that a character was typed.

Use this for text input. Key down events may generate 0, 1, or more than one character event depending on the key, locale, and operating system.

Register for this event using the PP_INPUTEVENT_CLASS_KEYBOARD class.

PP_INPUTEVENT_TYPE_CONTEXTMENU 

Register for this event using the PP_INPUTEVENT_CLASS_MOUSE class.

PP_INPUTEVENT_TYPE_IME_COMPOSITION_START 

Notification that an input method composition process has just started.

Register for this event using the PP_INPUTEVENT_CLASS_IME class.

PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE 

Notification that the input method composition string is updated.

Register for this event using the PP_INPUTEVENT_CLASS_IME class.

PP_INPUTEVENT_TYPE_IME_COMPOSITION_END 

Notification that an input method composition process has completed.

Register for this event using the PP_INPUTEVENT_CLASS_IME class.

PP_INPUTEVENT_TYPE_IME_TEXT 

Notification that an input method committed a string.

Register for this event using the PP_INPUTEVENT_CLASS_IME class.

This enumeration contains properties that can be set on a URL request.

Enumerator:
PP_URLREQUESTPROPERTY_URL 

This corresponds to a string (PP_VARTYPE_STRING).

PP_URLREQUESTPROPERTY_METHOD 

This corresponds to a string (PP_VARTYPE_STRING); either POST or GET.

Refer to the HTTP Methods documentation for further information.

PP_URLREQUESTPROPERTY_HEADERS 

This corresponds to a string (PP_VARTYPE_STRING);
delimited.

Refer to the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"Header Field Definitions documentaiton for further information.

PP_URLREQUESTPROPERTY_STREAMTOFILE 

This corresponds to a PP_Bool (PP_VARTYPE_BOOL; default=PP_FALSE).

Set this value to PP_TRUE if you want to download the data to a file. Use PPB_URLLoader.FinishStreamingToFile() to complete the download.

PP_URLREQUESTPROPERTY_FOLLOWREDIRECTS 

This corresponds to a PP_Bool (PP_VARTYPE_BOOL; default=PP_TRUE).

Set this value to PP_FALSE if you want to use PPB_URLLoader.FollowRedirects() to follow the redirects only after examining redirect headers.

PP_URLREQUESTPROPERTY_RECORDDOWNLOADPROGRESS 

This corresponds to a PP_Bool (PP_VARTYPE_BOOL; default=PP_FALSE).

Set this value to PP_TRUE if you want to be able to poll the download progress using PPB_URLLoader.GetDownloadProgress().

PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS 

This corresponds to a PP_Bool (default=PP_FALSE).

Set this value to PP_TRUE if you want to be able to poll the upload progress using PPB_URLLoader.GetUplaodProgress().

PP_URLREQUESTPROPERTY_CUSTOMREFERRERURL 

This corresponds to a string (PP_VARTYPE_STRING) or may be undefined (PP_VARTYPE_UNDEFINED; default).

Set it to a string to set a custom referrer (if empty, the referrer header will be omitted), or to undefined to use the default referrer. Only loaders with universal access (only available on trusted implementations) will accept URLRequestInfo objects that try to set a custom referrer; if given to a loader without universal access, PP_ERROR_BADARGUMENT will result.

PP_URLREQUESTPROPERTY_ALLOWCROSSORIGINREQUESTS 

This corresponds to a PP_Bool (PP_VARTYPE_BOOL; default=PP_FALSE).

Whether cross-origin requests are allowed. Cross-origin requests are made using the CORS (Cross-Origin Resource Sharing) algorithm to check whether the request should be allowed. For the complete CORS algorithm, refer to the Cross-Origin Resource Sharing documentation.

PP_URLREQUESTPROPERTY_ALLOWCREDENTIALS 

This corresponds to a PP_Bool (PP_VARTYPE_BOOL; default=PP_FALSE).

Whether HTTP credentials are sent with cross-origin requests. If false, no credentials are sent with the request and cookies are ignored in the response. If the request is not cross-origin, this property is ignored.

PP_URLREQUESTPROPERTY_CUSTOMCONTENTTRANSFERENCODING 

This corresponds to a string (PP_VARTYPE_STRING) or may be undefined (PP_VARTYPE_UNDEFINED; default).

Set it to a string to set a custom content-transfer-encoding header (if empty, that header will be omitted), or to undefined to use the default (if any). Only loaders with universal access (only available on trusted implementations) will accept URLRequestInfo objects that try to set a custom content transfer encoding; if given to a loader without universal access, PP_ERROR_BADARGUMENT will result.

PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD 

This corresponds to an integer (PP_VARTYPE_INT32); default is not defined and is set by the browser, possibly depending on system capabilities.

Set it to an integer to set an upper threshold for the prefetched buffer of an asynchronous load. When exceeded, the browser will defer loading until PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD is hit, at which time it will begin prefetching again. When setting this property, PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD must also be set. Behavior is undefined if the former is <= the latter.

PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERTHRESHOLD 

This corresponds to an integer (PP_VARTYPE_INT32); default is not defined and is set by the browser to a value appropriate for the default PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD.

Set it to an integer to set a lower threshold for the prefetched buffer of an asynchronous load. When reached, the browser will resume loading if If PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD had previously been reached. When setting this property, PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD must also be set. Behavior is undefined if the former is >= the latter.

This enumeration contains properties set on a URL response.

Enumerator:
PP_URLRESPONSEPROPERTY_URL 

This corresponds to a string (PP_VARTYPE_STRING); an absolute URL formed by resolving the relative request URL with the absolute document URL.

Refer to the HTTP Request URI and HTML Resolving Relative URIs documentation for further information.

PP_URLRESPONSEPROPERTY_REDIRECTURL 

This corresponds to a string (PP_VARTYPE_STRING); the absolute URL returned in the response header's 'Location' field if this is a redirect response, an empty string otherwise.

Refer to the HTTP Status Codes - Redirection documentation for further information.

PP_URLRESPONSEPROPERTY_REDIRECTMETHOD 

This corresponds to a string (PP_VARTYPE_STRING); the HTTP method to be used in a new request if this is a redirect response, an empty string otherwise.

Refer to the HTTP Status Codes - Redirection documentation for further information.

PP_URLRESPONSEPROPERTY_STATUSCODE 

This corresponds to an int32 (PP_VARETYPE_INT32); the status code from the response, e.g., 200 if the request was successful.

Refer to the HTTP Status Code and Reason Phrase documentation for further information.

PP_URLRESPONSEPROPERTY_STATUSLINE 

This corresponds to a string (PP_VARTYPE_STRING); the status line from the response.

Refer to the HTTP Response Status Line documentation for further information.

PP_URLRESPONSEPROPERTY_HEADERS 

This corresponds to a string(PP_VARTYPE_STRING), a
-delimited list of header field/value pairs of the form "field: value", returned by the server.

Refer to the HTTP Header Field Definitions documentation for further information.

enum PP_VarType

The PP_VarType is an enumeration of the different types that can be contained within a PP_Var structure.

Enumerator:
PP_VARTYPE_UNDEFINED 

An undefined value.

PP_VARTYPE_NULL 

A NULL value.

This is similar to undefined, but JavaScript differentiates the two so it is exposed here as well.

PP_VARTYPE_BOOL 

A boolean value, use the as_bool member of the var.

PP_VARTYPE_INT32 

A 32-bit integer value.

Use the as_int member of the var.

PP_VARTYPE_DOUBLE 

A double-precision floating point value.

Use the as_double member of the var.

PP_VARTYPE_STRING 

The Var represents a string.

The as_id field is used to identify the string, which may be created and retrieved from the PPB_Var interface.

PP_VARTYPE_OBJECT 

Represents a JavaScript object.

This vartype is not currently usable from modules, although it is used internally for some tasks.

PP_VARTYPE_ARRAY 

Arrays and dictionaries are not currently supported but will be added in future revisions.

These objects are reference counted so be sure to properly AddRef/Release them as you would with strings to ensure your module will continue to work with future versions of the API.

PP_VARTYPE_DICTIONARY 

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.