1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/plugins/ipc/PluginLibrary.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,92 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * vim: sw=4 ts=4 et : 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef mozilla_PluginLibrary_h 1.11 +#define mozilla_PluginLibrary_h 1 1.12 + 1.13 +#include "prlink.h" 1.14 +#include "npapi.h" 1.15 +#include "npfunctions.h" 1.16 +#include "nscore.h" 1.17 +#include "nsTArray.h" 1.18 +#include "nsError.h" 1.19 +#include "mozilla/EventForwards.h" 1.20 + 1.21 +class gfxContext; 1.22 +class nsCString; 1.23 +struct nsIntRect; 1.24 +struct nsIntSize; 1.25 +class nsNPAPIPlugin; 1.26 + 1.27 +namespace mozilla { 1.28 +namespace layers { 1.29 +class Image; 1.30 +class ImageContainer; 1.31 +} 1.32 +} 1.33 + 1.34 + 1.35 +namespace mozilla { 1.36 + 1.37 +class PluginLibrary 1.38 +{ 1.39 +public: 1.40 + virtual ~PluginLibrary() { } 1.41 + 1.42 + /** 1.43 + * Inform this library about the nsNPAPIPlugin which owns it. This 1.44 + * object will hold a weak pointer to the plugin. 1.45 + */ 1.46 + virtual void SetPlugin(nsNPAPIPlugin* plugin) = 0; 1.47 + 1.48 + virtual bool HasRequiredFunctions() = 0; 1.49 + 1.50 +#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK) 1.51 + virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) = 0; 1.52 +#else 1.53 + virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) = 0; 1.54 +#endif 1.55 + virtual nsresult NP_Shutdown(NPError* error) = 0; 1.56 + virtual nsresult NP_GetMIMEDescription(const char** mimeDesc) = 0; 1.57 + virtual nsresult NP_GetValue(void *future, NPPVariable aVariable, 1.58 + void *aValue, NPError* error) = 0; 1.59 +#if defined(XP_WIN) || defined(XP_MACOSX) 1.60 + virtual nsresult NP_GetEntryPoints(NPPluginFuncs* pFuncs, NPError* error) = 0; 1.61 +#endif 1.62 + virtual nsresult NPP_New(NPMIMEType pluginType, NPP instance, 1.63 + uint16_t mode, int16_t argc, char* argn[], 1.64 + char* argv[], NPSavedData* saved, 1.65 + NPError* error) = 0; 1.66 + 1.67 + virtual nsresult NPP_ClearSiteData(const char* site, uint64_t flags, 1.68 + uint64_t maxAge) = 0; 1.69 + virtual nsresult NPP_GetSitesWithData(InfallibleTArray<nsCString>& aResult) = 0; 1.70 + 1.71 + virtual nsresult AsyncSetWindow(NPP instance, NPWindow* window) = 0; 1.72 + virtual nsresult GetImageContainer(NPP instance, mozilla::layers::ImageContainer** aContainer) = 0; 1.73 + virtual nsresult GetImageSize(NPP instance, nsIntSize* aSize) = 0; 1.74 + virtual bool IsOOP() = 0; 1.75 +#if defined(XP_MACOSX) 1.76 + virtual nsresult IsRemoteDrawingCoreAnimation(NPP instance, bool *aDrawing) = 0; 1.77 + virtual nsresult ContentsScaleFactorChanged(NPP instance, double aContentsScaleFactor) = 0; 1.78 +#endif 1.79 + 1.80 + /** 1.81 + * The next three methods are the third leg in the trip to 1.82 + * PluginInstanceParent. They approximately follow the ReadbackSink 1.83 + * API. 1.84 + */ 1.85 + virtual nsresult SetBackgroundUnknown(NPP instance) = 0; 1.86 + virtual nsresult BeginUpdateBackground(NPP instance, 1.87 + const nsIntRect&, gfxContext**) = 0; 1.88 + virtual nsresult EndUpdateBackground(NPP instance, 1.89 + gfxContext*, const nsIntRect&) = 0; 1.90 +}; 1.91 + 1.92 + 1.93 +} // namespace mozilla 1.94 + 1.95 +#endif // ifndef mozilla_PluginLibrary_h