2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-10-22 14:25:22 -07:00
|
|
|
#ifndef nsIContentSerializer_h
|
|
|
|
#define nsIContentSerializer_h
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsISupports.h"
|
|
|
|
|
2010-05-04 06:19:54 -07:00
|
|
|
class nsIContent;
|
|
|
|
class nsIDocument;
|
2007-03-22 10:30:00 -07:00
|
|
|
class nsAString;
|
|
|
|
|
2010-10-22 14:25:22 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class Element;
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#define NS_ICONTENTSERIALIZER_IID \
|
2010-05-04 06:19:54 -07:00
|
|
|
{ 0xb1ee32f2, 0xb8c4, 0x49b9, \
|
|
|
|
{ 0x93, 0xdf, 0xb6, 0xfa, 0xb5, 0xd5, 0x46, 0x88 } }
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsIContentSerializer : public nsISupports {
|
|
|
|
public:
|
|
|
|
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTSERIALIZER_IID)
|
|
|
|
|
|
|
|
NS_IMETHOD Init(PRUint32 flags, PRUint32 aWrapColumn,
|
2011-09-28 23:19:26 -07:00
|
|
|
const char* aCharSet, bool aIsCopying,
|
|
|
|
bool aIsWholeDocument) = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-04 06:19:54 -07:00
|
|
|
NS_IMETHOD AppendText(nsIContent* aText, PRInt32 aStartOffset,
|
2007-03-22 10:30:00 -07:00
|
|
|
PRInt32 aEndOffset, nsAString& aStr) = 0;
|
|
|
|
|
2010-05-04 06:19:54 -07:00
|
|
|
NS_IMETHOD AppendCDATASection(nsIContent* aCDATASection,
|
2007-03-22 10:30:00 -07:00
|
|
|
PRInt32 aStartOffset, PRInt32 aEndOffset,
|
|
|
|
nsAString& aStr) = 0;
|
|
|
|
|
2010-05-04 06:19:54 -07:00
|
|
|
NS_IMETHOD AppendProcessingInstruction(nsIContent* aPI,
|
2007-03-22 10:30:00 -07:00
|
|
|
PRInt32 aStartOffset,
|
|
|
|
PRInt32 aEndOffset,
|
|
|
|
nsAString& aStr) = 0;
|
|
|
|
|
2010-05-04 06:19:54 -07:00
|
|
|
NS_IMETHOD AppendComment(nsIContent* aComment, PRInt32 aStartOffset,
|
2007-03-22 10:30:00 -07:00
|
|
|
PRInt32 aEndOffset, nsAString& aStr) = 0;
|
|
|
|
|
2010-05-04 06:19:54 -07:00
|
|
|
NS_IMETHOD AppendDoctype(nsIContent *aDoctype,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsAString& aStr) = 0;
|
|
|
|
|
2010-10-22 14:25:22 -07:00
|
|
|
NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
|
|
|
|
mozilla::dom::Element* aOriginalElement,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsAString& aStr) = 0;
|
|
|
|
|
2010-10-22 14:25:22 -07:00
|
|
|
NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsAString& aStr) = 0;
|
|
|
|
|
|
|
|
NS_IMETHOD Flush(nsAString& aStr) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Append any items in the beginning of the document that won't be
|
|
|
|
* serialized by other methods. XML declaration is the most likely
|
|
|
|
* thing this method can produce.
|
|
|
|
*/
|
2010-05-04 06:19:54 -07:00
|
|
|
NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsAString& aStr) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentSerializer, NS_ICONTENTSERIALIZER_IID)
|
|
|
|
|
|
|
|
#define NS_CONTENTSERIALIZER_CONTRACTID_PREFIX \
|
|
|
|
"@mozilla.org/layout/contentserializer;1?mimetype="
|
|
|
|
|
2010-10-22 14:25:22 -07:00
|
|
|
#endif /* nsIContentSerializer_h */
|