michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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 "nsISupports.idl" michael@0: michael@0: interface nsIDOMElement; michael@0: interface nsIDOMDocumentFragment; michael@0: interface nsIURI; michael@0: michael@0: /** michael@0: * This interface is OBSOLETE and exists solely for legacy extensions. michael@0: */ michael@0: [scriptable, uuid(3ab244a9-f09d-44da-9e3f-ee4d67367f2d)] michael@0: interface nsIScriptableUnescapeHTML : nsISupports michael@0: { michael@0: /** michael@0: * Converts HTML to plain text. This is equivalent to calling michael@0: * nsIParserUtils::convertToPlainText(src, michael@0: * nsIDocumentEncoder::OutputSelectionOnly | michael@0: * nsIDocumentEncoder::OutputAbsoluteLinks, 0). michael@0: * michael@0: * You should call nsIParserUtils::convertToPlainText() instead of calling michael@0: * this method. michael@0: * michael@0: * @param src The HTML string to convert to plain text. michael@0: */ michael@0: AString unescape(in AString src); michael@0: michael@0: /** michael@0: * Parses markup into a sanitized document fragment. This is equivalent to michael@0: * calling nsIParserUtils::parseFragment(fragment, 0, isXML, baseURI, michael@0: * element). michael@0: * michael@0: * You should call nsIParserUtils::parseFragment() instead of calling this michael@0: * method. michael@0: * @param fragment the input markup michael@0: * @param isXML true if |fragment| is XML and false if HTML michael@0: * @param baseURI the base URL for this fragment michael@0: * @param element the context node for the fragment parsing algorithm michael@0: */ michael@0: nsIDOMDocumentFragment parseFragment(in AString fragment, michael@0: in boolean isXML, michael@0: in nsIURI baseURI, michael@0: in nsIDOMElement element); michael@0: }; michael@0: michael@0: %{ C++ michael@0: #define NS_SCRIPTABLEUNESCAPEHTML_CONTRACTID \ michael@0: "@mozilla.org/feed-unescapehtml;1" michael@0: #define NS_SCRIPTABLEUNESCAPEHTML_CID \ michael@0: { 0x10f2f5f0, 0xf103, 0x4901, { 0x98, 0x0f, 0xba, 0x11, 0xbd, 0x70, 0xd6, 0x0d} } michael@0: %}