michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: #include "nspluginroot.idl" michael@0: #include "nsIInputStream.idl" michael@0: michael@0: interface nsIDocument; michael@0: michael@0: %{C++ michael@0: #include "npapi.h" michael@0: #include "mozilla/EventForwards.h" michael@0: class nsNPAPIPluginInstance; michael@0: michael@0: enum nsPluginTagType { michael@0: nsPluginTagType_Unknown, michael@0: nsPluginTagType_Embed, michael@0: nsPluginTagType_Object, michael@0: nsPluginTagType_Applet michael@0: }; michael@0: %} michael@0: michael@0: [ptr] native nsNPAPIPluginInstancePtr(nsNPAPIPluginInstance); michael@0: michael@0: // Do not make this interface scriptable, because the virtual functions in C++ michael@0: // blocks will make script call the wrong functions. michael@0: [uuid(59BE4CA5-3CB0-40E6-A111-9A88C8477610)] michael@0: interface nsIPluginInstanceOwner : nsISupports michael@0: { michael@0: /** michael@0: * Let the owner know what its instance is michael@0: */ michael@0: void setInstance(in nsNPAPIPluginInstancePtr aInstance); michael@0: michael@0: /** michael@0: * Get the instance associated with this owner. michael@0: */ michael@0: nsNPAPIPluginInstancePtr getInstance(); michael@0: michael@0: /** michael@0: * Get a handle to the window structure of the owner. michael@0: * This pointer cannot be made persistent by the caller. michael@0: */ michael@0: void getWindow(in NPWindowStarRef aWindow); michael@0: michael@0: /** michael@0: * Get the display mode for the plugin instance. michael@0: */ michael@0: readonly attribute int32_t mode; michael@0: michael@0: /** michael@0: * Create a place for the plugin to live in the owner's michael@0: * environment. this may or may not create a window michael@0: * depending on the windowless state of the plugin instance. michael@0: */ michael@0: void createWidget(); michael@0: michael@0: %{C++ michael@0: /** michael@0: * Called when there is a valid target so that the proper michael@0: * frame can be updated with new content. will not be called michael@0: * with nullptr aTarget. michael@0: */ michael@0: NS_IMETHOD michael@0: GetURL(const char *aURL, const char *aTarget, michael@0: nsIInputStream *aPostStream, michael@0: void *aHeadersData, uint32_t aHeadersDataLen) = 0; michael@0: %} michael@0: michael@0: /** michael@0: * Show a status message in the host environment. michael@0: */ michael@0: void showStatus(in string aStatusMsg); michael@0: michael@0: %{C++ michael@0: NS_IMETHOD ShowStatus(const char16_t *aStatusMsg) = 0; michael@0: %} michael@0: michael@0: /** michael@0: * Get the associated document. michael@0: */ michael@0: readonly attribute nsIDocument document; michael@0: michael@0: /** michael@0: * Invalidate the rectangle michael@0: */ michael@0: void invalidateRect(in NPRectPtr aRect); michael@0: michael@0: /** michael@0: * Invalidate the region michael@0: */ michael@0: void invalidateRegion(in NPRegion aRegion); michael@0: michael@0: /** michael@0: * Have the plugin recomposited. michael@0: */ michael@0: void redrawPlugin(); michael@0: michael@0: /** michael@0: * Get NetscapeWindow, corresponds to NPNVnetscapeWindow michael@0: */ michael@0: void getNetscapeWindow(in voidPtr aValue); michael@0: michael@0: /** michael@0: * Show native context menu michael@0: */ michael@0: %{C++ michael@0: virtual NPError ShowNativeContextMenu(NPMenu* menu, void* event) = 0; michael@0: virtual NPBool ConvertPoint(double sourceX, double sourceY, NPCoordinateSpace sourceSpace, michael@0: double *destX, double *destY, NPCoordinateSpace destSpace) = 0; michael@0: virtual NPError InitAsyncSurface(NPSize *size, NPImageFormat format, michael@0: void *initData, NPAsyncSurface *surface) = 0; michael@0: virtual NPError FinalizeAsyncSurface(NPAsyncSurface *surface) = 0; michael@0: virtual void SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed) = 0; michael@0: %} michael@0: michael@0: void setEventModel(in int32_t eventModel); michael@0: michael@0: /** michael@0: * Call NPP_SetWindow on the plugin. michael@0: */ michael@0: void callSetWindow(); michael@0: michael@0: /** michael@0: * Get the contents scale factor for the screen the plugin is michael@0: * drawn on. michael@0: */ michael@0: double getContentsScaleFactor(); michael@0: };