parser/html/nsIScriptableUnescapeHTML.idl

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #include "nsISupports.idl"
     8 interface nsIDOMElement;
     9 interface nsIDOMDocumentFragment;
    10 interface nsIURI;
    12 /**
    13  * This interface is OBSOLETE and exists solely for legacy extensions.
    14  */
    15 [scriptable, uuid(3ab244a9-f09d-44da-9e3f-ee4d67367f2d)]
    16 interface nsIScriptableUnescapeHTML : nsISupports 
    17 {
    18   /** 
    19    * Converts HTML to plain text. This is equivalent to calling
    20    * nsIParserUtils::convertToPlainText(src, 
    21    *   nsIDocumentEncoder::OutputSelectionOnly |
    22    *   nsIDocumentEncoder::OutputAbsoluteLinks, 0).
    23    *
    24    * You should call nsIParserUtils::convertToPlainText() instead of calling 
    25    * this method.
    26    *
    27    * @param src The HTML string to convert to plain text.
    28    */ 
    29   AString unescape(in AString src);
    31   /**
    32    * Parses markup into a sanitized document fragment. This is equivalent to
    33    * calling nsIParserUtils::parseFragment(fragment, 0, isXML, baseURI,
    34    * element).
    35    *
    36    * You should call nsIParserUtils::parseFragment() instead of calling this 
    37    * method.
    38    * @param fragment the input markup
    39    * @param isXML true if |fragment| is XML and false if HTML
    40    * @param baseURI the base URL for this fragment
    41    * @param element the context node for the fragment parsing algorithm
    42    */
    43   nsIDOMDocumentFragment parseFragment(in AString fragment,
    44                                        in boolean isXML,
    45                                        in nsIURI baseURI,
    46                                        in nsIDOMElement element);
    47 };
    49 %{ C++
    50 #define NS_SCRIPTABLEUNESCAPEHTML_CONTRACTID \
    51   "@mozilla.org/feed-unescapehtml;1"
    52 #define NS_SCRIPTABLEUNESCAPEHTML_CID  \
    53 { 0x10f2f5f0, 0xf103, 0x4901, { 0x98, 0x0f, 0xba, 0x11, 0xbd, 0x70, 0xd6, 0x0d} }
    54 %}

mercurial