1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/public/nsIObjectLoadingContent.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,191 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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 + 1.11 +interface nsIRequest; 1.12 +interface nsIFrame; 1.13 +interface nsIObjectFrame; 1.14 +interface nsIPluginTag; 1.15 +interface nsIDOMElement; 1.16 +interface nsIDOMClientRect; 1.17 +interface nsIURI; 1.18 + 1.19 +%{C++ 1.20 +class nsNPAPIPluginInstance; 1.21 +%} 1.22 +[ptr] native nsNPAPIPluginInstancePtr(nsNPAPIPluginInstance); 1.23 + 1.24 +/** 1.25 + * This interface represents a content node that loads objects. 1.26 + * 1.27 + * Please make sure to update the MozObjectLoadingContent WebIDL 1.28 + * interface to mirror this interface when changing it. 1.29 + */ 1.30 + 1.31 +[scriptable, uuid(16c14177-52eb-49d3-9842-a1a0b92be11a)] 1.32 +interface nsIObjectLoadingContent : nsISupports 1.33 +{ 1.34 + /** 1.35 + * See notes in nsObjectLoadingContent.h 1.36 + */ 1.37 + const unsigned long TYPE_LOADING = 0; 1.38 + const unsigned long TYPE_IMAGE = 1; 1.39 + const unsigned long TYPE_PLUGIN = 2; 1.40 + const unsigned long TYPE_DOCUMENT = 3; 1.41 + const unsigned long TYPE_NULL = 4; 1.42 + 1.43 + const unsigned long PLUGIN_ACTIVE = 0xFF; 1.44 + 1.45 + // The content type is not supported (e.g. plugin not installed) 1.46 + const unsigned long PLUGIN_UNSUPPORTED = 0; 1.47 + // Showing alternate content 1.48 + const unsigned long PLUGIN_ALTERNATE = 1; 1.49 + // The plugin exists, but is disabled 1.50 + const unsigned long PLUGIN_DISABLED = 2; 1.51 + // The plugin is blocklisted and disabled 1.52 + const unsigned long PLUGIN_BLOCKLISTED = 3; 1.53 + // The plugin is considered outdated, but not disabled 1.54 + const unsigned long PLUGIN_OUTDATED = 4; 1.55 + // The plugin has crashed 1.56 + const unsigned long PLUGIN_CRASHED = 5; 1.57 + // Suppressed by security policy 1.58 + const unsigned long PLUGIN_SUPPRESSED = 6; 1.59 + // Blocked by content policy 1.60 + const unsigned long PLUGIN_USER_DISABLED = 7; 1.61 + /// ** All values >= PLUGIN_CLICK_TO_PLAY are plugin placeholder types that 1.62 + /// would be replaced by a real plugin if activated (playPlugin()) 1.63 + /// ** Furthermore, values >= PLUGIN_CLICK_TO_PLAY and 1.64 + /// <= PLUGIN_VULNERABLE_NO_UPDATE are click-to-play types. 1.65 + // The plugin is disabled until the user clicks on it 1.66 + const unsigned long PLUGIN_CLICK_TO_PLAY = 8; 1.67 + // The plugin is vulnerable (update available) 1.68 + const unsigned long PLUGIN_VULNERABLE_UPDATABLE = 9; 1.69 + // The plugin is vulnerable (no update available) 1.70 + const unsigned long PLUGIN_VULNERABLE_NO_UPDATE = 10; 1.71 + // The plugin is in play preview mode 1.72 + const unsigned long PLUGIN_PLAY_PREVIEW = 11; 1.73 + 1.74 + /** 1.75 + * The actual mime type (the one we got back from the network 1.76 + * request) for the element. 1.77 + */ 1.78 + readonly attribute ACString actualType; 1.79 + 1.80 + /** 1.81 + * Gets the type of the content that's currently loaded. See 1.82 + * the constants above for the list of possible values. 1.83 + */ 1.84 + readonly attribute unsigned long displayedType; 1.85 + 1.86 + /** 1.87 + * Gets the content type that corresponds to the give MIME type. See the 1.88 + * constants above for the list of possible values. If nothing else fits, 1.89 + * TYPE_NULL will be returned. 1.90 + */ 1.91 + unsigned long getContentTypeForMIMEType(in AUTF8String aMimeType); 1.92 + 1.93 + /** 1.94 + * Returns the base URI of the object as seen by plugins. This differs from 1.95 + * the normal codebase in that it takes <param> tags and plugin-specific 1.96 + * quirks into account. 1.97 + */ 1.98 + [noscript] readonly attribute nsIURI baseURI; 1.99 + 1.100 + /** 1.101 + * Returns the plugin instance if it has already been instantiated. This 1.102 + * will never instantiate the plugin and so is safe to call even when 1.103 + * content script must not execute. 1.104 + */ 1.105 + [noscript] readonly attribute nsNPAPIPluginInstancePtr pluginInstance; 1.106 + 1.107 + /** 1.108 + * Tells the content about an associated object frame. 1.109 + * This can be called multiple times for different frames. 1.110 + * 1.111 + * This is noscript because this is an internal method that will go away, and 1.112 + * because nsIObjectFrame is unscriptable. 1.113 + */ 1.114 + [noscript] void hasNewFrame(in nsIObjectFrame aFrame); 1.115 + 1.116 + /** 1.117 + * If this object is in going to be printed, this method 1.118 + * returns the nsIObjectFrame object which should be used when 1.119 + * printing the plugin. The returned nsIFrame is in the original document, 1.120 + * not in the static clone. 1.121 + */ 1.122 + [noscript] nsIFrame getPrintFrame(); 1.123 + 1.124 + /* 1.125 + * Notifications from pluginhost that our instance crashed or was destroyed. 1.126 + */ 1.127 + [noscript] void pluginDestroyed(); 1.128 + [noscript] void pluginCrashed(in nsIPluginTag pluginTag, 1.129 + in AString pluginDumpID, 1.130 + in AString browserDumpID, 1.131 + in boolean submittedCrashReport); 1.132 + 1.133 + /** 1.134 + * This method will play a plugin that has been stopped by the 1.135 + * click-to-play plugins or play-preview features. 1.136 + */ 1.137 + void playPlugin(); 1.138 + 1.139 + /** 1.140 + * Forces a re-evaluation and reload of the tag, optionally invalidating its 1.141 + * click-to-play state. This can be used when the MIME type that provides a 1.142 + * type has changed, for instance, to force the tag to re-evalulate the 1.143 + * handler to use. 1.144 + */ 1.145 + void reload(in boolean aClearActivation); 1.146 + 1.147 + /** 1.148 + * This attribute will return true if the current content type has been 1.149 + * activated, either explicitly or by passing checks that would have it be 1.150 + * click-to-play or play-preview. 1.151 + */ 1.152 + readonly attribute boolean activated; 1.153 + 1.154 + [noscript] void stopPluginInstance(); 1.155 + 1.156 + [noscript] void syncStartPluginInstance(); 1.157 + [noscript] void asyncStartPluginInstance(); 1.158 + 1.159 + /** 1.160 + * Puts the tag in the "waiting on a channel" state and adopts this 1.161 + * channel. This does not override the normal logic of examining attributes 1.162 + * and the channel type, so the load may cancel this channel if it decides not 1.163 + * to use one. 1.164 + * 1.165 + * This assumes: 1.166 + * - This tag has not begun loading yet 1.167 + * - This channel has not yet hit OnStartRequest 1.168 + * - The caller will continue to pass channel events to us as a listener 1.169 + */ 1.170 + [noscript] void initializeFromChannel(in nsIRequest request); 1.171 + 1.172 + /** 1.173 + * The URL of the data/src loaded in the object. This may be null (i.e. 1.174 + * an <embed> with no src). 1.175 + */ 1.176 + readonly attribute nsIURI srcURI; 1.177 + 1.178 + /** 1.179 + * The plugin's current state of fallback content. This property 1.180 + * only makes sense if the plugin is not activated. 1.181 + */ 1.182 + readonly attribute unsigned long pluginFallbackType; 1.183 + 1.184 + /** 1.185 + * If this object currently owns a running plugin, regardless of whether or 1.186 + * not one is pending spawn/despawn. 1.187 + */ 1.188 + readonly attribute bool hasRunningPlugin; 1.189 + 1.190 + /** 1.191 + * This method will disable the play-preview plugin state. 1.192 + */ 1.193 + void cancelPlayPreview(); 1.194 +};