The Browser Plug-in API consists of the following two parts:
Adaptation of the Netscape Plug-in API for the Symbian platform
Extensions
The browser and plug-ins interact with each other through two interfaces:
NPN interface-- plug-in instances call these to communicate with the browser
NPP interface—the browser calls these to perform operations on a plug-in
Each function in the API has the prefix
NPN
or
NPP
to indicate which interface
it uses to communicate.
The tables in this section contain the functions adapted from the Netscape Plug-in API.
The browser calls the functions in this section to initialize or delete a plug-in instance.
Plug-in API Type |
|
Syntax |
|
Parameters |
|
Returns |
None |
Description |
Exchanges function tables between the browser and the plug-in. |
Plug-in API Type |
|
Syntax |
|
Parameters | NPMIMEType pluginType The MIME type NPP instance The plug-in instance uint16 mode The mode Value: NP_EMBED CDesCArray* argn Attribute of the <object> tag CDesCArray* argv Attribute of the <object> tag NPSavedData* saved saved data is not supported |
---|---|
Returns |
One of the following:
|
Description |
Creates a new instance of the plug-in. |
Plug-in API Type |
|
Syntax |
|
Parameters |
The instance to be destroyed
Not supported |
Returns |
For values, see Table 3. |
Description |
Deletes a plug-in instance. |
Plug-in API Type |
|
Syntax |
|
Parameters |
None |
Returns |
None |
Description |
Deletes all resources allocated for the plug-in DLL. |
This function has an empty implementation in the browser. If called, it does nothing.
This function has an empty implementation in the browser. If called, this function does nothing.
Windowless plug-ins are not supported in the S60 platform. Therefore, this function has an empty implementation in the browser. If called, this function does nothing.
This function has an empty implementation in the browser. If called, this function does nothing.
Not supported. The browser never calls this plug-in function.
Not supported. The browser never calls this plug-in function.
Plug-in API Type |
|
Syntax |
|
Parameters |
The plug-in instance
The window parameters |
Returns |
For the status code values, see Table 3. |
Description |
Sets the parent window and the size of the plug-in. The coordinates are always relative to the parent window. |
This function has an empty implementation in the browser. If called, this function does nothing.
This function has an empty implementation in the browser, which can be called but does nothing.
This function has an empty implementation in the browser. If called, this function does nothing.
This function has an empty implementation in the browser. If called, this function does nothing.
Plug-in API Type |
|
Syntax |
|
Parameters |
The instance of the plug-in
The MIME type of the stream The new stream object A flag that indicates whether or not the stream is searchable. Searchable
streams are not supported. Therefore, the flag is always set to
|
Parameters (continued) |
The type of the stream. The plug-in should set the stream type. Currently supported stream types are:
|
Returns |
For the status code values, see
|
Description |
Notifies a plug-in instance of a new data stream. |
Plug-in API Type |
|
Syntax |
|
Parameters | NPP instance The plug-in instance NPStream* stream The stream to be destroyed NPReason reason The reason for destroying the stream. The reason parameter can have one of the following values: NPRES_DONE (Most common)-- normal completion; all data was sent to the instance. NPRES_USER_BREAK--the user canceled the stream NPRES_NETWORK_ERR--the stream failed because of problems with the network, disk I/O error, lack of memory, or some other problem. |
---|---|
Returns |
For the status code values, see
|
Description |
Destroys the stream that was previously created to stream data to the plug-in. |
Plug-in API Type |
|
Syntax |
|
Parameters |
The plug-in instance
The stream
The file name |
Returns |
None |
Description |
A file name is passed to the plug-in in which the stream data is stored. The plug-in can access the file and use the data received. |
Plug-in API Type |
|
Syntax |
|
Parameters |
The plug-in instance
The stream
The offset in the stream The size of the new data The data itself |
Returns |
If successful, this function returns the number of bytes consumed by the plug-in instance. If unsuccessful, this function destroys the stream by returning a negative value. |
Description |
Writes a chunk of data to the plug-in. |
Plug-in API Type |
|
Syntax |
|
Parameters |
The plug-in instance
The stream |
Returns |
The maximum data size that the plug-in can handle. |
Description |
The browser calls the
|
Plug-in API Type |
|
Syntax |
|
Parameters |
The plug-in instance The URL to load The target window |
Returns |
For the status code values, see
|
Description |
The plug-in calls this function to request the browser to load a URL. |
Note |
If the target window is
If the target window
is
|
Plug-in API Type |
|
Syntax |
|
Parameters |
The plug-in instance
The URL to load
The target window The context to be returned to the plug-in with the notification. |
Returns |
For the status code values, see
|
Description |
The plug-in calls this function to request the browser to load a URL. A requesting plug-in is informed when the load completes. |
Note |
If the target window is
|
Plug-in API Type |
|
Syntax |
|
Parameters | NPP instance The plug-in instance const TDesC& url The URL to post to const TDesC* target The target window const TDesC& buf A buffer NPBool file A flag indicating the contents of the buffer. Value: One of the following: ETrue indicates that the buffer contains a file name. EFalse indicates that the buffer contains the posted data. |
---|---|
Returns |
For the status code values, see
|
Description |
Posts information through the browser and requests that the result be displayed or passed to the named target window or frame. If a name is not provided, the target is assumed to be the plug-in itself. |
Note |
If the target window is
If the
target window is
|
Plug-in API Type |
|
Syntax |
|
Parameters | NPP instance The plug-in instance const TDesC& url The URL to post to const TDesC* tgt The target window const TDesC& buf A buffer NPBool file A flag indicating the contents of the buffer. Value: One of the following: ETrue indicates that the buffer contains a file name. EFalse indicates that the buffer contains the posted data. void* notifyData The context to be returned to the plug-in with the notification. |
---|---|
Returns |
For the status code values, see
|
Description |
The plug-in calls this function to request the browser to post to a URL. The browser informs the plug-in when the load request is complete. |
Note |
If the target window is
If the
target window is
|
Plug-in API Type |
|
Syntax |
|
Parameters | NPP instance The plug-in instance const TDesC& url URL of the NPN_GetURLNotify function or of the NPN_PostURLNotify function request const TDesC* target Reason code for completion of the request Values: One of the following: NPRES_DONE: Normal completion; all data was sent to the instance. This is the most common value. NPRES_USER_BREAK: The user canceled the stream directly. NPRES_NETWORK_ERR: The stream failed because of problems with the network, disk I/O error, lack of memory, or some other problem. void* notifyData Context to be returned to the plug-in with the notification |
---|---|
Returns |
For the status code values, see
|
Description |
Notifies the instance of the completion
of a URL request made by the
|
Plug-in API Type |
|
Syntax |
|
Parameters |
The desired memory size |
Returns |
The allocated memory. If this function fails to complete, it returns
|
Description |
Allocates memory directly from the operating system on behalf of the plug-in. |
This function has an empty implementation in the browser. If called, this function does nothing.
Plug-in API Type |
|
Syntax |
|
Parameters |
A pointer to the memory to be freed. |
Returns |
None. |
Description |
Frees memory that was previously allocated by the browser. |
Plug-in API Type |
|
Syntax |
|
Parameters |
If
set to
If set to
|
Returns |
None |
Description |
Requests the browser to rescan the file system for newly installed plug-ins. |
Plug-in API Type |
|
Syntax |
|
Parameters |
The plug-in instance
The message to display |
Returns |
None. |
Description |
Returns the current browser status. Displays a small message window at the top right corner. |
Note |
Plug-in API Type |
|
Syntax |
|
Parameters |
The plug-in instance |
Returns |
The User Agent string configured in the system. |
Description |
Returns the currently configured user agent to the plug-in. |
Plug-in API Type |
|
Syntax |
|
Parameters |
Pointer to the major version number of the plug-in Pointer to the minor version number of the plug-in
Pointer to the major version number of the browser Pointer to the minor version number of the browser |
Returns |
None |
Description |
Returns version information for the Browser Plug-in API. |
Note |
The plug-in can implement this function.
The
The browser does not implement this function. |
The Browser Plug-in API does not support Java communication functions.
The plug-in can use this interface to communicate with the browser.
Syntax |
|
Parameters |
None |
Returns |
S60 returns
|
Description |
Gets the pointer to the minor version number of the plug-in version number of the Browser Plug-in API. |
Syntax |
|
Parameters |
A pointer to the plug-in control window |
Returns |
None |
Description |
Called when the plug-in has completed its creation. |
Note |
This function is called from the
|
Syntax |
|
Parameters |
None |
Returns |
None |
Description |
Called after the plug-in has been deleted. |
Note |
This function is called from the destructor of the plug-in. |
Syntax |
|
Parameters |
Name of the URL to open |
Returns |
None |
Description |
Called by the plug-in to open a URL in the parent frame. |
Note |
This function is not implemented in the S60 platform. |
Syntax |
|
Parameters |
The URL to open
The name of the target window or frame |
Returns |
None |
Description |
Called by the plug-in to open a URL in a named window or frame. |
Note |
This function is not implemented in the S60 platform. |
Syntax |
|
Parameters |
None |
Returns |
|
Description |
Specifies whether or not the frame has a previous navigation history item. |
Note |
This function is not implemented in the S60 platform. |
Syntax |
|
Parameters |
None |
Returns |
None |
Description |
Informs the browser to load the next navigation history URL in its parent frame. |
Note |
This function is not implemented in the S60 platform. |
Syntax |
|
Parameters |
None |
Returns |
|
Description |
Returns whether the frame has a next navigation history item. |
Note |
This function is not implemented in the S60 platform. |
Syntax |
|
Parameters |
None |
Returns |
None |
Description |
Informs the browser to load the next navigation history URL in its parent frame. |
Note |
This function is not implemented in the S60 platform. |
Syntax |
|
Parameters |
None |
Returns |
A pointer to the parent control window. |
Description |
Returns the window system level control object for the plug-in. |
Syntax |
|
Parameters |
None |
Returns |
Observer that the plug-in can use to send events to the browser. |
Description |
Returns the observer for the plug-in control. |
Syntax |
|
Parameters |
MPluginNotifier* aNotifier Pointer to an interface that the browser can use to send events to the plug-in. |
Returns |
None |
Description |
Sets the plug-in notifier allowing the plug-in to control portions of the browser. |
Syntax |
|
Parameters | TNotificationType aCallType The event type that is passed to the plug-in Values: 1 EEditCut 2 EEditCopy 3 EEditPaste 4 EEditDelete 5 EApplicationFocusChanged 6 ESystemNotification TAny *aParam The parameter associated with the event |
---|---|
Returns |
Not used. |
Description |
Notifies the plug-in of an event. |
This structure is not supported in the S60 platform.
This structure is not supported in the S60 platform.
This structure is not supported in the S60 platform.
Syntax |
|
Parameters |
A private value that a plug-in can use to store a pointer to an internal data structure associated with the instance. The browser does not modify this value. A private value that the browser uses to store data associated with the plug-in instance. The plug-in should not modify this value. |
Description |
The browser creates an NPP structure
for each plug-in instance and passes a pointer to it to the
The
|
Note |
This structure is not supported in the S60 platform.
Syntax |
|
Parameters |
The top of the rectangle The left side of the rectangle The bottom of the rectangle The right side of the rectangle |
Description |
Defines the area of the plug-in window to be updated, painted, invalidated, or clipped to. |
This structure is not supported.
Syntax |
|
Parameters | void* pdata A private value that the plug-in can use to store a pointer to private data associated with the plug-in instance. The browser does not modify this value. void* ndata A private value that can store data associated with the plug-in instance. The plug-in should not modify this value. HBufC* url The URL from which the data in the stream is read or to which the data is written. uint32 end The offset, in bytes, of the end of the stream. This is equivalent to the length of the stream in bytes. This value can be zero for streams of unknown length, such as streams returned from older FTP servers or generated “on the fly” by CGI scripts. uint32 lastmodified The time at which the data in the URL was last modified (if applicable), measured in seconds since 12:00 midnight GMT, January 1, 1970. void* notifyData This parameter is used only for streams generated in response to a NPN_GetURLNotify function or a NPN_PostURLNotify function request. Value: NPN_GetURLNotify function's notifyData parameter value NPN_PostURLNotify function's notifyData parameter value null for other streams |
---|---|
Description |
The browser allocates and initializes the
|
Syntax |
|
Parameters | void* window A handle to a native window element int32 x The x coordinate of the top left corner of the plug-in relative to the page. The plug-in should not modify this value. int32 y The y coordinate of the top left corner of the plug-in relative to the page. The plug-in should not modify this value. uint32 width The width of the plug-in area. The plug-in should not modify this value. uint32 height The height of the plug-in area. The plug-in should not modify this value. NPRect clipRect The clipping rectangle of the plug-in. The origin is the top left corner of the window. Clipping to the clipRect prevents the plug-in from overwriting the status bar, scroll bars, and other page elements when partially scrolled off the screen. NPWindowType type Specifies whether the NPWindow instance represents a window or a drawable. Values: 1 NPWindowTypeWindow: Indicates that the window field holds a platform-specific handle to a window. The plug-in is considered windowed. 2 NPWindowTypeDrawable: Not supported in the S60 platform browsers. |
---|---|
Description |
The
A windowed
plug-in is drawn into a native window (or portion of a native window) on a
Web page. For windowed plug-ins, the browser calls the
|