michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nspluginroot.idl" michael@0: #include "nsISupports.idl" michael@0: #include "nsIPluginTag.idl" michael@0: michael@0: %{C++ michael@0: #define MOZ_PLUGIN_HOST_CONTRACTID \ michael@0: "@mozilla.org/plugin/host;1" michael@0: %} michael@0: michael@0: [scriptable, uuid(f89e7679-0adf-4a30-bda9-1afe1ee270d6)] michael@0: interface nsIPluginPlayPreviewInfo : nsISupports michael@0: { michael@0: readonly attribute AUTF8String mimeType; michael@0: readonly attribute boolean ignoreCTP; michael@0: readonly attribute AUTF8String redirectURL; michael@0: }; michael@0: michael@0: [scriptable, uuid(e8fe94f0-b877-46d0-931a-090967fb1e83)] michael@0: interface nsIPluginHost : nsISupports michael@0: { michael@0: /** michael@0: * Causes the plugins directory to be searched again for new plugin michael@0: * libraries. michael@0: */ michael@0: void reloadPlugins(); michael@0: michael@0: void getPluginTags([optional] out unsigned long aPluginCount, michael@0: [retval, array, size_is(aPluginCount)] out nsIPluginTag aResults); michael@0: michael@0: /* michael@0: * Flags for use with clearSiteData. michael@0: * michael@0: * FLAG_CLEAR_ALL: clear all data associated with a site. michael@0: * FLAG_CLEAR_CACHE: clear cached data that can be retrieved again without michael@0: * loss of functionality. To be used out of concern for michael@0: * space and not necessarily privacy. michael@0: */ michael@0: const uint32_t FLAG_CLEAR_ALL = 0; michael@0: const uint32_t FLAG_CLEAR_CACHE = 1; michael@0: michael@0: /* michael@0: * Clear site data for a given plugin. michael@0: * michael@0: * @param plugin: the plugin to clear data for, such as one returned by michael@0: * nsIPluginHost.getPluginTags. michael@0: * @param domain: the domain to clear data for. If this argument is null, michael@0: * clear data for all domains. Otherwise, it must be a domain michael@0: * only (not a complete URI or IRI). The base domain for the michael@0: * given site will be determined; any data for the base domain michael@0: * or its subdomains will be cleared. michael@0: * @param flags: a flag value defined above. michael@0: * @param maxAge: the maximum age in seconds of data to clear, inclusive. If michael@0: * maxAge is 0, no data is cleared; if it is -1, all data is michael@0: * cleared. michael@0: * michael@0: * @throws NS_ERROR_INVALID_ARG if the domain argument is malformed. michael@0: * @throws NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED if maxAge is a value other michael@0: * than -1 and the plugin does not support clearing by timerange in michael@0: * general or for that particular site and/or flag combination. michael@0: */ michael@0: void clearSiteData(in nsIPluginTag plugin, in AUTF8String domain, michael@0: in uint64_t flags, in int64_t maxAge); michael@0: michael@0: /* michael@0: * Determine if a plugin has stored data for a given site. michael@0: * michael@0: * @param plugin: the plugin to query, such as one returned by michael@0: * nsIPluginHost.getPluginTags. michael@0: * @param domain: the domain to test. If this argument is null, test if data michael@0: * is stored for any site. The base domain for the given domain michael@0: * will be determined; if any data for the base domain or its michael@0: * subdomains is found, return true. michael@0: */ michael@0: boolean siteHasData(in nsIPluginTag plugin, in AUTF8String domain); michael@0: michael@0: /** michael@0: * Registers the play preview plugin mode for specific mime type michael@0: * michael@0: * @param mimeType: specifies plugin mime type. michael@0: * @param ignoreCTP: if true, the play preview ignores CTP rules, e.g. michael@0: whitelisted websites, will not notify about plugin michael@0: presence in the address bar. michael@0: * @param redirectURL: specifies url for the overlay iframe michael@0: */ michael@0: void registerPlayPreviewMimeType(in AUTF8String mimeType, michael@0: [optional] in boolean ignoreCTP, michael@0: [optional] in AUTF8String redirectURL); michael@0: michael@0: void unregisterPlayPreviewMimeType(in AUTF8String mimeType); michael@0: michael@0: nsIPluginPlayPreviewInfo getPlayPreviewInfo(in AUTF8String mimeType); michael@0: michael@0: ACString getPermissionStringForType(in AUTF8String mimeType); michael@0: michael@0: /** michael@0: * Get the nsIPluginTag for this MIME type. This method works with both michael@0: * enabled and disabled/blocklisted plugins, but an enabled plugin will michael@0: * always be returned if available. michael@0: * michael@0: * @throws NS_ERROR_NOT_AVAILABLE if no plugin is available for this MIME michael@0: * type. michael@0: */ michael@0: nsIPluginTag getPluginTagForType(in AUTF8String mimeType); michael@0: michael@0: /** michael@0: * Get the nsIPluginTag state for this MIME type. michael@0: */ michael@0: unsigned long getStateForType(in AUTF8String mimeType); michael@0: michael@0: /** michael@0: * Get the blocklist state for a MIME type. michael@0: */ michael@0: uint32_t getBlocklistStateForType(in string aMimeType); michael@0: }; michael@0: