2009-12-16 23:08:45 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2009-06-30 22:51:05 +04:00
|
|
|
* vim: sw=4 ts=4 et :
|
2012-05-21 15:12:37 +04:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-06-30 22:51:05 +04:00
|
|
|
|
2009-10-27 22:51:12 +03:00
|
|
|
#ifndef mozilla_PluginLibrary_h
|
|
|
|
#define mozilla_PluginLibrary_h 1
|
2009-06-30 22:51:05 +04:00
|
|
|
|
|
|
|
#include "prlink.h"
|
2009-10-27 22:51:12 +03:00
|
|
|
#include "npapi.h"
|
2010-04-13 20:10:00 +04:00
|
|
|
#include "npfunctions.h"
|
2009-10-27 22:51:12 +03:00
|
|
|
#include "nscore.h"
|
2011-02-09 01:16:07 +03:00
|
|
|
#include "nsTArray.h"
|
2012-07-27 18:03:27 +04:00
|
|
|
#include "nsError.h"
|
2013-09-24 14:04:14 +04:00
|
|
|
#include "mozilla/EventForwards.h"
|
2009-06-30 22:51:05 +04:00
|
|
|
|
2010-09-10 22:28:52 +04:00
|
|
|
class gfxASurface;
|
2011-02-17 01:43:31 +03:00
|
|
|
class gfxContext;
|
2011-02-09 01:16:07 +03:00
|
|
|
class nsCString;
|
2011-02-17 01:43:31 +03:00
|
|
|
struct nsIntRect;
|
2011-02-23 08:38:09 +03:00
|
|
|
struct nsIntSize;
|
2011-02-17 01:43:31 +03:00
|
|
|
class nsNPAPIPlugin;
|
2009-12-16 23:08:45 +03:00
|
|
|
|
2011-02-12 19:07:10 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
class Image;
|
|
|
|
class ImageContainer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-06-30 22:51:05 +04:00
|
|
|
namespace mozilla {
|
|
|
|
|
2009-10-27 22:51:12 +03:00
|
|
|
class PluginLibrary
|
2009-06-30 22:51:05 +04:00
|
|
|
{
|
|
|
|
public:
|
2009-10-27 22:51:12 +03:00
|
|
|
virtual ~PluginLibrary() { }
|
2009-06-30 22:51:05 +04:00
|
|
|
|
2009-12-16 23:08:45 +03:00
|
|
|
/**
|
|
|
|
* Inform this library about the nsNPAPIPlugin which owns it. This
|
|
|
|
* object will hold a weak pointer to the plugin.
|
|
|
|
*/
|
|
|
|
virtual void SetPlugin(nsNPAPIPlugin* plugin) = 0;
|
|
|
|
|
2009-10-27 22:51:12 +03:00
|
|
|
virtual bool HasRequiredFunctions() = 0;
|
2009-06-30 22:51:05 +04:00
|
|
|
|
2011-11-11 04:17:46 +04:00
|
|
|
#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK)
|
2009-10-27 22:51:12 +03:00
|
|
|
virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, NPError* error) = 0;
|
|
|
|
#else
|
|
|
|
virtual nsresult NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) = 0;
|
|
|
|
#endif
|
|
|
|
virtual nsresult NP_Shutdown(NPError* error) = 0;
|
2010-01-29 23:18:50 +03:00
|
|
|
virtual nsresult NP_GetMIMEDescription(const char** mimeDesc) = 0;
|
2009-10-27 22:51:12 +03:00
|
|
|
virtual nsresult NP_GetValue(void *future, NPPVariable aVariable,
|
|
|
|
void *aValue, NPError* error) = 0;
|
2009-12-24 00:12:00 +03:00
|
|
|
#if defined(XP_WIN) || defined(XP_MACOSX) || defined(XP_OS2)
|
2009-10-27 22:51:12 +03:00
|
|
|
virtual nsresult NP_GetEntryPoints(NPPluginFuncs* pFuncs, NPError* error) = 0;
|
|
|
|
#endif
|
|
|
|
virtual nsresult NPP_New(NPMIMEType pluginType, NPP instance,
|
|
|
|
uint16_t mode, int16_t argc, char* argn[],
|
|
|
|
char* argv[], NPSavedData* saved,
|
|
|
|
NPError* error) = 0;
|
2010-09-10 22:28:52 +04:00
|
|
|
|
2011-02-09 01:16:07 +03:00
|
|
|
virtual nsresult NPP_ClearSiteData(const char* site, uint64_t flags,
|
|
|
|
uint64_t maxAge) = 0;
|
|
|
|
virtual nsresult NPP_GetSitesWithData(InfallibleTArray<nsCString>& aResult) = 0;
|
|
|
|
|
2010-09-10 22:28:52 +04:00
|
|
|
virtual nsresult AsyncSetWindow(NPP instance, NPWindow* window) = 0;
|
2012-11-10 19:45:52 +04:00
|
|
|
virtual nsresult GetImageContainer(NPP instance, mozilla::layers::ImageContainer** aContainer) = 0;
|
2011-02-23 08:38:09 +03:00
|
|
|
virtual nsresult GetImageSize(NPP instance, nsIntSize* aSize) = 0;
|
2012-08-02 00:34:08 +04:00
|
|
|
virtual bool IsOOP() = 0;
|
2011-06-30 20:46:26 +04:00
|
|
|
#if defined(XP_MACOSX)
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual nsresult IsRemoteDrawingCoreAnimation(NPP instance, bool *aDrawing) = 0;
|
2012-10-16 23:41:21 +04:00
|
|
|
virtual nsresult ContentsScaleFactorChanged(NPP instance, double aContentsScaleFactor) = 0;
|
2011-06-30 20:46:26 +04:00
|
|
|
#endif
|
|
|
|
|
2011-02-17 01:43:31 +03:00
|
|
|
/**
|
|
|
|
* The next three methods are the third leg in the trip to
|
|
|
|
* PluginInstanceParent. They approximately follow the ReadbackSink
|
|
|
|
* API.
|
|
|
|
*/
|
|
|
|
virtual nsresult SetBackgroundUnknown(NPP instance) = 0;
|
|
|
|
virtual nsresult BeginUpdateBackground(NPP instance,
|
|
|
|
const nsIntRect&, gfxContext**) = 0;
|
|
|
|
virtual nsresult EndUpdateBackground(NPP instance,
|
|
|
|
gfxContext*, const nsIntRect&) = 0;
|
2009-06-30 22:51:05 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2009-10-27 22:51:12 +03:00
|
|
|
#endif // ifndef mozilla_PluginLibrary_h
|