npapi.h

Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: NPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Netscape Public License
00006  * Version 1.1 (the "License"); you may not use this file except in
00007  * compliance with the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/NPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *    Portions Copyright (c) 2004-2006, Nokia Corporation
00024  *
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the NPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the NPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 /* NOTES:
00041  * Nokia modified this file, by changing certain variables for the purpose of
00042  * porting the file to the Symbian platform on May 1st, 2004.
00043  */
00044 
00045 
00046 /*
00047  *  npapi.h $Revision: 3.31 $
00048  *  Netscape client plug-in API spec
00049  */
00050 
00051 #ifndef _NPAPI_H_
00052 #define _NPAPI_H_
00053 
00054 #ifdef __OS2__
00055 #pragma pack(1)
00056 #endif
00057 
00058 #include "prtypes.h"
00059 /* Copied from xp_core.h */
00060 /* removed #ifdef for hpux defined in /usr/include/model.h */
00061 #ifndef XP_MAC
00062 #ifndef _INT16
00063 #define _INT16
00064 #endif
00065 #ifndef _INT32
00066 #define _INT32
00067 #endif
00068 #ifndef _UINT16
00069 #define _UINT16
00070 #endif
00071 #ifndef _UINT32
00072 #define _UINT32
00073 #endif
00074 #endif
00075 
00076 /*
00077  * NO_NSPR_10_SUPPORT disables the inclusion
00078  * of obsolete/protypes.h, whose int16, uint16,
00079  * int32, and uint32 typedefs conflict with those
00080  * in this file.
00081  */
00082 #ifndef NO_NSPR_10_SUPPORT
00083 #define NO_NSPR_10_SUPPORT
00084 #endif
00085 #ifdef OJI
00086 #include "jri.h"                /* Java Runtime Interface */
00087 #endif
00088 
00089 #if defined (__OS2__ ) || defined (OS2)
00090 # ifndef XP_OS2
00091 #   define XP_OS2 1
00092 # endif /* XP_OS2 */
00093 #endif /* __OS2__ */
00094 
00095 #ifdef _WINDOWS
00096 # include <windef.h>
00097 # ifndef XP_WIN
00098 #   define XP_WIN 1
00099 # endif /* XP_WIN */
00100 #endif /* _WINDOWS */
00101 
00102 #ifdef __MWERKS__
00103 # define _declspec __declspec
00104 # ifdef macintosh
00105 #   ifndef XP_MAC
00106 #     define XP_MAC 1
00107 #   endif /* XP_MAC */
00108 # endif /* macintosh */
00109 # ifdef __INTEL__
00110 #   undef NULL
00111 #   ifndef XP_WIN
00112 #     define XP_WIN 1
00113 #   endif /* XP_WIN */
00114 # endif /* __INTEL__ */
00115 #endif /* __MWERKS__ */
00116 
00117 #ifndef __SYMBIAN32__
00118 #if defined(XP_MAC) || defined(XP_MACOSX)
00119   #include <Quickdraw.h>
00120   #include <Events.h>
00121 #endif
00122 
00123 #if defined(XP_UNIX)
00124 # include <stdio.h>
00125 # if defined(MOZ_X11)
00126 #   include <X11/Xlib.h>
00127 #   include <X11/Xutil.h>
00128 # endif
00129 #endif
00130 #endif
00131 
00132 /*----------------------------------------------------------------------*/
00133 /*                        Plugin Version Constants                      */
00134 /*----------------------------------------------------------------------*/
00135 
00136 #define NP_VERSION_MAJOR 0
00137 #define NP_VERSION_MINOR 13
00138 
00139 
00140 /* The OS/2 version of Netscape uses RC_DATA to define the
00141    mime types, file extentions, etc that are required.
00142    Use a vertical bar to separate types, end types with \0.
00143    FileVersion and ProductVersion are 32bit ints, all other
00144    entries are strings the MUST be terminated wwith a \0.
00145 
00146 AN EXAMPLE:
00147 
00148 RCDATA NP_INFO_ProductVersion { 1,0,0,1,}
00149 
00150 RCDATA NP_INFO_MIMEType    { "video/x-video|",
00151                              "video/x-flick\0" }
00152 RCDATA NP_INFO_FileExtents { "avi|",
00153                              "flc\0" }
00154 RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
00155                              "MMOS2 Flc/Fli player(*.flc)\0" }
00156 
00157 RCDATA NP_INFO_FileVersion       { 1,0,0,1 }
00158 RCDATA NP_INFO_CompanyName       { "Netscape Communications\0" }
00159 RCDATA NP_INFO_FileDescription   { "NPAVI32 Extension DLL\0"
00160 RCDATA NP_INFO_InternalName      { "NPAVI32\0" )
00161 RCDATA NP_INFO_LegalCopyright    { "Copyright Netscape Communications \251 1996\0"
00162 RCDATA NP_INFO_OriginalFilename  { "NVAPI32.DLL" }
00163 RCDATA NP_INFO_ProductName       { "NPAVI32 Dynamic Link Library\0" }
00164 
00165 */
00166 
00167 
00168 /* RC_DATA types for version info - required */
00169 #define NP_INFO_ProductVersion      1
00170 #define NP_INFO_MIMEType            2
00171 #define NP_INFO_FileOpenName        3
00172 #define NP_INFO_FileExtents         4
00173 
00174 /* RC_DATA types for version info - used if found */
00175 #define NP_INFO_FileDescription     5
00176 #define NP_INFO_ProductName         6
00177 
00178 /* RC_DATA types for version info - optional */
00179 #define NP_INFO_CompanyName         7
00180 #define NP_INFO_FileVersion         8
00181 #define NP_INFO_InternalName        9
00182 #define NP_INFO_LegalCopyright      10
00183 #define NP_INFO_OriginalFilename    11
00184 
00185 #ifndef RC_INVOKED
00186 
00187 
00188 
00189 /*----------------------------------------------------------------------*/
00190 /*                       Definition of Basic Types                      */
00191 /*----------------------------------------------------------------------*/
00192 
00193 #ifndef _UINT16
00194 typedef unsigned short uint16;
00195 #endif
00196 
00197 #ifndef _UINT32
00198 #    if defined(__alpha)
00199 typedef unsigned int uint32;
00200 #    else  /* __alpha */
00201 typedef unsigned long uint32;
00202 #    endif /* __alpha */
00203 #endif
00204 
00205 /*
00206  * AIX defines these in sys/inttypes.h included from sys/types.h
00207  */
00208 #ifndef AIX
00209 #ifndef _INT16
00210 typedef short int16;
00211 #endif
00212 
00213 #ifndef _INT32
00214 #    if defined(__alpha)
00215 typedef int int32;
00216 #    else  /* __alpha */
00217 typedef long int32;
00218 #    endif /* __alpha */
00219 #endif
00220 #endif
00221 
00222 #ifndef FALSE
00223 #define FALSE (0)
00224 #endif
00225 #ifndef TRUE
00226 #define TRUE (1)
00227 #endif
00228 #ifndef NULL
00229 #define NULL (0L)
00230 #endif
00231 
00232 typedef unsigned char NPBool;
00233 typedef int16     NPError;
00234 typedef int16     NPReason;
00235 #ifndef __SYMBIAN32__
00236 typedef char*     NPMIMEType;
00237 #else/* __SYMBIAN32__ */
00238 typedef const TDesC8& NPMIMEType;
00239 #endif
00240 
00241 
00242 
00243 /*----------------------------------------------------------------------*/
00244 /*                       Structures and definitions                     */
00245 /*----------------------------------------------------------------------*/
00246 
00247 #ifdef XP_MAC
00248 #pragma options align=mac68k
00249 #endif
00250 
00251 /*
00252  *  NPP is a plug-in's opaque instance handle
00253  */
00254 typedef struct _NPP
00255 {
00256   void* pdata;      /* plug-in private data */
00257   void* ndata;      /* netscape private data */
00258 } NPP_t;
00259 
00260 typedef NPP_t*  NPP;
00261 
00262 
00263 typedef struct _NPStream
00264 {
00265   void*  pdata; /* plug-in private data */
00266   void*  ndata; /* netscape private data */
00267 #ifndef __SYMBIAN32__
00268   const  char* url;
00269 #else/* __SYMBIAN32__ */
00270   HBufC*  url;
00271 #endif
00272   uint32 end;
00273   uint32 lastmodified;
00274   void*  notifyData;
00275 } NPStream;
00276 
00277 
00278 typedef struct _NPByteRange
00279 {
00280   int32  offset; /* negative offset means from the end */
00281   uint32 length;
00282   struct _NPByteRange* next;
00283 } NPByteRange;
00284 
00285 
00286 typedef struct _NPSavedData
00287 {
00288   int32 len;
00289   void* buf;
00290 } NPSavedData;
00291 
00292 
00293 typedef struct _NPRect
00294 {
00295   uint16 top;
00296   uint16 left;
00297   uint16 bottom;
00298   uint16 right;
00299 } NPRect;
00300 
00301 typedef struct _NPSize
00302 {
00303   int32 width;
00304   int32 height;
00305 } NPSize;
00306 
00307 #ifdef XP_UNIX
00308 /*
00309  * Unix specific structures and definitions
00310  */
00311 
00312 /*
00313  * Callback Structures.
00314  *
00315  * These are used to pass additional platform specific information.
00316  */
00317 enum {
00318   NP_SETWINDOW = 1,
00319   NP_PRINT
00320 };
00321 
00322 typedef struct
00323 {
00324   int32 type;
00325 } NPAnyCallbackStruct;
00326 
00327 typedef struct
00328 {
00329   int32        type;
00330 #ifdef MOZ_X11
00331   Display*     display;
00332   Visual*      visual;
00333   Colormap     colormap;
00334   unsigned int depth;
00335 #endif
00336 } NPSetWindowCallbackStruct;
00337 
00338 typedef struct
00339 {
00340   int32 type;
00341   FILE* fp;
00342 } NPPrintCallbackStruct;
00343 
00344 #endif /* XP_UNIX */
00345 
00346 
00347 /*
00348  *   The following masks are applied on certain platforms to NPNV and
00349  *   NPPV selectors that pass around pointers to COM interfaces. Newer
00350  *   compilers on some platforms may generate vtables that are not
00351  *   compatible with older compilers. To prevent older plugins from
00352  *   not understanding a new browser's ABI, these masks change the
00353  *   values of those selectors on those platforms. To remain backwards
00354  *   compatible with differenet versions of the browser, plugins can
00355  *   use these masks to dynamically determine and use the correct C++
00356  *   ABI that the browser is expecting. This does not apply to Windows
00357  *   as Microsoft's COM ABI will likely not change.
00358  */
00359 
00360 #define NP_ABI_GCC3_MASK  0x10000000
00361 /*
00362  *   gcc 3.x generated vtables on UNIX and OSX are incompatible with
00363  *   previous compilers.
00364  */
00365 #if (defined (XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3))
00366 #define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
00367 #else
00368 #define _NP_ABI_MIXIN_FOR_GCC3 0
00369 #endif
00370 
00371 
00372 #define NP_ABI_MACHO_MASK 0x01000000
00373 /*
00374  *   On OSX, the Mach-O executable format is significantly
00375  *   different than CFM. In addition to having a different
00376  *   C++ ABI, it also has has different C calling convention.
00377  *   You must use glue code when calling between CFM and
00378  *   Mach-O C functions.
00379  */
00380 #if (defined(TARGET_RT_MAC_MACHO))
00381 #define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
00382 #else
00383 #define _NP_ABI_MIXIN_FOR_MACHO 0
00384 #endif
00385 
00386 
00387 #define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
00388 
00389 /*
00390  * List of variable names for which NPP_GetValue shall be implemented
00391  */
00392 typedef enum {
00393   NPPVpluginNameString = 1,
00394   NPPVpluginDescriptionString,
00395   NPPVpluginWindowBool,
00396   NPPVpluginTransparentBool,
00397   NPPVjavaClass,                /* Not implemented in Mozilla 1.0 */
00398   NPPVpluginWindowSize,
00399   NPPVpluginTimerInterval,
00400 
00401   NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
00402   NPPVpluginScriptableIID = 11,
00403 
00404   /* 12 and over are available on Mozilla builds starting with 0.9.9 */
00405   NPPVjavascriptPushCallerBool = 12,
00406   NPPVpluginKeepLibraryInMemory = 13,   /* available in Mozilla 1.0 */
00407   NPPVpluginNeedsXEmbed         = 14, /* Not implemented in WebKit */
00408    /* started from 100. The numbers 13 to 1000 are left
00409    * for standarization and other future use. Value return is zero for
00410    * ineteractive and 'one' for non-interactive.
00411    */
00412   NPPVpluginScriptableNPObject  = 15,
00413   
00414   // Custom NPP variables, starting from 100 till 1000
00415   NPPVPluginFocusPosition = 100,
00416   NPPVPluginDeactivate = 101,
00417   NPPVPluginOpenInViewer = 102,
00418   NPPVpluginInteractiveBool = 1000
00419 } NPPVariable;
00420 
00421 /*
00422  * List of variable names for which NPN_GetValue is implemented by Mozilla
00423  */
00424 typedef enum {
00425   NPNVxDisplay = 1,
00426   NPNVxtAppContext,
00427   NPNVnetscapeWindow,
00428   NPNVjavascriptEnabledBool,
00429   NPNVasdEnabledBool,
00430   NPNVisOfflineBool,
00431 
00432   /* 10 and over are available on Mozilla builds starting with 0.9.4 */
00433   NPNVserviceManager = (10 | NP_ABI_MASK),
00434   NPNVDOMElement     = (11 | NP_ABI_MASK),   /* available in Mozilla 1.2 */
00435   NPNVDOMWindow      = (12 | NP_ABI_MASK)
00436   ,NPNVToolkit        = (13 | NP_ABI_MASK),  /* Not implemented in WebKit */
00437   NPNVSupportsXEmbedBool = 14,              /* Not implemented in WebKit */
00438 
00439   /* Get the NPObject wrapper for the browser window. */
00440   NPNVWindowNPObject = 15,
00441 
00442     /* Get the NPObject wrapper for the plugins DOM element. */
00443   NPNVPluginElementNPObject                 /* Not implemented in WebKit */
00444 } NPNVariable;
00445 
00446 /*
00447  * The type of a NPWindow - it specifies the type of the data structure
00448  * returned in the window field.
00449  */
00450 typedef enum {
00451   NPWindowTypeWindow = 1,
00452   NPWindowTypeDrawable
00453 } NPWindowType;
00454 
00455 typedef struct _NPWindow
00456 {
00457   void* window;  /* Platform specific window handle */
00458                  /* OS/2: x - Position of bottom left corner  */
00459                  /* OS/2: y - relative to visible netscape window */
00460   int32 x;       /* Position of top left corner relative */
00461   int32 y;       /* to a netscape page.         */
00462   uint32 width;  /* Maximum window size */
00463   uint32 height;
00464   NPRect clipRect; /* Clipping rectangle in port coordinates */
00465                    /* Used by MAC only.       */
00466 #if defined(XP_UNIX) && !defined(XP_MACOSX)
00467   void * ws_info; /* Platform-dependent additonal data */
00468 #endif /* XP_UNIX */
00469   NPWindowType type; /* Is this a window or a drawable? */
00470 } NPWindow;
00471 
00472 
00473 typedef struct _NPFullPrint
00474 {
00475   NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */
00476   NPBool printOne;     /* TRUE if plugin should print one copy to default printer */
00477   void* platformPrint; /* Platform-specific printing info */
00478 } NPFullPrint;
00479 
00480 typedef struct _NPEmbedPrint
00481 {
00482   NPWindow window;
00483   void* platformPrint; /* Platform-specific printing info */
00484 } NPEmbedPrint;
00485 
00486 typedef struct _NPPrint
00487 {
00488   uint16 mode;               /* NP_FULL or NP_EMBED */
00489   union
00490   {
00491     NPFullPrint fullPrint;   /* if mode is NP_FULL */
00492     NPEmbedPrint embedPrint; /* if mode is NP_EMBED */
00493   } print;
00494 } NPPrint;
00495 
00496 #if defined(XP_MAC) || defined(XP_MACOSX)
00497 typedef EventRecord NPEvent;
00498 #elif defined(XP_WIN)
00499 typedef struct _NPEvent
00500 {
00501   uint16 event;
00502   uint32 wParam;
00503   uint32 lParam;
00504 } NPEvent;
00505 #elif defined(XP_OS2)
00506 typedef struct _NPEvent
00507 {
00508   uint32 event;
00509   uint32 wParam;
00510   uint32 lParam;
00511 } NPEvent;
00512 #elif defined (XP_UNIX) && defined(MOZ_X11)
00513 typedef XEvent NPEvent;
00514 #else
00515 typedef void*     NPEvent;
00516 #endif /* XP_MAC */
00517 
00518 #if defined(XP_MAC) || defined(XP_MACOSX)
00519 typedef RgnHandle NPRegion;
00520 #elif defined(XP_WIN)
00521 typedef HRGN NPRegion;
00522 #elif defined(XP_UNIX) && defined(MOZ_X11)
00523 typedef Region NPRegion;
00524 #else
00525 typedef void *NPRegion;
00526 #endif /* XP_MAC */
00527 
00528 #if defined(XP_MAC) || defined(XP_MACOSX)
00529 /*
00530  *  Mac-specific structures and definitions.
00531  */
00532 
00533 typedef struct NP_Port
00534 {
00535   CGrafPtr port; /* Grafport */
00536   int32 portx;   /* position inside the topmost window */
00537   int32 porty;
00538 } NP_Port;
00539 
00540 /*
00541  *  Non-standard event types that can be passed to HandleEvent
00542  */
00543 
00544 enum NPEventType {
00545   NPEventType_GetFocusEvent = (osEvt + 16),
00546   NPEventType_LoseFocusEvent,
00547   NPEventType_AdjustCursorEvent,
00548   NPEventType_MenuCommandEvent,
00549   NPEventType_ClippingChangedEvent,
00550   NPEventType_ScrollingBeginsEvent = 1000,
00551   NPEventType_ScrollingEndsEvent
00552 };
00553 
00554 #ifdef OBSOLETE
00555 #define getFocusEvent     (osEvt + 16)
00556 #define loseFocusEvent    (osEvt + 17)
00557 #define adjustCursorEvent (osEvt + 18)
00558 #endif
00559 #endif /* XP_MAC */
00560 
00561 /*
00562  * Values for mode passed to NPP_New:
00563  */
00564 #define NP_EMBED 1
00565 #define NP_FULL  2
00566 
00567 /*
00568  * Values for stream type passed to NPP_NewStream:
00569  */
00570 #define NP_NORMAL     1
00571 #define NP_SEEK       2
00572 #define NP_ASFILE     3
00573 #define NP_ASFILEONLY 4
00574 
00575 #define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
00576 
00577 #ifdef XP_MAC
00578 #pragma options align=reset
00579 #endif
00580 
00581 
00582 /*----------------------------------------------------------------------*/
00583 /*         Error and Reason Code definitions      */
00584 /*----------------------------------------------------------------------*/
00585 
00586 /*
00587  * Values of type NPError:
00588  */
00589 #define NPERR_BASE                         0
00590 #define NPERR_NO_ERROR                    (NPERR_BASE + 0)
00591 #define NPERR_GENERIC_ERROR               (NPERR_BASE + 1)
00592 #define NPERR_INVALID_INSTANCE_ERROR      (NPERR_BASE + 2)
00593 #define NPERR_INVALID_FUNCTABLE_ERROR     (NPERR_BASE + 3)
00594 #define NPERR_MODULE_LOAD_FAILED_ERROR    (NPERR_BASE + 4)
00595 #define NPERR_OUT_OF_MEMORY_ERROR         (NPERR_BASE + 5)
00596 #define NPERR_INVALID_PLUGIN_ERROR        (NPERR_BASE + 6)
00597 #define NPERR_INVALID_PLUGIN_DIR_ERROR    (NPERR_BASE + 7)
00598 #define NPERR_INCOMPATIBLE_VERSION_ERROR  (NPERR_BASE + 8)
00599 #define NPERR_INVALID_PARAM               (NPERR_BASE + 9)
00600 #define NPERR_INVALID_URL                 (NPERR_BASE + 10)
00601 #define NPERR_FILE_NOT_FOUND              (NPERR_BASE + 11)
00602 #define NPERR_NO_DATA                     (NPERR_BASE + 12)
00603 #define NPERR_STREAM_NOT_SEEKABLE         (NPERR_BASE + 13)
00604 
00605 /*
00606  * Values of type NPReason:
00607  */
00608 #define NPRES_BASE          0
00609 #define NPRES_DONE         (NPRES_BASE + 0)
00610 #define NPRES_NETWORK_ERR  (NPRES_BASE + 1)
00611 #define NPRES_USER_BREAK   (NPRES_BASE + 2)
00612 
00613 /*
00614  * Don't use these obsolete error codes any more.
00615  */
00616 #define NP_NOERR  NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
00617 #define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
00618 #define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK
00619 
00620 /*
00621  * Version feature information
00622  */
00623 #define NPVERS_HAS_STREAMOUTPUT      8
00624 #define NPVERS_HAS_NOTIFICATION      9
00625 #define NPVERS_HAS_LIVECONNECT       9
00626 #define NPVERS_WIN16_HAS_LIVECONNECT 9
00627 #define NPVERS_68K_HAS_LIVECONNECT   11
00628 #define NPVERS_HAS_WINDOWLESS        11
00629 #define NPVERS_HAS_XPCONNECT_SCRIPTING 13
00630 
00631 /*----------------------------------------------------------------------*/
00632 /*                        Function Prototypes                           */
00633 /*----------------------------------------------------------------------*/
00634 
00635 #if defined(_WINDOWS) && !defined(WIN32)
00636 #define NP_LOADDS  _loadds
00637 #else
00638 #if defined(__OS2__)
00639 #define NP_LOADDS _System
00640 #else
00641 #define NP_LOADDS
00642 #endif
00643 #endif
00644 
00645 #ifndef __SYMBIAN32__
00646  #ifdef __cplusplus
00647  extern "C" {
00648  #endif
00649 #endif
00650 
00651 /*
00652  * NPP_* functions are provided by the plugin and called by the navigator.
00653  */
00654 
00655 #ifdef XP_UNIX
00656 char* NPP_GetMIMEDescription(void);
00657 #endif /* XP_UNIX */
00658 
00659 #ifdef __SYMBIAN32__
00660 #include <badesca.h>
00661 IMPORT_C const TDesC* NPP_GetMIMEDescription(void);
00662 #endif /* __SYMBIAN32__ */
00663 
00664 NPError NP_LOADDS NPP_Initialize(void);
00665 #ifdef __SYMBIAN32__
00666 IMPORT_C
00667 #endif /* __SYMBIAN32__ */
00668 void    NP_LOADDS NPP_Shutdown(void);
00669 
00670 #ifndef __SYMBIAN32__
00671 NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
00672                           uint16 mode, int16 argc, char* argn[],
00673                           char* argv[], NPSavedData* saved);
00674 #else
00675 NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
00676               uint16 mode, CDesCArray* argn,
00677               CDesCArray* argv, NPSavedData* saved);
00678 #endif /* __SYMBIAN32__ */
00679 
00680 NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
00681 NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
00682 NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
00683                                 NPStream* stream, NPBool seekable,
00684                                 uint16* stype);
00685 NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
00686                                     NPReason reason);
00687 int32   NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
00688 int32   NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32 offset,
00689                             int32 len, void* buffer);
00690 
00691 #ifndef __SYMBIAN32__
00692 void    NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
00693                                    const char* fname);
00694 #else/* __SYMBIAN32__ */
00695 void    NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
00696                                    const TDesC& fname);
00697 #endif /* __SYMBIAN32__ */
00698 
00699 void    NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
00700 int16   NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
00701 
00702 #ifndef __SYMBIAN32__
00703 void    NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
00704                                 NPReason reason, void* notifyData);
00705 #else/* __SYMBIAN32__ */
00706 void    NP_LOADDS NPP_URLNotify(NPP instance, const TDesC& url,
00707                                 NPReason reason, void* notifyData);
00708 #endif /* __SYMBIAN32__ */
00709 
00710 #ifdef OJI
00711 jref    NP_LOADDS NPP_GetJavaClass(void);
00712 #endif
00713 
00714 #ifdef __SYMBIAN32__
00715 IMPORT_C
00716 #endif /* __SYMBIAN32__ */
00717 NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value);
00718 NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value);
00719 
00720 /*
00721  * NPN_* functions are provided by the navigator and called by the plugin.
00722  */
00723 void    NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor,
00724                               int* netscape_major, int* netscape_minor);
00725 
00726 #ifndef __SYMBIAN32__
00727 NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url,
00728                                    const char* target, void* notifyData);
00729 NPError NP_LOADDS NPN_GetURL(NPP instance, const char* url,
00730                              const char* target);
00731 NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url,
00732                                     const char* target, uint32 len,
00733                                     const char* buf, NPBool file,
00734                                     void* notifyData);
00735 NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url,
00736                               const char* target, uint32 len,
00737                               const char* buf, NPBool file);
00738 #else/* __SYMBIAN32__ */
00739 NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const TDesC& url,
00740                                    const TDesC* target, void* notifyData);
00741 NPError NP_LOADDS NPN_GetURL(NPP instance, const TDesC& url,
00742                              const TDesC* target);
00743 NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const TDesC& url,
00744                                     const TDesC* target,
00745                                     const TDesC& buf, NPBool file,
00746                                     void* notifyData);
00747 NPError NP_LOADDS NPN_PostURL(NPP instance, const TDesC& url,
00748                               const TDesC* target,
00749                               const TDesC& buf, NPBool file);
00750 #endif /* __SYMBIAN32__ */
00751 
00752 NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
00753 
00754 #ifndef __SYMBIAN32__
00755 NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type,
00756                                 const char* target, NPStream** stream);
00757 #else/* __SYMBIAN32__ */
00758 NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type,
00759                                 const TDesC* target, NPStream** stream);
00760 #endif /* __SYMBIAN32__ */
00761 
00762 int32   NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer);
00763 NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
00764 
00765 #ifndef __SYMBIAN32__
00766 void    NP_LOADDS NPN_Status(NPP instance, const char* message);
00767 #else/* __SYMBIAN32__ */
00768 void    NP_LOADDS NPN_Status(NPP instance, const TDesC& message);
00769 #endif /* __SYMBIAN32__ */
00770 
00771 #ifndef __SYMBIAN32__
00772 const char* NP_LOADDS NPN_UserAgent(NPP instance);
00773 #else/* __SYMBIAN32__ */
00774 const TDesC* NP_LOADDS  NPN_UserAgent(NPP instance);
00775 #endif /* __SYMBIAN32__ */
00776 
00777 
00778 void*   NP_LOADDS NPN_MemAlloc(uint32 size);
00779 void    NP_LOADDS NPN_MemFree(void* ptr);
00780 uint32  NP_LOADDS NPN_MemFlush(uint32 size);
00781 void    NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages);
00782 #ifdef OJI
00783 JRIEnv* NP_LOADDS NPN_GetJavaEnv(void);
00784 jref    NP_LOADDS NPN_GetJavaPeer(NPP instance);
00785 #endif
00786 NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable, void *value);
00787 NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable, void *value);
00788 void    NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
00789 void    NP_LOADDS NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion);
00790 void    NP_LOADDS NPN_ForceRedraw(NPP instance);
00791 
00792 #ifndef __SYMBIAN32__
00793  #ifdef __cplusplus
00794  }  /* end extern "C" */
00795  #endif
00796 #endif
00797 
00798 #endif /* RC_INVOKED */
00799 #ifdef __OS2__
00800 #pragma pack()
00801 #endif
00802 
00803 #endif /* _NPAPI_H_ */

Copyright © Nokia Corporation 2001-2008
Back to top