home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / include / np.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  5.2 KB  |  134 lines

  1. /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19.  
  20. /*
  21.  *  np.h $Revision: 3.1 $
  22.  *  Prototypes for functions exported by libplugin and called by the FEs or other XP libs.
  23.  *  Prototypes for functions exported by the FEs and called by libplugin are in nppg.h.
  24.  */
  25.  
  26. #ifndef _NP_H
  27. #define _NP_H
  28.  
  29. #include "lo_ele.h"
  30. #include "npapi.h"
  31. #include "net.h"
  32.  
  33. #ifdef XP_UNIX
  34. /* Aaagh. npapi.h include Xlib.h. Bool is being #defined by Xlib and
  35.    we are typedeffing it in the navigator. */
  36. #ifdef Bool
  37. #undef Bool
  38. #endif /* Bool */
  39. #endif
  40.  
  41. typedef enum { NP_Untyped = 0, NP_OLE, NP_Plugin } NPAppType;
  42. typedef enum { NP_FullPage = 1, NP_Embedded } NPPageType;
  43.  
  44. typedef void* NPReference;
  45. #define NPRefFromStart ((NPReference)NULL)
  46.  
  47.  
  48. /* it's lame that this is supposed to support more than plugins but
  49. it has plugin specific junk (wdata) in it -jg */
  50.  
  51. struct _NPEmbeddedApp {
  52.     struct _NPEmbeddedApp *next;
  53.     NPAppType type;
  54.     void *fe_data;
  55.     void *np_data;
  56.     NPWindow *wdata;
  57.     NPPageType pagePluginType;
  58. };
  59.  
  60. /* Uncomment this to enable ANTHRAX.  .c files affected: npglue.c, layembed.c, layobj.c */
  61. /* amusil 1.8.98 */
  62. /* #define ANTHRAX */
  63.  
  64. XP_BEGIN_PROTOS
  65.  
  66. extern void             NPL_Init(void);
  67. extern void             NPL_Shutdown(void);
  68.  
  69. extern void             NPL_RegisterDefaultConverters(void);
  70. extern NPError            NPL_RegisterPluginFile(const char* pluginname, const char* filename,
  71.                                 const char* description, void* pd);
  72. extern NPError            NPL_RegisterPluginType(NPMIMEType type, const char *extentstring,
  73.                                 const char* description, void* fileType, void* pd, XP_Bool enabled);
  74. extern NPError            NPL_RefreshPluginList(XP_Bool reloadPages);
  75.  
  76. extern NPBool            NPL_IteratePluginFiles(NPReference* ref, char** name, char** filename, char** description);
  77. extern NPBool            NPL_IteratePluginTypes(NPReference* ref, NPReference plugin, NPMIMEType* type,
  78.                                 char*** extents, char** description, void** fileType);
  79. extern char**             NPL_FindPluginsForType(const char* typeToFind);
  80. extern char*            NPL_FindPluginEnabledForType(const char* typeToFind);
  81.  
  82. extern NPError            NPL_EnablePlugin(NPMIMEType type,
  83.                                          const char* pluginname,
  84.                                          XP_Bool enabled);
  85. extern NPError            NPL_EnablePluginType(NPMIMEType type, void* pdesc, XP_Bool enabled);
  86. extern NPError            NPL_DisablePlugin(NPMIMEType type);
  87.  
  88. extern NPEmbeddedApp*    NPL_EmbedCreate(MWContext *context, LO_EmbedStruct *embed_struct);
  89. extern NPError            NPL_EmbedStart(MWContext* cx, LO_EmbedStruct* embed_struct, NPEmbeddedApp* app);
  90.  
  91. extern void                NPL_EmbedSize(NPEmbeddedApp *app);
  92.  
  93. /* ~~av the following is used in CGenericDoc::FreeEmbedElement */
  94. extern int32      NPL_GetEmbedReferenceCount(NPEmbeddedApp *app);
  95.  
  96. extern void             NPL_EmbedDelete(MWContext *context, LO_EmbedStruct *embed_struct);
  97.  
  98. extern XP_Bool            NPL_IsLiveConnected(LO_EmbedStruct *embed);
  99.  
  100. extern int                NPL_HandleEvent(NPEmbeddedApp *app, void *event, void* window); /* window may be NULL */
  101. extern void                NPL_Print(NPEmbeddedApp *app, void *printData);
  102. extern void                NPL_SamePage(MWContext *context);
  103. extern void             NPL_SameElement(LO_EmbedStruct *embed);
  104. extern void                NPL_DeleteSessionData(MWContext* context, void* sessionData);
  105. extern XP_Bool             NPL_HandleURL(MWContext *pContext, FO_Present_Types iFormatOut, URL_Struct *pURL,
  106.                                 Net_GetUrlExitFunc *pExitFunc);
  107. #ifndef XP_MAC                                
  108. extern void                NPL_DisplayPluginsAsHTML(FO_Present_Types format_out, URL_Struct *urls, MWContext *cx);
  109. #endif
  110. extern void                NPL_PreparePrint(MWContext* context, SHIST_SavedData* savedData);
  111.  
  112. extern NET_StreamClass* NPL_NewEmbedStream(FO_Present_Types format_out, void *type, URL_Struct *urls, MWContext *cx);
  113. extern NET_StreamClass* NPL_NewPresentStream(FO_Present_Types format_out, void *type, URL_Struct *urls, MWContext *cx);
  114. extern unsigned int     NPL_WriteReady(NET_StreamClass *stream);
  115. extern int              NPL_Write(NET_StreamClass *stream, const unsigned char *str, int32 len);
  116. extern void             NPL_Complete(NET_StreamClass *stream);
  117. extern void             NPL_Abort(NET_StreamClass *stream, int status);
  118. extern XP_Bool          NPL_IsEmbedWindowed(NPEmbeddedApp *app);
  119. extern void                NPL_URLExit(URL_Struct *urls, int status, MWContext *cx);
  120.  
  121. #ifdef ANTHRAX
  122. extern char**            NPL_FindAppletsForType(const char* typeToFind);
  123. extern char*             NPL_FindAppletEnabledForMimetype(const char* mimetype);
  124. extern NPError            NPL_RegisterAppletType(NPMIMEType type);
  125. #endif /* ANTHRAX */
  126.  
  127. PR_EXTERN(void)         NPL_SetPluginWindow(void *data);
  128.  
  129. XP_END_PROTOS
  130.  
  131. #endif /* _NP_H */
  132.  
  133.  
  134.