epoc32/include/mw/npapi.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /* ***** BEGIN LICENSE BLOCK *****
     2  * Version: NPL 1.1/GPL 2.0/LGPL 2.1
     3  *
     4  * The contents of this file are subject to the Netscape Public License
     5  * Version 1.1 (the "License"); you may not use this file except in
     6  * compliance with the License. You may obtain a copy of the License at
     7  * http://www.mozilla.org/NPL/
     8  *
     9  * Software distributed under the License is distributed on an "AS IS" basis,
    10  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    11  * for the specific language governing rights and limitations under the
    12  * License.
    13  *
    14  * The Original Code is mozilla.org code.
    15  *
    16  * The Initial Developer of the Original Code is
    17  * Netscape Communications Corporation.
    18  * Portions created by the Initial Developer are Copyright (C) 1998
    19  * the Initial Developer. All Rights Reserved.
    20  *
    21  * Contributor(s):
    22  *    Portions Copyright (c) 2004-2006, Nokia Corporation
    23  *
    24  *
    25  * Alternatively, the contents of this file may be used under the terms of
    26  * either the GNU General Public License Version 2 or later (the "GPL"), or
    27  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    28  * in which case the provisions of the GPL or the LGPL are applicable instead
    29  * of those above. If you wish to allow use of your version of this file only
    30  * under the terms of either the GPL or the LGPL, and not to allow others to
    31  * use your version of this file under the terms of the NPL, indicate your
    32  * decision by deleting the provisions above and replace them with the notice
    33  * and other provisions required by the GPL or the LGPL. If you do not delete
    34  * the provisions above, a recipient may use your version of this file under
    35  * the terms of any one of the NPL, the GPL or the LGPL.
    36  *
    37  * ***** END LICENSE BLOCK ***** */
    38 
    39 /* NOTES:
    40  * Nokia modified this file, by changing certain variables for the purpose of
    41  * porting the file to the Symbian platform on May 1st, 2004.
    42  */
    43 
    44  /*
    45   *  Netscape client plug-in API spec
    46   */
    47 
    48 #ifndef _NPAPI_H_
    49 #define _NPAPI_H_
    50 
    51 #define GENERIC_CONTEXTS
    52 
    53 #ifdef INCLUDE_JAVA
    54 #include "jri.h"                /* Java Runtime Interface */
    55 #else
    56 #ifndef __SYMBIAN32__
    57 #define jref    void *
    58 #define JRIEnv  void
    59 #endif
    60 #endif
    61 
    62 #ifdef _WIN32
    63 #    ifndef XP_WIN
    64 #        define XP_WIN 1
    65 #    endif /* XP_WIN */
    66 #endif /* _WIN32 */
    67 
    68 #ifdef __MWERKS__
    69 #    define _declspec __declspec
    70 #    ifdef macintosh
    71 #        ifndef XP_MAC
    72 #            define XP_MAC 1
    73 #        endif /* XP_MAC */
    74 #    endif /* macintosh */
    75 #    ifdef __INTEL__
    76 #        undef NULL
    77 #        ifndef XP_WIN
    78 #            define XP_WIN 1
    79 #        endif /* __INTEL__ */
    80 #    endif /* XP_PC */
    81 #endif /* __MWERKS__ */
    82 
    83 #ifdef __SYMBIAN32__
    84 #undef XP_WIN
    85 #endif
    86 
    87 #if defined(__APPLE_CC__) && !defined(__MACOS_CLASSIC__)
    88 #   define XP_MACOSX
    89 #endif
    90 
    91 #ifdef XP_MAC
    92     #include <Quickdraw.h>
    93     #include <Events.h>
    94 #endif
    95 
    96 #ifdef XP_MACOSX
    97     #include <Carbon/Carbon.h>
    98     #include <ApplicationServices/ApplicationServices.h>
    99     #include <OpenGL/OpenGL.h>
   100 #endif
   101 
   102 #ifdef XP_UNIX
   103     #include <X11/Xlib.h>
   104     #include <X11/Xutil.h>
   105 #endif
   106 
   107 #ifdef XP_WIN
   108     #include <windows.h>
   109 #endif
   110 
   111 #ifdef __SYMBIAN32__
   112 #include <np_defines.h>
   113 #endif
   114 #if defined(XP_MACOSX) && defined(__LP64__)
   115 #error 64-bit Netscape plug-ins are not supported on Mac OS X
   116 #endif
   117 
   118 /*----------------------------------------------------------------------*/
   119 /*             Plugin Version Constants                                 */
   120 /*----------------------------------------------------------------------*/
   121 
   122 #define NP_VERSION_MAJOR 0
   123 #define NP_VERSION_MINOR 18
   124 
   125 
   126 
   127 /*----------------------------------------------------------------------*/
   128 /*             Definition of Basic Types                                */
   129 /*----------------------------------------------------------------------*/
   130 
   131 #ifndef _UINT16
   132 #define _UINT16
   133 typedef unsigned short uint16;
   134 #endif
   135 
   136 #ifndef _UINT32
   137 #define _UINT32
   138 #ifdef __LP64__
   139 typedef unsigned int uint32;
   140 #else /* __LP64__ */
   141 typedef unsigned long uint32;
   142 #endif /* __LP64__ */
   143 #endif
   144 
   145 #ifndef _INT16
   146 #define _INT16
   147 typedef short int16;
   148 #endif
   149 
   150 #ifndef _INT32
   151 #define _INT32
   152 #ifdef __LP64__
   153 typedef int int32;
   154 #else /* __LP64__ */
   155 typedef long int32;
   156 #endif /* __LP64__ */
   157 #endif
   158 
   159 #ifndef FALSE
   160 #define FALSE (0)
   161 #endif
   162 #ifndef TRUE
   163 #define TRUE (1)
   164 #endif
   165 #ifndef NULL
   166 #define NULL (0L)
   167 #endif
   168 
   169 typedef unsigned char    NPBool;
   170 typedef int16            NPError;
   171 typedef int16            NPReason;
   172 #ifndef __SYMBIAN32__
   173 typedef char*     		 NPMIMEType;
   174 #else/* __SYMBIAN32__ */
   175 typedef const TDesC8& 	 NPMIMEType;
   176 #endif
   177 
   178 /*----------------------------------------------------------------------*/
   179 /*             Structures and definitions             */
   180 /*----------------------------------------------------------------------*/
   181 
   182 #if !defined(__LP64__)
   183 #if defined(XP_MAC) || defined(XP_MACOSX)
   184 #pragma options align=mac68k
   185 #endif
   186 #endif /* __LP64__ */
   187 
   188 /*
   189  *  NPP is a plug-in's opaque instance handle
   190  */
   191 #ifdef __SYMBIAN32__ 
   192 #ifndef _NP_RUNTIME_H_NPP
   193 #define _NP_RUNTIME_H_NPP
   194 typedef struct _NPP
   195 {
   196     void*    pdata;            /* plug-in private data */
   197     void*    ndata;            /* netscape private data */
   198 } NPP_t;
   199 
   200 typedef NPP_t*    NPP;
   201 #endif // _NP_RUNTIME_H_NPP
   202 #else
   203 typedef struct _NPP
   204 {
   205     void*    pdata;            /* plug-in private data */
   206     void*    ndata;            /* netscape private data */
   207 } NPP_t;
   208 
   209 typedef NPP_t*    NPP;
   210 #endif //
   211 
   212 typedef struct _NPStream
   213 {
   214     void*        pdata;        /* plug-in private data */
   215     void*        ndata;        /* netscape private data */
   216 #ifndef __SYMBIAN32__ 
   217     const char*  url;
   218 #else /*__SYMBIAN32__*/
   219     HBufC* url;
   220 #endif
   221     uint32       end;
   222     uint32       lastmodified;
   223     void*        notifyData;
   224     const char*  headers;      /* Response headers from host.
   225                                 * Exists only for >= NPVERS_HAS_RESPONSE_HEADERS.
   226                                 * Used for HTTP only; NULL for non-HTTP.
   227                                 * Available from NPP_NewStream onwards.
   228                                 * Plugin should copy this data before storing it.
   229                                 * Includes HTTP status line and all headers,
   230                                 * preferably verbatim as received from server,
   231                                 * headers formatted as in HTTP ("Header: Value"),
   232                                 * and newlines (\n, NOT \r\n) separating lines.
   233                                 * Terminated by \n\0 (NOT \n\n\0). */
   234 } NPStream;
   235 
   236 
   237 typedef struct _NPByteRange
   238 {
   239     int32      offset;         /* negative offset means from the end */
   240     uint32     length;
   241     struct _NPByteRange* next;
   242 } NPByteRange;
   243 
   244 
   245 typedef struct _NPSavedData
   246 {
   247     int32    len;
   248     void*    buf;
   249 } NPSavedData;
   250 
   251 
   252 typedef struct _NPRect
   253 {
   254     uint16    top;
   255     uint16    left;
   256     uint16    bottom;
   257     uint16    right;
   258 } NPRect;
   259 
   260 
   261 #ifdef XP_UNIX
   262 /*
   263  * Unix specific structures and definitions
   264  */
   265 
   266 /*
   267  * Callback Structures.
   268  *
   269  * These are used to pass additional platform specific information.
   270  */
   271 enum {
   272     NP_SETWINDOW = 1,
   273     NP_PRINT
   274 };
   275 
   276 typedef struct
   277 {
   278     int32        type;
   279 } NPAnyCallbackStruct;
   280 
   281 typedef struct
   282 {
   283     int32           type;
   284     Display*        display;
   285     Visual*         visual;
   286     Colormap        colormap;
   287     unsigned int    depth;
   288 } NPSetWindowCallbackStruct;
   289 
   290 typedef struct
   291 {
   292     int32            type;
   293     FILE*            fp;
   294 } NPPrintCallbackStruct;
   295 
   296 #endif /* XP_UNIX */
   297 
   298 /*
   299  *   The following masks are applied on certain platforms to NPNV and 
   300  *   NPPV selectors that pass around pointers to COM interfaces. Newer 
   301  *   compilers on some platforms may generate vtables that are not 
   302  *   compatible with older compilers. To prevent older plugins from 
   303  *   not understanding a new browser's ABI, these masks change the 
   304  *   values of those selectors on those platforms. To remain backwards
   305  *   compatible with differenet versions of the browser, plugins can 
   306  *   use these masks to dynamically determine and use the correct C++
   307  *   ABI that the browser is expecting. This does not apply to Windows 
   308  *   as Microsoft's COM ABI will likely not change.
   309  */
   310 
   311 #define NP_ABI_GCC3_MASK  0x10000000
   312 /*
   313  *   gcc 3.x generated vtables on UNIX and OSX are incompatible with 
   314  *   previous compilers.
   315  */
   316 #if (defined (XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3))
   317 #define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
   318 #else
   319 #define _NP_ABI_MIXIN_FOR_GCC3 0
   320 #endif
   321 
   322 #define NP_ABI_MACHO_MASK 0x01000000
   323 /*
   324  *   On OSX, the Mach-O executable format is significantly
   325  *   different than CFM. In addition to having a different
   326  *   C++ ABI, it also has has different C calling convention.
   327  *   You must use glue code when calling between CFM and
   328  *   Mach-O C functions. 
   329  */
   330 #if (defined(TARGET_RT_MAC_MACHO))
   331 #define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
   332 #else
   333 #define _NP_ABI_MIXIN_FOR_MACHO 0
   334 #endif
   335 
   336 
   337 #define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
   338 
   339 /*
   340  * List of variable names for which NPP_GetValue shall be implemented
   341  */
   342 typedef enum {
   343     NPPVpluginNameString = 1,
   344     NPPVpluginDescriptionString,
   345     NPPVpluginWindowBool,
   346     NPPVpluginTransparentBool,
   347 
   348     NPPVjavaClass,                /* Not implemented in WebKit */
   349     NPPVpluginWindowSize,         /* Not implemented in WebKit */
   350     NPPVpluginTimerInterval,      /* Not implemented in WebKit */
   351 
   352     NPPVpluginScriptableInstance = (10 | NP_ABI_MASK), /* Not implemented in WebKit */
   353     NPPVpluginScriptableIID = 11, /* Not implemented in WebKit */
   354 
   355     /* 12 and over are available on Mozilla builds starting with 0.9.9 */
   356     NPPVjavascriptPushCallerBool = 12,  /* Not implemented in WebKit */
   357     NPPVpluginKeepLibraryInMemory = 13, /* Not implemented in WebKit */
   358     NPPVpluginNeedsXEmbed         = 14, /* Not implemented in WebKit */
   359 
   360     /* Get the NPObject for scripting the plugin. */
   361     NPPVpluginScriptableNPObject  = 15,
   362 
   363 #ifdef __SYMBIAN32__
   364     // Custom NPP variables, starting from 100 till 1000
   365     NPPVPluginFocusPosition = 100,    
   366     NPPVPluginDeactivate = 101,
   367     NPPVPluginZoom = 102,
   368     NPPVPluginPointerEvent = 103,
   369     NPPVpluginInteractiveBool = 1000,
   370 #endif
   371 
   372     /* Get the plugin value (as \0-terminated UTF-8 string data) for
   373      * form submission if the plugin is part of a form. Use
   374      * NPN_MemAlloc() to allocate memory for the string data.
   375      */
   376     NPPVformValue = 16,    /* Not implemented in WebKit */
   377     NPPVpluginFullScreenBool = 17 /* Not implemented in WebKit */
   378 } NPPVariable;
   379 
   380 /*
   381  * List of variable names for which NPN_GetValue is implemented by Mozilla
   382  */
   383 typedef enum {
   384     NPNVxDisplay = 1,
   385     NPNVxtAppContext,
   386     NPNVnetscapeWindow,
   387     NPNVjavascriptEnabledBool,
   388     NPNVasdEnabledBool,
   389     NPNVisOfflineBool,
   390 
   391     /* 10 and over are available on Mozilla builds starting with 0.9.4 */
   392     NPNVserviceManager = (10 | NP_ABI_MASK),  /* Not implemented in WebKit */
   393     NPNVDOMElement     = (11 | NP_ABI_MASK),  /* Not implemented in WebKit */
   394     NPNVDOMWindow      = (12 | NP_ABI_MASK),  /* Not implemented in WebKit */
   395     NPNVToolkit        = (13 | NP_ABI_MASK),  /* Not implemented in WebKit */
   396     NPNVSupportsXEmbedBool = 14,              /* Not implemented in WebKit */
   397 
   398     /* Get the NPObject wrapper for the browser window. */
   399     NPNVWindowNPObject = 15,
   400 
   401     /* Get the NPObject wrapper for the plugins DOM element. */
   402     NPNVPluginElementNPObject,
   403 
   404 #ifdef XP_MACOSX
   405     , NPNVpluginDrawingModel = 1000 /* The NPDrawingModel specified by the plugin */
   406 
   407 #ifndef NP_NO_QUICKDRAW
   408     , NPNVsupportsQuickDrawBool = 2000 /* TRUE if the browser supports the QuickDraw drawing model */
   409 #endif
   410     , NPNVsupportsCoreGraphicsBool = 2001 /* TRUE if the browser supports the CoreGraphics drawing model */
   411     , NPNVsupportsOpenGLBool = 2002 /* TRUE if the browser supports the OpenGL drawing model (CGL on Mac) */
   412 #endif /* XP_MACOSX */
   413     
   414     /* Get the id of the currently connected access point */
   415     NPNNetworkAccess,
   416     NPNVGenericParameter,
   417     NPNVSupportsWindowless
   418 } NPNVariable;
   419 
   420 #ifdef GENERIC_CONTEXTS
   421 
   422 union  NPN_GenericParam {
   423 
   424     NPN_GenericParam(int aIntValue)
   425     :intValue(aIntValue)
   426         {
   427         
   428         }
   429     
   430     NPN_GenericParam(bool aBoolValue)
   431     :boolValue(aBoolValue)
   432         {
   433         
   434         }
   435             
   436     NPN_GenericParam(const TDesC& aStrValue)
   437     :strValue(aStrValue)
   438         {
   439         
   440         }
   441         
   442     NPN_GenericParam(void*  aVoidValue)
   443     :voidValue(aVoidValue)
   444         {
   445         
   446         }
   447     int intValue;
   448     bool   boolValue;
   449     const TDesC& strValue;
   450     void*  voidValue;
   451 };
   452 
   453 
   454 typedef struct NPN_GenericElement{          
   455 
   456     NPN_GenericElement(const TDesC& aElementId, int aElementValue)
   457     :genericElementId(aElementId), genericElementValue(aElementValue)
   458         {
   459         
   460         }
   461     
   462     NPN_GenericElement(const TDesC& aElementId, bool aElementValue)
   463     :genericElementId(aElementId), genericElementValue(aElementValue)
   464         {
   465         
   466         }
   467 
   468     NPN_GenericElement(const TDesC& aElementId, void* aElementValue)
   469     :genericElementId(aElementId), genericElementValue(aElementValue)
   470         {
   471         
   472         }
   473                         
   474     NPN_GenericElement(const TDesC& aElementId, const TDesC& aElementValue)
   475     :genericElementId(aElementId), genericElementValue(aElementValue)
   476         {
   477         
   478         }
   479     const TDesC&  genericElementId;          
   480     NPN_GenericParam genericElementValue;
   481 } GenericEntry;
   482 #endif
   483 /*
   484  * The type of a NPWindow - it specifies the type of the data structure
   485  * returned in the window field.
   486  */
   487 typedef enum {
   488     NPWindowTypeWindow = 1,
   489     NPWindowTypeDrawable
   490 } NPWindowType;
   491 
   492 #ifdef XP_MACOSX
   493 
   494 /*
   495  * The drawing model for a Mac OS X plugin.  These are the possible values for the NPNVpluginDrawingModel variable.
   496  */
   497  
   498 typedef enum {
   499 #ifndef NP_NO_QUICKDRAW
   500     NPDrawingModelQuickDraw = 0,
   501 #endif
   502     NPDrawingModelCoreGraphics = 1,
   503     NPDrawingModelOpenGL = 2
   504 } NPDrawingModel;
   505 
   506 #endif
   507 
   508 typedef struct _NPWindow
   509 {
   510     void*    window;     /* Platform specific window handle */
   511     int32    x;            /* Position of top left corner relative */
   512     int32    y;            /*    to a netscape page.                    */
   513     uint32    width;        /* Maximum window size */
   514     uint32    height;
   515     NPRect    clipRect;    /* Clipping rectangle in port coordinates */
   516                         /* Used by MAC only.              */
   517 #ifdef XP_UNIX
   518     void *    ws_info;    /* Platform-dependent additonal data */
   519 #endif /* XP_UNIX */
   520     NPWindowType type;    /* Is this a window or a drawable? */
   521 } NPWindow;
   522 
   523 
   524 typedef struct _NPFullPrint
   525 {
   526     NPBool    pluginPrinted;    /* Set TRUE if plugin handled fullscreen */
   527                             /*    printing                             */
   528     NPBool    printOne;        /* TRUE if plugin should print one copy  */
   529                             /*    to default printer                     */
   530     void*    platformPrint;    /* Platform-specific printing info */
   531 } NPFullPrint;
   532 
   533 typedef struct _NPEmbedPrint
   534 {
   535     NPWindow    window;
   536     void*    platformPrint;    /* Platform-specific printing info */
   537 } NPEmbedPrint;
   538 
   539 typedef struct _NPPrint
   540 {
   541     uint16    mode;                        /* NP_FULL or NP_EMBED */
   542     union
   543     {
   544         NPFullPrint     fullPrint;        /* if mode is NP_FULL */
   545         NPEmbedPrint    embedPrint;        /* if mode is NP_EMBED */
   546     } print;
   547 } NPPrint;
   548 
   549 #if defined(XP_MAC) || defined(XP_MACOSX)
   550 typedef EventRecord    NPEvent;
   551 #elif defined(XP_WIN)
   552 typedef struct _NPEvent
   553 {
   554     uint16   event;
   555     uint32   wParam;
   556     uint32   lParam;
   557 } NPEvent;
   558 #elif defined (XP_UNIX)
   559 typedef XEvent NPEvent;
   560 #elif defined (__SYMBIAN32__)
   561 typedef struct _NPEvent
   562 {
   563     uint32   event;
   564     void*    param;
   565 } NPEvent;
   566 #else
   567 typedef void*            NPEvent;
   568 #endif /* XP_MAC */
   569 
   570 #if defined(XP_MAC)
   571 typedef RgnHandle NPRegion;
   572 #elif defined(XP_MACOSX)
   573 /* 
   574  * NPRegion's type depends on the drawing model specified by the plugin (see NPNVpluginDrawingModel).
   575  * NPQDRegion represents a QuickDraw RgnHandle and is used with the QuickDraw drawing model.
   576  * NPCGRegion repesents a graphical region when using any other drawing model.
   577  */
   578 typedef void *NPRegion;
   579 #ifndef NP_NO_QUICKDRAW
   580 typedef RgnHandle NPQDRegion;
   581 #endif
   582 typedef CGPathRef NPCGRegion;
   583 #elif defined(XP_WIN)
   584 typedef HRGN NPRegion;
   585 #elif defined(XP_UNIX)
   586 typedef Region NPRegion;
   587 #else
   588 typedef void *NPRegion;
   589 #endif /* XP_MAC */
   590 
   591 #ifdef XP_MACOSX
   592 
   593 /* 
   594  * NP_CGContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelCoreGraphics
   595  * as its drawing model.
   596  */
   597 
   598 typedef struct NP_CGContext
   599 {
   600     CGContextRef context;
   601     WindowRef window;
   602 } NP_CGContext;
   603 
   604 /* 
   605  * NP_GLContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelOpenGL as its
   606  * drawing model.
   607  */
   608 
   609 typedef struct NP_GLContext
   610 {
   611     CGLContextObj context;
   612     WindowRef window;
   613 } NP_GLContext;
   614 
   615 #endif /* XP_MACOSX */
   616 
   617 #if defined(XP_MAC) || defined(XP_MACOSX)
   618 
   619 /*
   620  *  Mac-specific structures and definitions.
   621  */
   622 
   623 #ifndef NP_NO_QUICKDRAW
   624 
   625 /* 
   626  * NP_Port is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelQuickDraw as its
   627  * drawing model, or the plugin does not specify a drawing model.
   628  *
   629  * It is not recommended that new plugins use NPDrawingModelQuickDraw or NP_Port, as QuickDraw has been
   630  * deprecated in Mac OS X 10.5.  CoreGraphics is the preferred drawing API.
   631  *
   632  * NP_Port is not available in 64-bit.
   633  */
   634  
   635 typedef struct NP_Port
   636 {
   637     CGrafPtr     port;        /* Grafport */
   638     int32        portx;        /* position inside the topmost window */
   639     int32        porty;
   640 } NP_Port;
   641 
   642 #endif /* NP_NO_QUICKDRAW */
   643 
   644 /*
   645  *  Non-standard event types that can be passed to HandleEvent
   646  */
   647 #define getFocusEvent        (osEvt + 16)
   648 #define loseFocusEvent        (osEvt + 17)
   649 #define adjustCursorEvent   (osEvt + 18)
   650 
   651 #endif /* XP_MAC */
   652 
   653 
   654 /*
   655  * Values for mode passed to NPP_New:
   656  */
   657 #define NP_EMBED        1
   658 #define NP_FULL         2
   659 
   660 /*
   661  * Values for stream type passed to NPP_NewStream:
   662  */
   663 #define NP_NORMAL        1
   664 #define NP_SEEK         2
   665 #define NP_ASFILE        3
   666 #define NP_ASFILEONLY        4
   667 
   668 #define NP_MAXREADY    (((unsigned)(~0)<<1)>>1)
   669 
   670 #if !defined(__LP64__)
   671 #if defined(XP_MAC) || defined(XP_MACOSX)
   672 #pragma options align=reset
   673 #endif
   674 #endif /* __LP64__ */
   675 
   676 
   677 /*----------------------------------------------------------------------*/
   678 /*             Error and Reason Code definitions            */
   679 /*----------------------------------------------------------------------*/
   680 
   681 /*
   682  *    Values of type NPError:
   683  */
   684 #define NPERR_BASE                            0
   685 #define NPERR_NO_ERROR                        (NPERR_BASE + 0)
   686 #define NPERR_GENERIC_ERROR                    (NPERR_BASE + 1)
   687 #define NPERR_INVALID_INSTANCE_ERROR        (NPERR_BASE + 2)
   688 #define NPERR_INVALID_FUNCTABLE_ERROR        (NPERR_BASE + 3)
   689 #define NPERR_MODULE_LOAD_FAILED_ERROR        (NPERR_BASE + 4)
   690 #define NPERR_OUT_OF_MEMORY_ERROR            (NPERR_BASE + 5)
   691 #define NPERR_INVALID_PLUGIN_ERROR            (NPERR_BASE + 6)
   692 #define NPERR_INVALID_PLUGIN_DIR_ERROR        (NPERR_BASE + 7)
   693 #define NPERR_INCOMPATIBLE_VERSION_ERROR    (NPERR_BASE + 8)
   694 #define NPERR_INVALID_PARAM                (NPERR_BASE + 9)
   695 #define NPERR_INVALID_URL                    (NPERR_BASE + 10)
   696 #define NPERR_FILE_NOT_FOUND                (NPERR_BASE + 11)
   697 #define NPERR_NO_DATA                        (NPERR_BASE + 12)
   698 #define NPERR_STREAM_NOT_SEEKABLE            (NPERR_BASE + 13)
   699 
   700 /*
   701  *    Values of type NPReason:
   702  */
   703 #define NPRES_BASE                0
   704 #define NPRES_DONE                    (NPRES_BASE + 0)
   705 #define NPRES_NETWORK_ERR            (NPRES_BASE + 1)
   706 #define NPRES_USER_BREAK            (NPRES_BASE + 2)
   707 
   708 /*
   709  *      Don't use these obsolete error codes any more.
   710  */
   711 #define NP_NOERR  NP_NOERR_is_obsolete_use_NPERR_NO_ERROR
   712 #define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR
   713 #define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK
   714 
   715 /*
   716  * Version feature information
   717  */
   718 #define NPVERS_HAS_STREAMOUTPUT     8
   719 #define NPVERS_HAS_NOTIFICATION     9
   720 #define NPVERS_HAS_LIVECONNECT        9
   721 #define NPVERS_WIN16_HAS_LIVECONNECT    9
   722 #define NPVERS_68K_HAS_LIVECONNECT    11
   723 #define NPVERS_HAS_WINDOWLESS       11
   724 #define NPVERS_HAS_XPCONNECT_SCRIPTING    13  /* Not implemented in WebKit */
   725 #define NPVERS_HAS_NPRUNTIME_SCRIPTING    14
   726 #define NPVERS_HAS_FORM_VALUES            15  /* Not implemented in WebKit; see bug 13061 */
   727 #define NPVERS_HAS_POPUPS_ENABLED_STATE   16  /* Not implemented in WebKit */
   728 #define NPVERS_HAS_RESPONSE_HEADERS       17
   729 #define NPVERS_HAS_NPOBJECT_ENUM          18
   730 
   731 
   732 /*----------------------------------------------------------------------*/
   733 /*             Function Prototypes                */
   734 /*----------------------------------------------------------------------*/
   735 
   736 #if defined(_WINDOWS) && !defined(WIN32)
   737 #define NP_LOADDS  _loadds
   738 #else
   739 #define NP_LOADDS
   740 #endif
   741 
   742 #ifndef __SYMBIAN32__
   743  #ifdef __cplusplus
   744  extern "C" {
   745  #endif
   746 #endif
   747 
   748 /*
   749  * NPP_* functions are provided by the plugin and called by the navigator.
   750  */
   751 
   752 #ifdef XP_UNIX
   753 char*                    NPP_GetMIMEDescription(void);
   754 #endif /* XP_UNIX */
   755 
   756 #ifdef __SYMBIAN32__
   757 #include <badesca.h>
   758 IMPORT_C const TDesC* NPP_GetMIMEDescription(void);
   759 #endif /* __SYMBIAN32__ */
   760 
   761 NPError     NPP_Initialize(void);
   762 #ifdef __SYMBIAN32__
   763 IMPORT_C
   764 #endif /* __SYMBIAN32__ */
   765 void        NPP_Shutdown(void);
   766 
   767 #ifndef __SYMBIAN32__
   768 NPError     NP_LOADDS    NPP_New(NPMIMEType pluginType, NPP instance,
   769                                 uint16 mode, int16 argc, char* argn[],
   770                                 char* argv[], NPSavedData* saved);
   771 #else
   772 NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
   773               uint16 mode, CDesCArray* argn,
   774               CDesCArray* argv, NPSavedData* saved);
   775 #endif /* __SYMBIAN32__ */
   776 
   777 NPError     NP_LOADDS    NPP_Destroy(NPP instance, NPSavedData** save);
   778 NPError     NP_LOADDS    NPP_SetWindow(NPP instance, NPWindow* window);
   779 NPError     NP_LOADDS    NPP_NewStream(NPP instance, NPMIMEType type,
   780                                       NPStream* stream, NPBool seekable,
   781                                       uint16* stype);
   782 NPError     NP_LOADDS    NPP_DestroyStream(NPP instance, NPStream* stream,
   783                                           NPReason reason);
   784 int32        NP_LOADDS    NPP_WriteReady(NPP instance, NPStream* stream);
   785 int32        NP_LOADDS    NPP_Write(NPP instance, NPStream* stream, int32 offset,
   786                                   int32 len, void* buffer);
   787 
   788 #ifndef __SYMBIAN32__
   789 void        NP_LOADDS    NPP_StreamAsFile(NPP instance, NPStream* stream,
   790                                          const char* fname);
   791 #else/* __SYMBIAN32__ */
   792 void    NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
   793                                    const TDesC& fname);
   794 #endif /* __SYMBIAN32__ */
   795 
   796 void        NP_LOADDS    NPP_Print(NPP instance, NPPrint* platformPrint);
   797 int16            NPP_HandleEvent(NPP instance, void* event);
   798 
   799 #ifndef __SYMBIAN32__
   800 void        NP_LOADDS    NPP_URLNotify(NPP instance, const char* url,
   801                                       NPReason reason, void* notifyData);
   802 jref        NP_LOADDS            NPP_GetJavaClass(void);
   803 #else/* __SYMBIAN32__ */
   804 void    NP_LOADDS NPP_URLNotify(NPP instance, const TDesC& url,
   805                                 NPReason reason, void* notifyData);
   806 #endif /* __SYMBIAN32__ */
   807 
   808 
   809 #ifdef __SYMBIAN32__
   810 IMPORT_C
   811 #endif /* __SYMBIAN32__ */
   812 NPError     NPP_GetValue(NPP instance, NPPVariable variable,
   813                                      void *value);
   814 NPError     NPP_SetValue(NPP instance, NPNVariable variable,
   815                                      void *value);
   816 
   817 /*
   818  * NPN_* functions are provided by the navigator and called by the plugin.
   819  */
   820 
   821 void        NPN_Version(int* plugin_major, int* plugin_minor,
   822                             int* netscape_major, int* netscape_minor);
   823 
   824 #ifndef __SYMBIAN32__
   825 NPError     NPN_GetURLNotify(NPP instance, const char* url,
   826                                  const char* target, void* notifyData);
   827 NPError     NPN_GetURL(NPP instance, const char* url,
   828                            const char* target);
   829 NPError     NPN_PostURLNotify(NPP instance, const char* url,
   830                                   const char* target, uint32 len,
   831                                   const char* buf, NPBool file,
   832                                   void* notifyData);
   833 NPError     NPN_PostURL(NPP instance, const char* url,
   834                             const char* target, uint32 len,
   835                             const char* buf, NPBool file);
   836 #else/* __SYMBIAN32__ */
   837 NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const TDesC& url,
   838                                    const TDesC* target, void* notifyData);
   839 NPError NP_LOADDS NPN_GetURL(NPP instance, const TDesC& url,
   840                              const TDesC* target);
   841 NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const TDesC& url,
   842                                     const TDesC* target,
   843                                     const TDesC& buf, NPBool file,
   844                                     void* notifyData);
   845 NPError NP_LOADDS NPN_PostURL(NPP instance, const TDesC& url,
   846                               const TDesC* target,
   847                               const TDesC& buf, NPBool file);
   848 #endif /* __SYMBIAN32__ */
   849 
   850 NPError     NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
   851 
   852 #ifndef __SYMBIAN32__
   853 NPError     NPN_NewStream(NPP instance, NPMIMEType type,
   854                               const char* target, NPStream** stream);
   855 #else/* __SYMBIAN32__ */
   856 NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type,
   857                                 const TDesC* target, NPStream** stream);
   858 #endif /* __SYMBIAN32__ */
   859 
   860 int32   NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer);
   861 NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
   862 
   863 #ifndef __SYMBIAN32__
   864 void        NPN_Status(NPP instance, const char* message);
   865 #else/* __SYMBIAN32__ */
   866 void    NP_LOADDS NPN_Status(NPP instance, const TDesC& message);
   867 #endif /* __SYMBIAN32__ */
   868 
   869 #ifndef __SYMBIAN32__
   870 const char*    NPN_UserAgent(NPP instance);
   871 #else/* __SYMBIAN32__ */
   872 const TDesC* NP_LOADDS  NPN_UserAgent(NPP instance);
   873 #endif /* __SYMBIAN32__ */
   874 
   875 
   876 void*        NPN_MemAlloc(uint32 size);
   877 void        NPN_MemFree(void* ptr);
   878 uint32        NPN_MemFlush(uint32 size);
   879 void        NPN_ReloadPlugins(NPBool reloadPages);
   880 #ifndef __SYMBIAN32__
   881 JRIEnv*     NPN_GetJavaEnv(void);
   882 jref        NPN_GetJavaPeer(NPP instance);
   883 #endif
   884 NPError     NPN_GetValue(NPP instance, NPNVariable variable,
   885                              void *value);
   886 NPError     NPN_SetValue(NPP instance, NPPVariable variable,
   887                              void *value);
   888 void        NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
   889 void        NPN_InvalidateRegion(NPP instance, NPRegion invalidRegion);
   890 void        NPN_ForceRedraw(NPP instance);
   891 void        NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
   892 void        NPN_PopPopupsEnabledState(NPP instance);
   893 
   894 #ifndef __SYMBIAN32__
   895  #ifdef __cplusplus
   896  }  /* end extern "C" */
   897  #endif
   898 #endif
   899 
   900 #endif /* _NPAPI_H_ */