2002-10-03 21:05:30 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
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/. */
|
2002-10-03 21:05:30 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
#include "nspluginroot.idl"
|
2009-12-27 20:26:00 +00:00
|
|
|
#include "nsIInputStream.idl"
|
2002-10-03 21:05:30 +00:00
|
|
|
|
|
|
|
interface nsIDocument;
|
|
|
|
|
2009-08-27 00:29:47 +00:00
|
|
|
%{C++
|
|
|
|
#include "npapi.h"
|
2013-09-24 10:04:14 +00:00
|
|
|
#include "mozilla/EventForwards.h"
|
2013-08-27 05:05:29 +00:00
|
|
|
class nsNPAPIPluginInstance;
|
2013-12-03 08:36:13 +00:00
|
|
|
|
|
|
|
enum nsPluginTagType {
|
|
|
|
nsPluginTagType_Unknown,
|
|
|
|
nsPluginTagType_Embed,
|
|
|
|
nsPluginTagType_Object,
|
|
|
|
nsPluginTagType_Applet
|
|
|
|
};
|
2009-08-27 00:29:47 +00:00
|
|
|
%}
|
|
|
|
|
2011-05-18 01:48:34 +00:00
|
|
|
[ptr] native nsNPAPIPluginInstancePtr(nsNPAPIPluginInstance);
|
2002-10-03 21:05:30 +00:00
|
|
|
|
2012-02-10 10:04:45 +00:00
|
|
|
// Do not make this interface scriptable, because the virtual functions in C++
|
|
|
|
// blocks will make script call the wrong functions.
|
2015-12-02 19:31:16 +00:00
|
|
|
[uuid(7d65452e-c167-4cba-a0e3-ddc61bdde8c3)]
|
2002-10-03 21:05:30 +00:00
|
|
|
interface nsIPluginInstanceOwner : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
2009-02-25 00:28:35 +00:00
|
|
|
* Let the owner know what its instance is
|
2002-10-03 21:05:30 +00:00
|
|
|
*/
|
2011-05-18 01:48:34 +00:00
|
|
|
void setInstance(in nsNPAPIPluginInstancePtr aInstance);
|
2002-10-03 21:05:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the instance associated with this owner.
|
|
|
|
*/
|
2011-05-18 01:48:34 +00:00
|
|
|
nsNPAPIPluginInstancePtr getInstance();
|
2010-02-24 02:58:27 +00:00
|
|
|
|
2002-10-03 21:05:30 +00:00
|
|
|
/**
|
|
|
|
* Get a handle to the window structure of the owner.
|
2005-11-25 21:57:13 +00:00
|
|
|
* This pointer cannot be made persistent by the caller.
|
2002-10-03 21:05:30 +00:00
|
|
|
*/
|
2009-09-17 01:30:26 +00:00
|
|
|
void getWindow(in NPWindowStarRef aWindow);
|
2002-10-03 21:05:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the display mode for the plugin instance.
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
readonly attribute int32_t mode;
|
2002-10-03 21:05:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a place for the plugin to live in the owner's
|
|
|
|
* environment. this may or may not create a window
|
|
|
|
* depending on the windowless state of the plugin instance.
|
|
|
|
*/
|
|
|
|
void createWidget();
|
|
|
|
|
|
|
|
%{C++
|
|
|
|
/**
|
|
|
|
* Called when there is a valid target so that the proper
|
|
|
|
* frame can be updated with new content. will not be called
|
2012-07-30 14:20:58 +00:00
|
|
|
* with nullptr aTarget.
|
2002-10-03 21:05:30 +00:00
|
|
|
*/
|
|
|
|
NS_IMETHOD
|
|
|
|
GetURL(const char *aURL, const char *aTarget,
|
2009-12-27 20:26:00 +00:00
|
|
|
nsIInputStream *aPostStream,
|
2015-08-05 03:06:03 +00:00
|
|
|
void *aHeadersData, uint32_t aHeadersDataLen,
|
|
|
|
bool aDoCheckLoadURIChecks) = 0;
|
2002-10-03 21:05:30 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the associated document.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIDocument document;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invalidate the rectangle
|
|
|
|
*/
|
2009-09-17 01:30:26 +00:00
|
|
|
void invalidateRect(in NPRectPtr aRect);
|
2002-10-03 21:05:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Invalidate the region
|
|
|
|
*/
|
2009-09-17 01:30:26 +00:00
|
|
|
void invalidateRegion(in NPRegion aRegion);
|
2002-10-03 21:05:30 +00:00
|
|
|
|
2012-02-16 03:30:22 +00:00
|
|
|
/**
|
|
|
|
* Have the plugin recomposited.
|
|
|
|
*/
|
|
|
|
void redrawPlugin();
|
|
|
|
|
2002-10-03 21:05:30 +00:00
|
|
|
/**
|
2009-06-29 18:53:52 +00:00
|
|
|
* Get NetscapeWindow, corresponds to NPNVnetscapeWindow
|
2002-10-03 21:05:30 +00:00
|
|
|
*/
|
2009-06-29 18:53:52 +00:00
|
|
|
void getNetscapeWindow(in voidPtr aValue);
|
2009-08-27 00:29:47 +00:00
|
|
|
|
|
|
|
/**
|
2015-06-15 05:11:06 +00:00
|
|
|
* Convert between plugin, window, and screen coordinate spaces.
|
2009-08-27 00:29:47 +00:00
|
|
|
*/
|
|
|
|
%{C++
|
|
|
|
virtual NPBool ConvertPoint(double sourceX, double sourceY, NPCoordinateSpace sourceSpace,
|
|
|
|
double *destX, double *destY, NPCoordinateSpace destSpace) = 0;
|
2015-12-02 19:31:16 +00:00
|
|
|
virtual NPError InitAsyncSurface(NPSize *size, NPImageFormat format,
|
|
|
|
void *initData, NPAsyncSurface *surface) = 0;
|
|
|
|
virtual NPError FinalizeAsyncSurface(NPAsyncSurface *surface) = 0;
|
|
|
|
virtual void SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed) = 0;
|
2009-08-27 00:29:47 +00:00
|
|
|
%}
|
2009-11-10 03:58:48 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
void setEventModel(in int32_t eventModel);
|
2009-12-15 20:44:52 +00:00
|
|
|
|
2010-12-07 21:18:50 +00:00
|
|
|
/**
|
|
|
|
* Call NPP_SetWindow on the plugin.
|
|
|
|
*/
|
2012-01-31 21:55:54 +00:00
|
|
|
void callSetWindow();
|
2012-10-02 19:48:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the contents scale factor for the screen the plugin is
|
|
|
|
* drawn on.
|
|
|
|
*/
|
|
|
|
double getContentsScaleFactor();
|
2010-12-07 21:18:50 +00:00
|
|
|
};
|