content/base/public/nsIContentSerializer.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 2; 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 #ifndef nsIContentSerializer_h
     7 #define nsIContentSerializer_h
     9 #include "nsISupports.h"
    11 class nsIContent;
    12 class nsIDocument;
    13 class nsAString;
    15 namespace mozilla {
    16 namespace dom {
    17 class Element;
    18 } // namespace dom
    19 } // namespace mozilla
    21 #define NS_ICONTENTSERIALIZER_IID \
    22 { 0xb1ee32f2, 0xb8c4, 0x49b9, \
    23   { 0x93, 0xdf, 0xb6, 0xfa, 0xb5, 0xd5, 0x46, 0x88 } }
    25 class nsIContentSerializer : public nsISupports {
    26  public: 
    28   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTSERIALIZER_IID)
    30   NS_IMETHOD Init(uint32_t flags, uint32_t aWrapColumn,
    31                   const char* aCharSet, bool aIsCopying,
    32                   bool aIsWholeDocument) = 0;
    34   NS_IMETHOD AppendText(nsIContent* aText, int32_t aStartOffset,
    35                         int32_t aEndOffset, nsAString& aStr) = 0;
    37   NS_IMETHOD AppendCDATASection(nsIContent* aCDATASection,
    38                                 int32_t aStartOffset, int32_t aEndOffset,
    39                                 nsAString& aStr) = 0;
    41   NS_IMETHOD AppendProcessingInstruction(nsIContent* aPI,
    42                                          int32_t aStartOffset,
    43                                          int32_t aEndOffset,
    44                                          nsAString& aStr) = 0;
    46   NS_IMETHOD AppendComment(nsIContent* aComment, int32_t aStartOffset,
    47                            int32_t aEndOffset, nsAString& aStr) = 0;
    49   NS_IMETHOD AppendDoctype(nsIContent *aDoctype,
    50                            nsAString& aStr) = 0;
    52   NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
    53                                 mozilla::dom::Element* aOriginalElement,
    54                                 nsAString& aStr) = 0;
    56   NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement,
    57                               nsAString& aStr) = 0;
    59   NS_IMETHOD Flush(nsAString& aStr) = 0;
    61   /**
    62    * Append any items in the beginning of the document that won't be 
    63    * serialized by other methods. XML declaration is the most likely 
    64    * thing this method can produce.
    65    */
    66   NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument,
    67                                  nsAString& aStr) = 0;
    68 };
    70 NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentSerializer, NS_ICONTENTSERIALIZER_IID)
    72 #define NS_CONTENTSERIALIZER_CONTRACTID_PREFIX \
    73 "@mozilla.org/layout/contentserializer;1?mimetype="
    75 #endif /* nsIContentSerializer_h */

mercurial