2005-09-21 19:14:30 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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/. */
|
2005-09-21 19:14:30 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2012-12-11 00:35:05 +00:00
|
|
|
interface nsIRequest;
|
2009-12-11 04:02:13 +00:00
|
|
|
interface nsIFrame;
|
2005-09-21 19:14:30 +00:00
|
|
|
interface nsIObjectFrame;
|
2010-03-17 05:10:08 +00:00
|
|
|
interface nsIPluginTag;
|
2009-11-20 16:26:10 +00:00
|
|
|
interface nsIDOMElement;
|
|
|
|
interface nsIDOMClientRect;
|
2012-02-27 21:58:00 +00:00
|
|
|
interface nsIURI;
|
2005-09-21 19:14:30 +00:00
|
|
|
|
2011-05-18 01:48:34 +00:00
|
|
|
%{C++
|
2013-08-27 05:05:29 +00:00
|
|
|
class nsNPAPIPluginInstance;
|
2011-05-18 01:48:34 +00:00
|
|
|
%}
|
|
|
|
[ptr] native nsNPAPIPluginInstancePtr(nsNPAPIPluginInstance);
|
|
|
|
|
2005-09-21 19:14:30 +00:00
|
|
|
/**
|
|
|
|
* This interface represents a content node that loads objects.
|
2013-03-04 19:08:24 +00:00
|
|
|
*
|
|
|
|
* Please make sure to update the MozObjectLoadingContent WebIDL
|
|
|
|
* interface to mirror this interface when changing it.
|
2005-09-21 19:14:30 +00:00
|
|
|
*/
|
2012-06-19 23:25:56 +00:00
|
|
|
|
2013-06-18 21:35:26 +00:00
|
|
|
[scriptable, uuid(16c14177-52eb-49d3-9842-a1a0b92be11a)]
|
2005-09-21 19:14:30 +00:00
|
|
|
interface nsIObjectLoadingContent : nsISupports
|
|
|
|
{
|
2012-07-05 21:07:46 +00:00
|
|
|
/**
|
|
|
|
* See notes in nsObjectLoadingContent.h
|
|
|
|
*/
|
2005-09-21 19:14:30 +00:00
|
|
|
const unsigned long TYPE_LOADING = 0;
|
|
|
|
const unsigned long TYPE_IMAGE = 1;
|
|
|
|
const unsigned long TYPE_PLUGIN = 2;
|
|
|
|
const unsigned long TYPE_DOCUMENT = 3;
|
|
|
|
const unsigned long TYPE_NULL = 4;
|
|
|
|
|
2013-06-24 12:51:07 +00:00
|
|
|
const unsigned long PLUGIN_ACTIVE = 0xFF;
|
|
|
|
|
2012-08-20 22:00:51 +00:00
|
|
|
// The content type is not supported (e.g. plugin not installed)
|
|
|
|
const unsigned long PLUGIN_UNSUPPORTED = 0;
|
|
|
|
// Showing alternate content
|
|
|
|
const unsigned long PLUGIN_ALTERNATE = 1;
|
|
|
|
// The plugin exists, but is disabled
|
|
|
|
const unsigned long PLUGIN_DISABLED = 2;
|
|
|
|
// The plugin is blocklisted and disabled
|
|
|
|
const unsigned long PLUGIN_BLOCKLISTED = 3;
|
|
|
|
// The plugin is considered outdated, but not disabled
|
|
|
|
const unsigned long PLUGIN_OUTDATED = 4;
|
|
|
|
// The plugin has crashed
|
|
|
|
const unsigned long PLUGIN_CRASHED = 5;
|
|
|
|
// Suppressed by security policy
|
|
|
|
const unsigned long PLUGIN_SUPPRESSED = 6;
|
|
|
|
// Blocked by content policy
|
|
|
|
const unsigned long PLUGIN_USER_DISABLED = 7;
|
2012-10-04 19:57:24 +00:00
|
|
|
/// ** All values >= PLUGIN_CLICK_TO_PLAY are plugin placeholder types that
|
|
|
|
/// would be replaced by a real plugin if activated (playPlugin())
|
2012-12-05 21:00:52 +00:00
|
|
|
/// ** Furthermore, values >= PLUGIN_CLICK_TO_PLAY and
|
|
|
|
/// <= PLUGIN_VULNERABLE_NO_UPDATE are click-to-play types.
|
2012-08-20 22:00:51 +00:00
|
|
|
// The plugin is disabled until the user clicks on it
|
|
|
|
const unsigned long PLUGIN_CLICK_TO_PLAY = 8;
|
|
|
|
// The plugin is vulnerable (update available)
|
|
|
|
const unsigned long PLUGIN_VULNERABLE_UPDATABLE = 9;
|
|
|
|
// The plugin is vulnerable (no update available)
|
|
|
|
const unsigned long PLUGIN_VULNERABLE_NO_UPDATE = 10;
|
2012-08-25 21:18:44 +00:00
|
|
|
// The plugin is in play preview mode
|
|
|
|
const unsigned long PLUGIN_PLAY_PREVIEW = 11;
|
2012-08-20 22:00:51 +00:00
|
|
|
|
2005-09-21 19:14:30 +00:00
|
|
|
/**
|
|
|
|
* The actual mime type (the one we got back from the network
|
|
|
|
* request) for the element.
|
|
|
|
*/
|
|
|
|
readonly attribute ACString actualType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the type of the content that's currently loaded. See
|
|
|
|
* the constants above for the list of possible values.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long displayedType;
|
|
|
|
|
2006-04-24 19:56:18 +00:00
|
|
|
/**
|
|
|
|
* Gets the content type that corresponds to the give MIME type. See the
|
|
|
|
* constants above for the list of possible values. If nothing else fits,
|
|
|
|
* TYPE_NULL will be returned.
|
|
|
|
*/
|
|
|
|
unsigned long getContentTypeForMIMEType(in AUTF8String aMimeType);
|
|
|
|
|
2013-03-22 01:02:23 +00:00
|
|
|
/**
|
|
|
|
* Returns the base URI of the object as seen by plugins. This differs from
|
|
|
|
* the normal codebase in that it takes <param> tags and plugin-specific
|
|
|
|
* quirks into account.
|
|
|
|
*/
|
|
|
|
[noscript] readonly attribute nsIURI baseURI;
|
|
|
|
|
2008-03-14 23:08:57 +00:00
|
|
|
/**
|
|
|
|
* Returns the plugin instance if it has already been instantiated. This
|
|
|
|
* will never instantiate the plugin and so is safe to call even when
|
|
|
|
* content script must not execute.
|
|
|
|
*/
|
2011-05-18 01:48:34 +00:00
|
|
|
[noscript] readonly attribute nsNPAPIPluginInstancePtr pluginInstance;
|
2008-03-14 23:08:57 +00:00
|
|
|
|
2005-09-21 19:14:30 +00:00
|
|
|
/**
|
|
|
|
* Tells the content about an associated object frame.
|
|
|
|
* This can be called multiple times for different frames.
|
|
|
|
*
|
|
|
|
* This is noscript because this is an internal method that will go away, and
|
|
|
|
* because nsIObjectFrame is unscriptable.
|
|
|
|
*/
|
|
|
|
[noscript] void hasNewFrame(in nsIObjectFrame aFrame);
|
2009-11-20 16:26:10 +00:00
|
|
|
|
2009-12-11 04:02:13 +00:00
|
|
|
/**
|
|
|
|
* If this object is in going to be printed, this method
|
|
|
|
* returns the nsIObjectFrame object which should be used when
|
|
|
|
* printing the plugin. The returned nsIFrame is in the original document,
|
|
|
|
* not in the static clone.
|
|
|
|
*/
|
|
|
|
[noscript] nsIFrame getPrintFrame();
|
2010-01-13 16:42:41 +00:00
|
|
|
|
2013-03-19 22:38:25 +00:00
|
|
|
/*
|
|
|
|
* Notifications from pluginhost that our instance crashed or was destroyed.
|
|
|
|
*/
|
|
|
|
[noscript] void pluginDestroyed();
|
2010-03-17 05:10:08 +00:00
|
|
|
[noscript] void pluginCrashed(in nsIPluginTag pluginTag,
|
2010-03-24 21:22:04 +00:00
|
|
|
in AString pluginDumpID,
|
|
|
|
in AString browserDumpID,
|
2010-02-10 01:05:31 +00:00
|
|
|
in boolean submittedCrashReport);
|
2011-12-10 17:23:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This method will play a plugin that has been stopped by the
|
2012-10-04 19:57:24 +00:00
|
|
|
* click-to-play plugins or play-preview features.
|
2011-12-10 17:23:05 +00:00
|
|
|
*/
|
|
|
|
void playPlugin();
|
2012-01-31 21:55:54 +00:00
|
|
|
|
2013-06-18 21:35:26 +00:00
|
|
|
/**
|
|
|
|
* Forces a re-evaluation and reload of the tag, optionally invalidating its
|
|
|
|
* click-to-play state. This can be used when the MIME type that provides a
|
|
|
|
* type has changed, for instance, to force the tag to re-evalulate the
|
|
|
|
* handler to use.
|
|
|
|
*/
|
|
|
|
void reload(in boolean aClearActivation);
|
|
|
|
|
2012-03-28 15:53:56 +00:00
|
|
|
/**
|
2012-10-04 19:57:24 +00:00
|
|
|
* This attribute will return true if the current content type has been
|
|
|
|
* activated, either explicitly or by passing checks that would have it be
|
|
|
|
* click-to-play or play-preview.
|
2012-03-28 15:53:56 +00:00
|
|
|
*/
|
|
|
|
readonly attribute boolean activated;
|
|
|
|
|
2012-01-31 21:55:54 +00:00
|
|
|
[noscript] void stopPluginInstance();
|
|
|
|
|
|
|
|
[noscript] void syncStartPluginInstance();
|
|
|
|
[noscript] void asyncStartPluginInstance();
|
2012-03-12 16:48:27 +00:00
|
|
|
|
2012-12-11 00:35:05 +00:00
|
|
|
/**
|
|
|
|
* Puts the tag in the "waiting on a channel" state and adopts this
|
|
|
|
* channel. This does not override the normal logic of examining attributes
|
|
|
|
* and the channel type, so the load may cancel this channel if it decides not
|
|
|
|
* to use one.
|
|
|
|
*
|
|
|
|
* This assumes:
|
|
|
|
* - This tag has not begun loading yet
|
|
|
|
* - This channel has not yet hit OnStartRequest
|
|
|
|
* - The caller will continue to pass channel events to us as a listener
|
|
|
|
*/
|
|
|
|
[noscript] void initializeFromChannel(in nsIRequest request);
|
|
|
|
|
2012-03-12 16:48:27 +00:00
|
|
|
/**
|
|
|
|
* The URL of the data/src loaded in the object. This may be null (i.e.
|
|
|
|
* an <embed> with no src).
|
|
|
|
*/
|
|
|
|
readonly attribute nsIURI srcURI;
|
2012-08-20 22:00:51 +00:00
|
|
|
|
2013-06-24 12:51:07 +00:00
|
|
|
/**
|
|
|
|
* The plugin's current state of fallback content. This property
|
|
|
|
* only makes sense if the plugin is not activated.
|
|
|
|
*/
|
2012-08-20 22:00:51 +00:00
|
|
|
readonly attribute unsigned long pluginFallbackType;
|
2012-08-25 21:18:44 +00:00
|
|
|
|
2013-03-08 00:11:27 +00:00
|
|
|
/**
|
|
|
|
* If this object currently owns a running plugin, regardless of whether or
|
|
|
|
* not one is pending spawn/despawn.
|
|
|
|
*/
|
|
|
|
readonly attribute bool hasRunningPlugin;
|
|
|
|
|
2012-08-25 21:18:44 +00:00
|
|
|
/**
|
|
|
|
* This method will disable the play-preview plugin state.
|
|
|
|
*/
|
|
|
|
void cancelPlayPreview();
|
2005-09-21 19:14:30 +00:00
|
|
|
};
|