2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
#include "nspluginroot.idl"
|
2009-12-27 12:26:00 -08:00
|
|
|
#include "nsIInputStream.idl"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
interface nsIDocument;
|
|
|
|
|
2009-08-26 17:29:47 -07:00
|
|
|
%{C++
|
|
|
|
#include "npapi.h"
|
2011-05-17 18:48:34 -07:00
|
|
|
#include "nsNPAPIPluginInstance.h"
|
2009-08-26 17:29:47 -07:00
|
|
|
class nsPluginEvent;
|
|
|
|
%}
|
|
|
|
|
2011-05-17 18:48:34 -07:00
|
|
|
[ptr] native nsNPAPIPluginInstancePtr(nsNPAPIPluginInstance);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-02-10 02:04:45 -08:00
|
|
|
// Do not make this interface scriptable, because the virtual functions in C++
|
|
|
|
// blocks will make script call the wrong functions.
|
|
|
|
[uuid(23bd0a76-a5dc-4a1d-be76-13d7a0dfd9ff)]
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsIPluginInstanceOwner : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
2009-02-24 16:28:35 -08:00
|
|
|
* Let the owner know what its instance is
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
2011-05-17 18:48:34 -07:00
|
|
|
void setInstance(in nsNPAPIPluginInstancePtr aInstance);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the instance associated with this owner.
|
|
|
|
*/
|
2011-05-17 18:48:34 -07:00
|
|
|
nsNPAPIPluginInstancePtr getInstance();
|
2010-02-23 18:58:27 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/**
|
|
|
|
* Get a handle to the window structure of the owner.
|
|
|
|
* This pointer cannot be made persistent by the caller.
|
|
|
|
*/
|
2009-09-16 18:30:26 -07:00
|
|
|
void getWindow(in NPWindowStarRef aWindow);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the display mode for the plugin instance.
|
|
|
|
*/
|
2009-09-16 18:30:26 -07:00
|
|
|
readonly attribute PRInt32 mode;
|
2007-03-22 10:30:00 -07: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
|
|
|
|
* with nsnull aTarget.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD
|
|
|
|
GetURL(const char *aURL, const char *aTarget,
|
2009-12-27 12:26:00 -08:00
|
|
|
nsIInputStream *aPostStream,
|
|
|
|
void *aHeadersData, PRUint32 aHeadersDataLen) = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
%}
|
2009-08-26 17:29:47 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/**
|
|
|
|
* Show a status message in the host environment.
|
|
|
|
*/
|
|
|
|
void showStatus(in string aStatusMsg);
|
|
|
|
|
|
|
|
%{C++
|
2009-08-26 17:29:47 -07:00
|
|
|
NS_IMETHOD ShowStatus(const PRUnichar *aStatusMsg) = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
%}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the associated document.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIDocument document;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invalidate the rectangle
|
|
|
|
*/
|
2009-09-16 18:30:26 -07:00
|
|
|
void invalidateRect(in NPRectPtr aRect);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Invalidate the region
|
|
|
|
*/
|
2009-09-16 18:30:26 -07:00
|
|
|
void invalidateRegion(in NPRegion aRegion);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-02-15 19:30:22 -08:00
|
|
|
/**
|
|
|
|
* Have the plugin recomposited.
|
|
|
|
*/
|
|
|
|
void redrawPlugin();
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/**
|
2009-06-29 11:53:52 -07:00
|
|
|
* Get NetscapeWindow, corresponds to NPNVnetscapeWindow
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
2009-06-29 11:53:52 -07:00
|
|
|
void getNetscapeWindow(in voidPtr aValue);
|
2009-08-26 17:29:47 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Show native context menu
|
|
|
|
*/
|
|
|
|
%{C++
|
2009-09-16 18:30:26 -07:00
|
|
|
virtual NPError ShowNativeContextMenu(NPMenu* menu, void* event) = 0;
|
2009-08-26 17:29:47 -07:00
|
|
|
virtual NPBool ConvertPoint(double sourceX, double sourceY, NPCoordinateSpace sourceSpace,
|
|
|
|
double *destX, double *destY, NPCoordinateSpace destSpace) = 0;
|
2012-02-15 19:08:41 -08: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-26 17:29:47 -07:00
|
|
|
%}
|
2009-11-09 19:58:48 -08:00
|
|
|
|
|
|
|
void setEventModel(in PRInt32 eventModel);
|
2009-12-15 12:44:52 -08:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
virtual void SendIdleEvent() = 0;
|
|
|
|
%}
|
2010-12-07 13:18:50 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Call NPP_SetWindow on the plugin.
|
|
|
|
*/
|
2012-01-31 13:55:54 -08:00
|
|
|
void callSetWindow();
|
2010-12-07 13:18:50 -08:00
|
|
|
};
|