dom/plugins/base/nsIPluginInstanceOwner.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #include "nsISupports.idl"
     7 #include "nspluginroot.idl"
     8 #include "nsIInputStream.idl"
    10 interface nsIDocument;
    12 %{C++
    13 #include "npapi.h"
    14 #include "mozilla/EventForwards.h"
    15 class nsNPAPIPluginInstance;
    17 enum nsPluginTagType {
    18   nsPluginTagType_Unknown,
    19   nsPluginTagType_Embed,
    20   nsPluginTagType_Object,
    21   nsPluginTagType_Applet
    22 };
    23 %}
    25 [ptr] native nsNPAPIPluginInstancePtr(nsNPAPIPluginInstance);
    27 // Do not make this interface scriptable, because the virtual functions in C++
    28 // blocks will make script call the wrong functions.
    29 [uuid(59BE4CA5-3CB0-40E6-A111-9A88C8477610)]
    30 interface nsIPluginInstanceOwner : nsISupports
    31 {
    32   /**
    33    * Let the owner know what its instance is
    34    */
    35   void setInstance(in nsNPAPIPluginInstancePtr aInstance);
    37   /**
    38    * Get the instance associated with this owner.
    39    */
    40   nsNPAPIPluginInstancePtr getInstance();
    42   /**
    43    * Get a handle to the window structure of the owner.
    44    * This pointer cannot be made persistent by the caller.
    45    */
    46   void getWindow(in NPWindowStarRef aWindow);
    48   /**
    49    * Get the display mode for the plugin instance.
    50    */
    51   readonly attribute int32_t mode;
    53   /**
    54    * Create a place for the plugin to live in the owner's
    55    * environment. this may or may not create a window
    56    * depending on the windowless state of the plugin instance.
    57    */
    58   void createWidget();
    60 %{C++
    61   /**
    62    * Called when there is a valid target so that the proper
    63    * frame can be updated with new content. will not be called
    64    * with nullptr aTarget.
    65    */
    66   NS_IMETHOD
    67   GetURL(const char *aURL, const char *aTarget, 
    68          nsIInputStream *aPostStream,
    69          void *aHeadersData, uint32_t aHeadersDataLen) = 0;
    70 %}
    72   /**
    73    * Show a status message in the host environment.
    74    */
    75   void showStatus(in string aStatusMsg);
    77 %{C++
    78   NS_IMETHOD ShowStatus(const char16_t *aStatusMsg) = 0;
    79 %}
    81   /**
    82    * Get the associated document.
    83    */
    84   readonly attribute nsIDocument document;
    86   /**
    87    * Invalidate the rectangle
    88    */
    89   void invalidateRect(in NPRectPtr aRect);
    91   /**
    92    * Invalidate the region
    93    */
    94   void invalidateRegion(in NPRegion aRegion);
    96   /**
    97    * Have the plugin recomposited.
    98    */
    99   void redrawPlugin();
   101   /**
   102    * Get NetscapeWindow, corresponds to NPNVnetscapeWindow
   103    */
   104   void getNetscapeWindow(in voidPtr aValue);
   106   /**
   107    * Show native context menu
   108    */
   109 %{C++
   110   virtual NPError ShowNativeContextMenu(NPMenu* menu, void* event) = 0;
   111   virtual NPBool  ConvertPoint(double sourceX, double sourceY, NPCoordinateSpace sourceSpace,
   112                                double *destX, double *destY, NPCoordinateSpace destSpace) = 0;
   113   virtual NPError InitAsyncSurface(NPSize *size, NPImageFormat format,
   114                                    void *initData, NPAsyncSurface *surface) = 0;
   115   virtual NPError FinalizeAsyncSurface(NPAsyncSurface *surface) = 0;
   116   virtual void SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed) = 0;
   117 %}
   119   void setEventModel(in int32_t eventModel);
   121   /**
   122    * Call NPP_SetWindow on the plugin.
   123    */
   124   void callSetWindow();
   126   /**
   127    * Get the contents scale factor for the screen the plugin is
   128    * drawn on.
   129    */
   130   double getContentsScaleFactor();
   131 };

mercurial