2009-12-16 20:08:45 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2009-06-30 18:51:05 +00:00
|
|
|
* vim: sw=4 ts=4 et :
|
2012-05-21 11:12:37 +00: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 18:51:05 +00:00
|
|
|
|
2009-10-27 19:51:12 +00:00
|
|
|
#ifndef mozilla_PluginLibrary_h
|
|
|
|
#define mozilla_PluginLibrary_h 1
|
2009-06-30 18:51:05 +00:00
|
|
|
|
|
|
|
#include "prlink.h"
|
2009-10-27 19:51:12 +00:00
|
|
|
#include "npapi.h"
|
2010-04-13 16:10:00 +00:00
|
|
|
#include "npfunctions.h"
|
2009-10-27 19:51:12 +00:00
|
|
|
#include "nscore.h"
|
2011-02-08 22:16:07 +00:00
|
|
|
#include "nsTArray.h"
|
2012-07-27 14:03:27 +00:00
|
|
|
#include "nsError.h"
|
2013-09-24 10:04:14 +00:00
|
|
|
#include "mozilla/EventForwards.h"
|
2015-03-29 14:59:08 +00:00
|
|
|
#include "nsSize.h"
|
2015-04-21 15:04:57 +00:00
|
|
|
#include "nsRect.h"
|
2009-06-30 18:51:05 +00:00
|
|
|
|
2011-02-16 22:43:31 +00:00
|
|
|
class gfxContext;
|
2011-02-08 22:16:07 +00:00
|
|
|
class nsCString;
|
2011-02-16 22:43:31 +00:00
|
|
|
class nsNPAPIPlugin;
|
2009-12-16 20:08:45 +00:00
|
|
|
|
2011-02-12 16:07:10 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
class Image;
|
|
|
|
class ImageContainer;
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
2011-02-12 16:07:10 +00:00
|
|
|
|
2015-06-30 22:08:19 +00:00
|
|
|
class nsIClearSiteDataCallback;
|
|
|
|
|
|
|
|
#define nsIGetSitesWithDataCallback_CID {0xd0028b83, 0xfdf9, 0x4c53, {0xb7, 0xbb, 0x47, 0x46, 0x0f, 0x6b, 0x83, 0x6c}}
|
|
|
|
class nsIGetSitesWithDataCallback : public nsISupports {
|
|
|
|
public:
|
|
|
|
NS_IMETHOD SitesWithData(InfallibleTArray<nsCString>& result) = 0;
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(nsIGetSitesWithDataCallback_CID)
|
|
|
|
};
|
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsIGetSitesWithDataCallback, nsIGetSitesWithDataCallback_CID)
|
2011-02-12 16:07:10 +00:00
|
|
|
|
2009-06-30 18:51:05 +00:00
|
|
|
namespace mozilla {
|
|
|
|
|
2009-10-27 19:51:12 +00:00
|
|
|
class PluginLibrary
|
2009-06-30 18:51:05 +00:00
|
|
|
{
|
|
|
|
public:
|
2009-10-27 19:51:12 +00:00
|
|
|
virtual ~PluginLibrary() { }
|
2009-06-30 18:51:05 +00:00
|
|
|
|
2009-12-16 20:08:45 +00: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 19:51:12 +00:00
|
|
|
virtual bool HasRequiredFunctions() = 0;
|
2009-06-30 18:51:05 +00:00
|
|
|
|
2011-11-11 00:17:46 +00:00
|
|
|
#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK)
|
2009-10-27 19:51:12 +00: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 20:18:50 +00:00
|
|
|
virtual nsresult NP_GetMIMEDescription(const char** mimeDesc) = 0;
|
2009-10-27 19:51:12 +00:00
|
|
|
virtual nsresult NP_GetValue(void *future, NPPVariable aVariable,
|
|
|
|
void *aValue, NPError* error) = 0;
|
2014-02-10 22:57:01 +00:00
|
|
|
#if defined(XP_WIN) || defined(XP_MACOSX)
|
2009-10-27 19:51:12 +00: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 18:28:52 +00:00
|
|
|
|
2011-02-08 22:16:07 +00:00
|
|
|
virtual nsresult NPP_ClearSiteData(const char* site, uint64_t flags,
|
2015-06-30 22:08:19 +00:00
|
|
|
uint64_t maxAge, nsCOMPtr<nsIClearSiteDataCallback> callback) = 0;
|
|
|
|
virtual nsresult NPP_GetSitesWithData(nsCOMPtr<nsIGetSitesWithDataCallback> callback) = 0;
|
2011-02-08 22:16:07 +00:00
|
|
|
|
2010-09-10 18:28:52 +00:00
|
|
|
virtual nsresult AsyncSetWindow(NPP instance, NPWindow* window) = 0;
|
2012-11-10 15:45:52 +00:00
|
|
|
virtual nsresult GetImageContainer(NPP instance, mozilla::layers::ImageContainer** aContainer) = 0;
|
2011-02-23 05:38:09 +00:00
|
|
|
virtual nsresult GetImageSize(NPP instance, nsIntSize* aSize) = 0;
|
2015-12-02 19:31:16 +00:00
|
|
|
virtual void DidComposite(NPP instance) = 0;
|
2012-08-01 20:34:08 +00:00
|
|
|
virtual bool IsOOP() = 0;
|
2011-06-30 16:46:26 +00:00
|
|
|
#if defined(XP_MACOSX)
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual nsresult IsRemoteDrawingCoreAnimation(NPP instance, bool *aDrawing) = 0;
|
2012-10-16 19:41:21 +00:00
|
|
|
virtual nsresult ContentsScaleFactorChanged(NPP instance, double aContentsScaleFactor) = 0;
|
2011-06-30 16:46:26 +00:00
|
|
|
#endif
|
|
|
|
|
2011-02-16 22:43:31 +00: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;
|
2015-03-17 17:28:32 +00:00
|
|
|
virtual nsresult GetRunID(uint32_t* aRunID) = 0;
|
2015-06-17 22:08:12 +00:00
|
|
|
virtual void SetHasLocalInstance() = 0;
|
2009-06-30 18:51:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2009-10-27 19:51:12 +00:00
|
|
|
#endif // ifndef mozilla_PluginLibrary_h
|