dom/plugins/base/nsIPluginHost.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/plugins/base/nsIPluginHost.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,120 @@
     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 "nspluginroot.idl"
    1.10 +#include "nsISupports.idl"
    1.11 +#include "nsIPluginTag.idl"
    1.12 +
    1.13 +%{C++
    1.14 +#define MOZ_PLUGIN_HOST_CONTRACTID \
    1.15 +  "@mozilla.org/plugin/host;1"
    1.16 +%}
    1.17 +
    1.18 +[scriptable, uuid(f89e7679-0adf-4a30-bda9-1afe1ee270d6)]
    1.19 +interface nsIPluginPlayPreviewInfo : nsISupports
    1.20 +{
    1.21 +  readonly attribute AUTF8String mimeType;
    1.22 +  readonly attribute boolean     ignoreCTP;
    1.23 +  readonly attribute AUTF8String redirectURL;
    1.24 +};
    1.25 +
    1.26 +[scriptable, uuid(e8fe94f0-b877-46d0-931a-090967fb1e83)]
    1.27 +interface nsIPluginHost : nsISupports
    1.28 +{
    1.29 +  /**
    1.30 +   * Causes the plugins directory to be searched again for new plugin 
    1.31 +   * libraries.
    1.32 +   */
    1.33 +  void reloadPlugins();
    1.34 +
    1.35 +  void getPluginTags([optional] out unsigned long aPluginCount,
    1.36 +    [retval, array, size_is(aPluginCount)] out nsIPluginTag aResults);
    1.37 +
    1.38 +  /*
    1.39 +   * Flags for use with clearSiteData.
    1.40 +   *
    1.41 +   * FLAG_CLEAR_ALL: clear all data associated with a site.
    1.42 +   * FLAG_CLEAR_CACHE: clear cached data that can be retrieved again without
    1.43 +   *                   loss of functionality. To be used out of concern for
    1.44 +   *                   space and not necessarily privacy.
    1.45 +   */
    1.46 +  const uint32_t FLAG_CLEAR_ALL = 0;
    1.47 +  const uint32_t FLAG_CLEAR_CACHE = 1;
    1.48 +
    1.49 +  /*
    1.50 +   * Clear site data for a given plugin.
    1.51 +   *
    1.52 +   * @param plugin: the plugin to clear data for, such as one returned by
    1.53 +   *                nsIPluginHost.getPluginTags.
    1.54 +   * @param domain: the domain to clear data for. If this argument is null,
    1.55 +   *                clear data for all domains. Otherwise, it must be a domain
    1.56 +   *                only (not a complete URI or IRI). The base domain for the
    1.57 +   *                given site will be determined; any data for the base domain
    1.58 +   *                or its subdomains will be cleared.
    1.59 +   * @param flags: a flag value defined above.
    1.60 +   * @param maxAge: the maximum age in seconds of data to clear, inclusive. If
    1.61 +   *                maxAge is 0, no data is cleared; if it is -1, all data is
    1.62 +   *                cleared.
    1.63 +   *
    1.64 +   * @throws NS_ERROR_INVALID_ARG if the domain argument is malformed.
    1.65 +   * @throws NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED if maxAge is a value other
    1.66 +   *         than -1 and the plugin does not support clearing by timerange in
    1.67 +   *         general or for that particular site and/or flag combination.
    1.68 +   */
    1.69 +  void clearSiteData(in nsIPluginTag plugin, in AUTF8String domain,
    1.70 +                     in uint64_t flags, in int64_t maxAge);
    1.71 +
    1.72 +  /*
    1.73 +   * Determine if a plugin has stored data for a given site.
    1.74 +   *
    1.75 +   * @param plugin: the plugin to query, such as one returned by
    1.76 +   *                nsIPluginHost.getPluginTags.
    1.77 +   * @param domain: the domain to test. If this argument is null, test if data
    1.78 +   *                is stored for any site. The base domain for the given domain
    1.79 +   *                will be determined; if any data for the base domain or its
    1.80 +   *                subdomains is found, return true.
    1.81 +   */
    1.82 +  boolean siteHasData(in nsIPluginTag plugin, in AUTF8String domain);
    1.83 +
    1.84 +  /**
    1.85 +   * Registers the play preview plugin mode for specific mime type
    1.86 +   *
    1.87 +   * @param mimeType: specifies plugin mime type.
    1.88 +   * @param ignoreCTP: if true, the play preview ignores CTP rules, e.g.
    1.89 +                       whitelisted websites, will not notify about plugin
    1.90 +                       presence in the address bar.
    1.91 +   * @param redirectURL: specifies url for the overlay iframe
    1.92 +   */
    1.93 +  void registerPlayPreviewMimeType(in AUTF8String mimeType,
    1.94 +                                   [optional] in boolean ignoreCTP,
    1.95 +                                   [optional] in AUTF8String redirectURL);
    1.96 +
    1.97 +  void unregisterPlayPreviewMimeType(in AUTF8String mimeType);
    1.98 +
    1.99 +  nsIPluginPlayPreviewInfo getPlayPreviewInfo(in AUTF8String mimeType);
   1.100 +
   1.101 +  ACString getPermissionStringForType(in AUTF8String mimeType);
   1.102 +
   1.103 +  /**
   1.104 +   * Get the nsIPluginTag for this MIME type. This method works with both
   1.105 +   * enabled and disabled/blocklisted plugins, but an enabled plugin will
   1.106 +   * always be returned if available.
   1.107 +   *
   1.108 +   * @throws NS_ERROR_NOT_AVAILABLE if no plugin is available for this MIME
   1.109 +   *         type.
   1.110 +   */
   1.111 +  nsIPluginTag getPluginTagForType(in AUTF8String mimeType);
   1.112 +
   1.113 +  /**
   1.114 +   * Get the nsIPluginTag state for this MIME type.
   1.115 +   */
   1.116 +  unsigned long getStateForType(in AUTF8String mimeType);
   1.117 +
   1.118 +  /**
   1.119 +   * Get the blocklist state for a MIME type.
   1.120 +   */
   1.121 +  uint32_t getBlocklistStateForType(in string aMimeType);
   1.122 +};
   1.123 +

mercurial