michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * vim: sw=4 ts=4 et : michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_PluginLibrary_h michael@0: #define mozilla_PluginLibrary_h 1 michael@0: michael@0: #include "prlink.h" michael@0: #include "npapi.h" michael@0: #include "npfunctions.h" michael@0: #include "nscore.h" michael@0: #include "nsTArray.h" michael@0: #include "nsError.h" michael@0: #include "mozilla/EventForwards.h" michael@0: michael@0: class gfxContext; michael@0: class nsCString; michael@0: struct nsIntRect; michael@0: struct nsIntSize; michael@0: class nsNPAPIPlugin; michael@0: michael@0: namespace mozilla { michael@0: namespace layers { michael@0: class Image; michael@0: class ImageContainer; michael@0: } michael@0: } michael@0: michael@0: michael@0: namespace mozilla { michael@0: michael@0: class PluginLibrary michael@0: { michael@0: public: michael@0: virtual ~PluginLibrary() { } michael@0: michael@0: /** michael@0: * Inform this library about the nsNPAPIPlugin which owns it. This michael@0: * object will hold a weak pointer to the plugin. michael@0: */ michael@0: virtual void SetPlugin(nsNPAPIPlugin* plugin) = 0; michael@0: michael@0: virtual bool HasRequiredFunctions() = 0; michael@0: michael@0: #if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK) michael@0: virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) = 0; michael@0: #else michael@0: virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) = 0; michael@0: #endif michael@0: virtual nsresult NP_Shutdown(NPError* error) = 0; michael@0: virtual nsresult NP_GetMIMEDescription(const char** mimeDesc) = 0; michael@0: virtual nsresult NP_GetValue(void *future, NPPVariable aVariable, michael@0: void *aValue, NPError* error) = 0; michael@0: #if defined(XP_WIN) || defined(XP_MACOSX) michael@0: virtual nsresult NP_GetEntryPoints(NPPluginFuncs* pFuncs, NPError* error) = 0; michael@0: #endif michael@0: virtual nsresult NPP_New(NPMIMEType pluginType, NPP instance, michael@0: uint16_t mode, int16_t argc, char* argn[], michael@0: char* argv[], NPSavedData* saved, michael@0: NPError* error) = 0; michael@0: michael@0: virtual nsresult NPP_ClearSiteData(const char* site, uint64_t flags, michael@0: uint64_t maxAge) = 0; michael@0: virtual nsresult NPP_GetSitesWithData(InfallibleTArray& aResult) = 0; michael@0: michael@0: virtual nsresult AsyncSetWindow(NPP instance, NPWindow* window) = 0; michael@0: virtual nsresult GetImageContainer(NPP instance, mozilla::layers::ImageContainer** aContainer) = 0; michael@0: virtual nsresult GetImageSize(NPP instance, nsIntSize* aSize) = 0; michael@0: virtual bool IsOOP() = 0; michael@0: #if defined(XP_MACOSX) michael@0: virtual nsresult IsRemoteDrawingCoreAnimation(NPP instance, bool *aDrawing) = 0; michael@0: virtual nsresult ContentsScaleFactorChanged(NPP instance, double aContentsScaleFactor) = 0; michael@0: #endif michael@0: michael@0: /** michael@0: * The next three methods are the third leg in the trip to michael@0: * PluginInstanceParent. They approximately follow the ReadbackSink michael@0: * API. michael@0: */ michael@0: virtual nsresult SetBackgroundUnknown(NPP instance) = 0; michael@0: virtual nsresult BeginUpdateBackground(NPP instance, michael@0: const nsIntRect&, gfxContext**) = 0; michael@0: virtual nsresult EndUpdateBackground(NPP instance, michael@0: gfxContext*, const nsIntRect&) = 0; michael@0: }; michael@0: michael@0: michael@0: } // namespace mozilla michael@0: michael@0: #endif // ifndef mozilla_PluginLibrary_h