1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/plugins/base/nsIPluginInstanceOwner.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,131 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 +#include "nspluginroot.idl" 1.11 +#include "nsIInputStream.idl" 1.12 + 1.13 +interface nsIDocument; 1.14 + 1.15 +%{C++ 1.16 +#include "npapi.h" 1.17 +#include "mozilla/EventForwards.h" 1.18 +class nsNPAPIPluginInstance; 1.19 + 1.20 +enum nsPluginTagType { 1.21 + nsPluginTagType_Unknown, 1.22 + nsPluginTagType_Embed, 1.23 + nsPluginTagType_Object, 1.24 + nsPluginTagType_Applet 1.25 +}; 1.26 +%} 1.27 + 1.28 +[ptr] native nsNPAPIPluginInstancePtr(nsNPAPIPluginInstance); 1.29 + 1.30 +// Do not make this interface scriptable, because the virtual functions in C++ 1.31 +// blocks will make script call the wrong functions. 1.32 +[uuid(59BE4CA5-3CB0-40E6-A111-9A88C8477610)] 1.33 +interface nsIPluginInstanceOwner : nsISupports 1.34 +{ 1.35 + /** 1.36 + * Let the owner know what its instance is 1.37 + */ 1.38 + void setInstance(in nsNPAPIPluginInstancePtr aInstance); 1.39 + 1.40 + /** 1.41 + * Get the instance associated with this owner. 1.42 + */ 1.43 + nsNPAPIPluginInstancePtr getInstance(); 1.44 + 1.45 + /** 1.46 + * Get a handle to the window structure of the owner. 1.47 + * This pointer cannot be made persistent by the caller. 1.48 + */ 1.49 + void getWindow(in NPWindowStarRef aWindow); 1.50 + 1.51 + /** 1.52 + * Get the display mode for the plugin instance. 1.53 + */ 1.54 + readonly attribute int32_t mode; 1.55 + 1.56 + /** 1.57 + * Create a place for the plugin to live in the owner's 1.58 + * environment. this may or may not create a window 1.59 + * depending on the windowless state of the plugin instance. 1.60 + */ 1.61 + void createWidget(); 1.62 + 1.63 +%{C++ 1.64 + /** 1.65 + * Called when there is a valid target so that the proper 1.66 + * frame can be updated with new content. will not be called 1.67 + * with nullptr aTarget. 1.68 + */ 1.69 + NS_IMETHOD 1.70 + GetURL(const char *aURL, const char *aTarget, 1.71 + nsIInputStream *aPostStream, 1.72 + void *aHeadersData, uint32_t aHeadersDataLen) = 0; 1.73 +%} 1.74 + 1.75 + /** 1.76 + * Show a status message in the host environment. 1.77 + */ 1.78 + void showStatus(in string aStatusMsg); 1.79 + 1.80 +%{C++ 1.81 + NS_IMETHOD ShowStatus(const char16_t *aStatusMsg) = 0; 1.82 +%} 1.83 + 1.84 + /** 1.85 + * Get the associated document. 1.86 + */ 1.87 + readonly attribute nsIDocument document; 1.88 + 1.89 + /** 1.90 + * Invalidate the rectangle 1.91 + */ 1.92 + void invalidateRect(in NPRectPtr aRect); 1.93 + 1.94 + /** 1.95 + * Invalidate the region 1.96 + */ 1.97 + void invalidateRegion(in NPRegion aRegion); 1.98 + 1.99 + /** 1.100 + * Have the plugin recomposited. 1.101 + */ 1.102 + void redrawPlugin(); 1.103 + 1.104 + /** 1.105 + * Get NetscapeWindow, corresponds to NPNVnetscapeWindow 1.106 + */ 1.107 + void getNetscapeWindow(in voidPtr aValue); 1.108 + 1.109 + /** 1.110 + * Show native context menu 1.111 + */ 1.112 +%{C++ 1.113 + virtual NPError ShowNativeContextMenu(NPMenu* menu, void* event) = 0; 1.114 + virtual NPBool ConvertPoint(double sourceX, double sourceY, NPCoordinateSpace sourceSpace, 1.115 + double *destX, double *destY, NPCoordinateSpace destSpace) = 0; 1.116 + virtual NPError InitAsyncSurface(NPSize *size, NPImageFormat format, 1.117 + void *initData, NPAsyncSurface *surface) = 0; 1.118 + virtual NPError FinalizeAsyncSurface(NPAsyncSurface *surface) = 0; 1.119 + virtual void SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed) = 0; 1.120 +%} 1.121 + 1.122 + void setEventModel(in int32_t eventModel); 1.123 + 1.124 + /** 1.125 + * Call NPP_SetWindow on the plugin. 1.126 + */ 1.127 + void callSetWindow(); 1.128 + 1.129 + /** 1.130 + * Get the contents scale factor for the screen the plugin is 1.131 + * drawn on. 1.132 + */ 1.133 + double getContentsScaleFactor(); 1.134 +};