bump product version to 4.1.6.2
[LibreOffice.git] / np_sdk / inc / npapi.h
blobe554d2a985a4dc7d58ed2c8efaa4cb65b76fb384
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #ifndef npapi_h_
39 #define npapi_h_
41 #if defined(__OS2__)
42 #pragma pack(1)
43 #endif
45 #include "nptypes.h"
47 #if defined(__OS2__) || defined(OS2)
48 #ifndef XP_OS2
49 #define XP_OS2 1
50 #endif
51 #endif
53 #if defined(_WIN32) && !defined(__SYMBIAN32__)
54 #if defined _MSC_VER && _MSC_VER >= 1200
55 #pragma warning(push)
56 #pragma warning(disable:4201)
57 #endif
58 #include <windef.h>
59 #if defined _MSC_VER && _MSC_VER >= 1200
60 #pragma warning(pop)
61 #endif
62 #ifndef XP_WIN
63 #define XP_WIN 1
64 #endif
65 #endif
67 #if defined(__SYMBIAN32__)
68 #ifndef XP_SYMBIAN
69 #define XP_SYMBIAN 1
70 #undef XP_WIN
71 #endif
72 #endif
74 #if defined(__APPLE_CC__) && !defined(XP_UNIX)
75 #ifndef XP_MACOSX
76 #define XP_MACOSX 1
77 #endif
78 #endif
80 #if defined(XP_MACOSX) && defined(__LP64__)
81 #define NP_NO_QUICKDRAW
82 #define NP_NO_CARBON
83 #endif
85 #if defined(XP_MACOSX)
86 #include <ApplicationServices/ApplicationServices.h>
87 #include <OpenGL/OpenGL.h>
88 #ifndef NP_NO_CARBON
89 #include <Carbon/Carbon.h>
90 #endif
91 #endif
93 #if defined(XP_UNIX)
94 #include <stdio.h>
95 #if defined(MOZ_X11)
96 #include <X11/Xlib.h>
97 #include <X11/Xutil.h>
98 #endif
99 #endif
101 #if defined(XP_SYMBIAN)
102 #include <QEvent>
103 #include <QRegion>
104 #endif
106 /*----------------------------------------------------------------------*/
107 /* Plugin Version Constants */
108 /*----------------------------------------------------------------------*/
110 #define NP_VERSION_MAJOR 0
111 #define NP_VERSION_MINOR 27
114 /* The OS/2 version of Netscape uses RC_DATA to define the
115 mime types, file extensions, etc that are required.
116 Use a vertical bar to separate types, end types with \0.
117 FileVersion and ProductVersion are 32bit ints, all other
118 entries are strings that MUST be terminated with a \0.
120 AN EXAMPLE:
122 RCDATA NP_INFO_ProductVersion { 1,0,0,1,}
124 RCDATA NP_INFO_MIMEType { "video/x-video|",
125 "video/x-flick\0" }
126 RCDATA NP_INFO_FileExtents { "avi|",
127 "flc\0" }
128 RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
129 "MMOS2 Flc/Fli player(*.flc)\0" }
131 RCDATA NP_INFO_FileVersion { 1,0,0,1 }
132 RCDATA NP_INFO_CompanyName { "Netscape Communications\0" }
133 RCDATA NP_INFO_FileDescription { "NPAVI32 Extension DLL\0"
134 RCDATA NP_INFO_InternalName { "NPAVI32\0" )
135 RCDATA NP_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0"
136 RCDATA NP_INFO_OriginalFilename { "NVAPI32.DLL" }
137 RCDATA NP_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" }
139 /* RC_DATA types for version info - required */
140 #define NP_INFO_ProductVersion 1
141 #define NP_INFO_MIMEType 2
142 #define NP_INFO_FileOpenName 3
143 #define NP_INFO_FileExtents 4
144 /* RC_DATA types for version info - used if found */
145 #define NP_INFO_FileDescription 5
146 #define NP_INFO_ProductName 6
147 /* RC_DATA types for version info - optional */
148 #define NP_INFO_CompanyName 7
149 #define NP_INFO_FileVersion 8
150 #define NP_INFO_InternalName 9
151 #define NP_INFO_LegalCopyright 10
152 #define NP_INFO_OriginalFilename 11
154 #ifndef RC_INVOKED
156 /*----------------------------------------------------------------------*/
157 /* Definition of Basic Types */
158 /*----------------------------------------------------------------------*/
160 typedef unsigned char NPBool;
161 typedef int16_t NPError;
162 typedef int16_t NPReason;
163 typedef char* NPMIMEType;
165 /*----------------------------------------------------------------------*/
166 /* Structures and definitions */
167 /*----------------------------------------------------------------------*/
169 #if !defined(__LP64__)
170 #if defined(XP_MACOSX)
171 #pragma options align=mac68k
172 #endif
173 #endif /* __LP64__ */
176 * NPP is a plug-in's opaque instance handle
178 typedef struct _NPP
180 void* pdata; /* plug-in private data */
181 void* ndata; /* netscape private data */
182 } NPP_t;
184 typedef NPP_t* NPP;
186 typedef struct _NPStream
188 void* pdata; /* plug-in private data */
189 void* ndata; /* netscape private data */
190 const char* url;
191 uint32_t end;
192 uint32_t lastmodified;
193 void* notifyData;
194 const char* headers; /* Response headers from host.
195 * Exists only for >= NPVERS_HAS_RESPONSE_HEADERS.
196 * Used for HTTP only; NULL for non-HTTP.
197 * Available from NPP_NewStream onwards.
198 * Plugin should copy this data before storing it.
199 * Includes HTTP status line and all headers,
200 * preferably verbatim as received from server,
201 * headers formatted as in HTTP ("Header: Value"),
202 * and newlines (\n, NOT \r\n) separating lines.
203 * Terminated by \n\0 (NOT \n\n\0). */
204 } NPStream;
206 typedef struct _NPByteRange
208 int32_t offset; /* negative offset means from the end */
209 uint32_t length;
210 struct _NPByteRange* next;
211 } NPByteRange;
213 typedef struct _NPSavedData
215 int32_t len;
216 void* buf;
217 } NPSavedData;
219 typedef struct _NPRect
221 uint16_t top;
222 uint16_t left;
223 uint16_t bottom;
224 uint16_t right;
225 } NPRect;
227 typedef struct _NPSize
229 int32_t width;
230 int32_t height;
231 } NPSize;
233 typedef enum {
234 NPFocusNext = 0,
235 NPFocusPrevious = 1
236 } NPFocusDirection;
238 /* Return values for NPP_HandleEvent */
239 #define kNPEventNotHandled 0
240 #define kNPEventHandled 1
241 /* Exact meaning must be spec'd in event model. */
242 #define kNPEventStartIME 2
244 #if defined(XP_UNIX)
246 * Unix specific structures and definitions
250 * Callback Structures.
252 * These are used to pass additional platform specific information.
254 enum {
255 NP_SETWINDOW = 1,
256 NP_PRINT
259 typedef struct
261 int32_t type;
262 } NPAnyCallbackStruct;
264 typedef struct
266 int32_t type;
267 #if defined(MOZ_X11)
268 Display* display;
269 Visual* visual;
270 Colormap colormap;
271 unsigned int depth;
272 #endif
273 } NPSetWindowCallbackStruct;
275 typedef struct
277 int32_t type;
278 FILE* fp;
279 } NPPrintCallbackStruct;
281 #endif /* XP_UNIX */
283 #if defined(XP_MACOSX)
284 typedef enum {
285 #ifndef NP_NO_QUICKDRAW
286 NPDrawingModelQuickDraw = 0,
287 #endif
288 NPDrawingModelCoreGraphics = 1,
289 NPDrawingModelOpenGL = 2,
290 NPDrawingModelCoreAnimation = 3,
291 NPDrawingModelInvalidatingCoreAnimation = 4
292 } NPDrawingModel;
294 typedef enum {
295 #ifndef NP_NO_CARBON
296 NPEventModelCarbon = 0,
297 #endif
298 NPEventModelCocoa = 1
299 } NPEventModel;
300 #endif
303 * The following masks are applied on certain platforms to NPNV and
304 * NPPV selectors that pass around pointers to COM interfaces. Newer
305 * compilers on some platforms may generate vtables that are not
306 * compatible with older compilers. To prevent older plugins from
307 * not understanding a new browser's ABI, these masks change the
308 * values of those selectors on those platforms. To remain backwards
309 * compatible with different versions of the browser, plugins can
310 * use these masks to dynamically determine and use the correct C++
311 * ABI that the browser is expecting. This does not apply to Windows
312 * as Microsoft's COM ABI will likely not change.
315 #define NP_ABI_GCC3_MASK 0x10000000
317 * gcc 3.x generated vtables on UNIX and OSX are incompatible with
318 * previous compilers.
320 #if defined(XP_UNIX) && defined(__GNUC__)
321 #define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK
322 #else
323 #define _NP_ABI_MIXIN_FOR_GCC3 0
324 #endif
326 #if defined(XP_MACOSX)
327 #define NP_ABI_MACHO_MASK 0x01000000
328 #define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
329 #else
330 #define _NP_ABI_MIXIN_FOR_MACHO 0
331 #endif
333 #define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO)
336 * List of variable names for which NPP_GetValue shall be implemented
338 typedef enum {
339 NPPVpluginNameString = 1,
340 NPPVpluginDescriptionString,
341 NPPVpluginWindowBool,
342 NPPVpluginTransparentBool,
343 NPPVjavaClass,
344 NPPVpluginWindowSize,
345 NPPVpluginTimerInterval,
346 NPPVpluginScriptableInstance = (10 | NP_ABI_MASK),
347 NPPVpluginScriptableIID = 11,
348 NPPVjavascriptPushCallerBool = 12,
349 NPPVpluginKeepLibraryInMemory = 13,
350 NPPVpluginNeedsXEmbed = 14,
352 /* Get the NPObject for scripting the plugin. Introduced in NPAPI minor version 14.
354 NPPVpluginScriptableNPObject = 15,
356 /* Get the plugin value (as \0-terminated UTF-8 string data) for
357 * form submission if the plugin is part of a form. Use
358 * NPN_MemAlloc() to allocate memory for the string data. Introduced
359 * in NPAPI minor version 15.
361 NPPVformValue = 16,
363 NPPVpluginUrlRequestsDisplayedBool = 17,
365 /* Checks if the plugin is interested in receiving the http body of
366 * all http requests (including failed ones, http status != 200).
368 NPPVpluginWantsAllNetworkStreams = 18,
370 /* Browsers can retrieve a native ATK accessibility plug ID via this variable. */
371 NPPVpluginNativeAccessibleAtkPlugId = 19,
373 /* Checks to see if the plug-in would like the browser to load the "src" attribute. */
374 NPPVpluginCancelSrcStream = 20,
376 NPPVSupportsAdvancedKeyHandling = 21
378 #if defined(XP_MACOSX)
379 /* Used for negotiating drawing models */
380 , NPPVpluginDrawingModel = 1000
381 /* Used for negotiating event models */
382 , NPPVpluginEventModel = 1001
383 /* In the NPDrawingModelCoreAnimation drawing model, the browser asks the plug-in for a Core Animation layer. */
384 , NPPVpluginCoreAnimationLayer = 1003
385 #endif
387 #if defined(MOZ_PLATFORM_MAEMO) && ((MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6))
388 , NPPVpluginWindowlessLocalBool = 2002
389 #endif
390 } NPPVariable;
393 * List of variable names for which NPN_GetValue should be implemented.
395 typedef enum {
396 NPNVxDisplay = 1,
397 NPNVxtAppContext,
398 NPNVnetscapeWindow,
399 NPNVjavascriptEnabledBool,
400 NPNVasdEnabledBool,
401 NPNVisOfflineBool,
403 NPNVserviceManager = (10 | NP_ABI_MASK),
404 NPNVDOMElement = (11 | NP_ABI_MASK),
405 NPNVDOMWindow = (12 | NP_ABI_MASK),
406 NPNVToolkit = (13 | NP_ABI_MASK),
407 NPNVSupportsXEmbedBool = 14,
409 /* Get the NPObject wrapper for the browser window. */
410 NPNVWindowNPObject = 15,
412 /* Get the NPObject wrapper for the plugins DOM element. */
413 NPNVPluginElementNPObject = 16,
415 NPNVSupportsWindowless = 17,
417 NPNVprivateModeBool = 18,
419 NPNVsupportsAdvancedKeyHandling = 21
421 #if defined(XP_MACOSX)
422 /* Used for negotiating drawing models */
423 , NPNVpluginDrawingModel = 1000
424 #ifndef NP_NO_QUICKDRAW
425 , NPNVsupportsQuickDrawBool = 2000
426 #endif
427 , NPNVsupportsCoreGraphicsBool = 2001
428 , NPNVsupportsOpenGLBool = 2002
429 , NPNVsupportsCoreAnimationBool = 2003
430 , NPNVsupportsInvalidatingCoreAnimationBool = 2004
431 #ifndef NP_NO_CARBON
432 , NPNVsupportsCarbonBool = 3000 /* TRUE if the browser supports the Carbon event model */
433 #endif
434 , NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
435 , NPNVsupportsUpdatedCocoaTextInputBool = 3002 /* TRUE if the browser supports the updated
436 Cocoa text input specification. */
437 #endif
438 #if defined(MOZ_PLATFORM_MAEMO) && ((MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6))
439 , NPNVSupportsWindowlessLocal = 2002
440 #endif
441 } NPNVariable;
443 typedef enum {
444 NPNURLVCookie = 501,
445 NPNURLVProxy
446 } NPNURLVariable;
449 * The type of Toolkit the widgets use
451 typedef enum {
452 NPNVGtk12 = 1,
453 NPNVGtk2
454 } NPNToolkitType;
457 * The type of a NPWindow - it specifies the type of the data structure
458 * returned in the window field.
460 typedef enum {
461 NPWindowTypeWindow = 1,
462 NPWindowTypeDrawable
463 } NPWindowType;
465 typedef struct _NPWindow
467 void* window; /* Platform specific window handle */
468 /* OS/2: x - Position of bottom left corner */
469 /* OS/2: y - relative to visible netscape window */
470 int32_t x; /* Position of top left corner relative */
471 int32_t y; /* to a netscape page. */
472 uint32_t width; /* Maximum window size */
473 uint32_t height;
474 NPRect clipRect; /* Clipping rectangle in port coordinates */
475 #if (defined(XP_UNIX) || defined(XP_SYMBIAN)) && !defined(XP_MACOSX)
476 void * ws_info; /* Platform-dependent additional data */
477 #endif /* XP_UNIX */
478 NPWindowType type; /* Is this a window or a drawable? */
479 } NPWindow;
481 typedef struct _NPImageExpose
483 char* data; /* image pointer */
484 int32_t stride; /* Stride of data image pointer */
485 int32_t depth; /* Depth of image pointer */
486 int32_t x; /* Expose x */
487 int32_t y; /* Expose y */
488 uint32_t width; /* Expose width */
489 uint32_t height; /* Expose height */
490 NPSize dataSize; /* Data buffer size */
491 float translateX; /* translate X matrix value */
492 float translateY; /* translate Y matrix value */
493 float scaleX; /* scale X matrix value */
494 float scaleY; /* scale Y matrix value */
495 } NPImageExpose;
497 typedef struct _NPFullPrint
499 NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */
500 NPBool printOne; /* TRUE if plugin should print one copy to default
501 printer */
502 void* platformPrint; /* Platform-specific printing info */
503 } NPFullPrint;
505 typedef struct _NPEmbedPrint
507 NPWindow window;
508 void* platformPrint; /* Platform-specific printing info */
509 } NPEmbedPrint;
511 typedef struct _NPPrint
513 uint16_t mode; /* NP_FULL or NP_EMBED */
514 union
516 NPFullPrint fullPrint; /* if mode is NP_FULL */
517 NPEmbedPrint embedPrint; /* if mode is NP_EMBED */
518 } print;
519 } NPPrint;
521 #if defined(XP_MACOSX)
522 #ifndef NP_NO_CARBON
523 typedef EventRecord NPEvent;
524 #endif
525 #elif defined(XP_SYMBIAN)
526 typedef QEvent NPEvent;
527 #elif defined(XP_WIN)
528 typedef struct _NPEvent
530 uint16_t event;
531 uintptr_t wParam;
532 uintptr_t lParam;
533 } NPEvent;
534 #elif defined(XP_OS2)
535 typedef struct _NPEvent
537 uint32_t event;
538 uint32_t wParam;
539 uint32_t lParam;
540 } NPEvent;
541 #elif defined(XP_UNIX) && defined(MOZ_X11)
542 typedef XEvent NPEvent;
543 #else
544 typedef void* NPEvent;
545 #endif
547 #if defined(XP_MACOSX)
548 typedef void* NPRegion;
549 #ifndef NP_NO_QUICKDRAW
550 typedef RgnHandle NPQDRegion;
551 #endif
552 typedef CGPathRef NPCGRegion;
553 #elif defined(XP_WIN)
554 typedef HRGN NPRegion;
555 #elif defined(XP_UNIX) && defined(MOZ_X11)
556 typedef Region NPRegion;
557 #elif defined(XP_SYMBIAN)
558 typedef QRegion* NPRegion;
559 #else
560 typedef void *NPRegion;
561 #endif
563 typedef struct _NPNSString NPNSString;
564 typedef struct _NPNSWindow NPNSWindow;
565 typedef struct _NPNSMenu NPNSMenu;
567 #if defined(XP_MACOSX)
568 typedef NPNSMenu NPMenu;
569 #else
570 typedef void *NPMenu;
571 #endif
573 typedef enum {
574 NPCoordinateSpacePlugin = 1,
575 NPCoordinateSpaceWindow,
576 NPCoordinateSpaceFlippedWindow,
577 NPCoordinateSpaceScreen,
578 NPCoordinateSpaceFlippedScreen
579 } NPCoordinateSpace;
581 #if defined(XP_MACOSX)
583 #ifndef NP_NO_QUICKDRAW
584 typedef struct NP_Port
586 CGrafPtr port;
587 int32_t portx; /* position inside the topmost window */
588 int32_t porty;
589 } NP_Port;
590 #endif /* NP_NO_QUICKDRAW */
593 * NP_CGContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelCoreGraphics
594 * as its drawing model.
597 typedef struct NP_CGContext
599 CGContextRef context;
600 void *window; /* A WindowRef under the Carbon event model. */
601 } NP_CGContext;
604 * NP_GLContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelOpenGL as its
605 * drawing model.
608 typedef struct NP_GLContext
610 CGLContextObj context;
611 #ifdef NP_NO_CARBON
612 NPNSWindow *window;
613 #else
614 void *window; /* Can be either an NSWindow or a WindowRef depending on the event model */
615 #endif
616 } NP_GLContext;
618 typedef enum {
619 NPCocoaEventDrawRect = 1,
620 NPCocoaEventMouseDown,
621 NPCocoaEventMouseUp,
622 NPCocoaEventMouseMoved,
623 NPCocoaEventMouseEntered,
624 NPCocoaEventMouseExited,
625 NPCocoaEventMouseDragged,
626 NPCocoaEventKeyDown,
627 NPCocoaEventKeyUp,
628 NPCocoaEventFlagsChanged,
629 NPCocoaEventFocusChanged,
630 NPCocoaEventWindowFocusChanged,
631 NPCocoaEventScrollWheel,
632 NPCocoaEventTextInput
633 } NPCocoaEventType;
635 typedef struct _NPCocoaEvent {
636 NPCocoaEventType type;
637 uint32_t version;
638 union {
639 struct {
640 uint32_t modifierFlags;
641 double pluginX;
642 double pluginY;
643 int32_t buttonNumber;
644 int32_t clickCount;
645 double deltaX;
646 double deltaY;
647 double deltaZ;
648 } mouse;
649 struct {
650 uint32_t modifierFlags;
651 NPNSString *characters;
652 NPNSString *charactersIgnoringModifiers;
653 NPBool isARepeat;
654 uint16_t keyCode;
655 } key;
656 struct {
657 CGContextRef context;
658 double x;
659 double y;
660 double width;
661 double height;
662 } draw;
663 struct {
664 NPBool hasFocus;
665 } focus;
666 struct {
667 NPNSString *text;
668 } text;
669 } data;
670 } NPCocoaEvent;
672 #ifndef NP_NO_CARBON
673 /* Non-standard event types that can be passed to HandleEvent */
674 enum NPEventType {
675 NPEventType_GetFocusEvent = (osEvt + 16),
676 NPEventType_LoseFocusEvent,
677 NPEventType_AdjustCursorEvent,
678 NPEventType_MenuCommandEvent,
679 NPEventType_ClippingChangedEvent,
680 NPEventType_ScrollingBeginsEvent = 1000,
681 NPEventType_ScrollingEndsEvent
683 #endif /* NP_NO_CARBON */
685 #endif /* XP_MACOSX */
688 * Values for mode passed to NPP_New:
690 #define NP_EMBED 1
691 #define NP_FULL 2
694 * Values for stream type passed to NPP_NewStream:
696 #define NP_NORMAL 1
697 #define NP_SEEK 2
698 #define NP_ASFILE 3
699 #define NP_ASFILEONLY 4
701 #define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
704 * Flags for NPP_ClearSiteData.
706 #define NP_CLEAR_ALL 0
707 #define NP_CLEAR_CACHE (1 << 0)
709 #if !defined(__LP64__)
710 #if defined(XP_MACOSX)
711 #pragma options align=reset
712 #endif
713 #endif /* __LP64__ */
715 /*----------------------------------------------------------------------*/
716 /* Error and Reason Code definitions */
717 /*----------------------------------------------------------------------*/
720 * Values of type NPError:
722 #define NPERR_BASE 0
723 #define NPERR_NO_ERROR (NPERR_BASE + 0)
724 #define NPERR_GENERIC_ERROR (NPERR_BASE + 1)
725 #define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2)
726 #define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3)
727 #define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4)
728 #define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5)
729 #define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6)
730 #define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7)
731 #define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8)
732 #define NPERR_INVALID_PARAM (NPERR_BASE + 9)
733 #define NPERR_INVALID_URL (NPERR_BASE + 10)
734 #define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11)
735 #define NPERR_NO_DATA (NPERR_BASE + 12)
736 #define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13)
737 #define NPERR_TIME_RANGE_NOT_SUPPORTED (NPERR_BASE + 14)
738 #define NPERR_MALFORMED_SITE (NPERR_BASE + 15)
741 * Values of type NPReason:
743 #define NPRES_BASE 0
744 #define NPRES_DONE (NPRES_BASE + 0)
745 #define NPRES_NETWORK_ERR (NPRES_BASE + 1)
746 #define NPRES_USER_BREAK (NPRES_BASE + 2)
749 * Version feature information
751 #define NPVERS_HAS_STREAMOUTPUT 8
752 #define NPVERS_HAS_NOTIFICATION 9
753 #define NPVERS_HAS_LIVECONNECT 9
754 #define NPVERS_68K_HAS_LIVECONNECT 11
755 #define NPVERS_HAS_WINDOWLESS 11
756 #define NPVERS_HAS_XPCONNECT_SCRIPTING 13
757 #define NPVERS_HAS_NPRUNTIME_SCRIPTING 14
758 #define NPVERS_HAS_FORM_VALUES 15
759 #define NPVERS_HAS_POPUPS_ENABLED_STATE 16
760 #define NPVERS_HAS_RESPONSE_HEADERS 17
761 #define NPVERS_HAS_NPOBJECT_ENUM 18
762 #define NPVERS_HAS_PLUGIN_THREAD_ASYNC_CALL 19
763 #define NPVERS_HAS_ALL_NETWORK_STREAMS 20
764 #define NPVERS_HAS_URL_AND_AUTH_INFO 21
765 #define NPVERS_HAS_PRIVATE_MODE 22
766 #define NPVERS_MACOSX_HAS_COCOA_EVENTS 23
767 #define NPVERS_HAS_ADVANCED_KEY_HANDLING 25
768 #define NPVERS_HAS_URL_REDIRECT_HANDLING 26
769 #define NPVERS_HAS_CLEAR_SITE_DATA 27
771 /*----------------------------------------------------------------------*/
772 /* Function Prototypes */
773 /*----------------------------------------------------------------------*/
775 #if defined(__OS2__)
776 #define NP_LOADDS _System
777 #else
778 #define NP_LOADDS
779 #endif
781 #ifdef __cplusplus
782 extern "C" {
783 #endif
785 /* NPP_* functions are provided by the plugin and called by the navigator. */
787 const char* NPP_GetMIMEDescription(void);
788 NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
789 uint16_t mode, int16_t argc, char* argn[],
790 char* argv[], NPSavedData* saved);
791 NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save);
792 NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window);
793 NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type,
794 NPStream* stream, NPBool seekable,
795 uint16_t* stype);
796 NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream,
797 NPReason reason);
798 int32_t NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream);
799 int32_t NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32_t offset,
800 int32_t len, void* buffer);
801 void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
802 const char* fname);
803 void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
804 int16_t NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
805 void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
806 NPReason reason, void* notifyData);
807 NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value);
808 NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value);
809 NPBool NP_LOADDS NPP_GotFocus(NPP instance, NPFocusDirection direction);
810 void NP_LOADDS NPP_LostFocus(NPP instance);
811 void NP_LOADDS NPP_URLRedirectNotify(NPP instance, const char* url, int32_t status, void* notifyData);
812 NPError NP_LOADDS NPP_ClearSiteData(const char* site, uint64_t flags, uint64_t maxAge);
813 char** NP_LOADDS NPP_GetSitesWithData(void);
815 /* NPN_* functions are provided by the navigator and called by the plugin. */
816 void NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor,
817 int* netscape_major, int* netscape_minor);
818 NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url,
819 const char* target, void* notifyData);
820 NPError NP_LOADDS NPN_GetURL(NPP instance, const char* url,
821 const char* target);
822 NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url,
823 const char* target, uint32_t len,
824 const char* buf, NPBool file,
825 void* notifyData);
826 NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url,
827 const char* target, uint32_t len,
828 const char* buf, NPBool file);
829 NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
830 NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type,
831 const char* target, NPStream** stream);
832 int32_t NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32_t len,
833 void* buffer);
834 NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream,
835 NPReason reason);
836 void NP_LOADDS NPN_Status(NPP instance, const char* message);
837 const char* NP_LOADDS NPN_UserAgent(NPP instance);
838 void* NP_LOADDS NPN_MemAlloc(uint32_t size);
839 void NP_LOADDS NPN_MemFree(void* ptr);
840 uint32_t NP_LOADDS NPN_MemFlush(uint32_t size);
841 void NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages);
842 NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable,
843 void *value);
844 NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable,
845 void *value);
846 void NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
847 void NP_LOADDS NPN_InvalidateRegion(NPP instance,
848 NPRegion invalidRegion);
849 void NP_LOADDS NPN_ForceRedraw(NPP instance);
850 void NP_LOADDS NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
851 void NP_LOADDS NPN_PopPopupsEnabledState(NPP instance);
852 void NP_LOADDS NPN_PluginThreadAsyncCall(NPP instance,
853 void (*func) (void *),
854 void *userData);
855 NPError NP_LOADDS NPN_GetValueForURL(NPP instance, NPNURLVariable variable,
856 const char *url, char **value,
857 uint32_t *len);
858 NPError NP_LOADDS NPN_SetValueForURL(NPP instance, NPNURLVariable variable,
859 const char *url, const char *value,
860 uint32_t len);
861 NPError NP_LOADDS NPN_GetAuthenticationInfo(NPP instance,
862 const char *protocol,
863 const char *host, int32_t port,
864 const char *scheme,
865 const char *realm,
866 char **username, uint32_t *ulen,
867 char **password,
868 uint32_t *plen);
869 uint32_t NP_LOADDS NPN_ScheduleTimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
870 void NP_LOADDS NPN_UnscheduleTimer(NPP instance, uint32_t timerID);
871 NPError NP_LOADDS NPN_PopUpContextMenu(NPP instance, NPMenu* menu);
872 NPBool NP_LOADDS NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
873 NPBool NP_LOADDS NPN_HandleEvent(NPP instance, void *event, NPBool handled);
874 NPBool NP_LOADDS NPN_UnfocusInstance(NPP instance, NPFocusDirection direction);
875 void NP_LOADDS NPN_URLRedirectResponse(NPP instance, void* notifyData, NPBool allow);
877 #ifdef __cplusplus
878 } /* end extern "C" */
879 #endif
881 #endif /* RC_INVOKED */
882 #if defined(__OS2__)
883 #pragma pack()
884 #endif
886 #endif /* npapi_h_ */