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