2001-09-25 01:32:19 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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/. */
|
2000-09-10 02:17:54 +00:00
|
|
|
|
2006-03-31 08:00:42 +00:00
|
|
|
/*
|
|
|
|
* nsIContentSerializer implementation that can be used with an
|
|
|
|
* nsIDocumentEncoder to convert an HTML (not XHTML!) DOM to an HTML
|
|
|
|
* string that could be parsed into more or less the original DOM.
|
|
|
|
*/
|
|
|
|
|
2000-09-10 19:36:22 +00:00
|
|
|
#ifndef nsHTMLContentSerializer_h__
|
|
|
|
#define nsHTMLContentSerializer_h__
|
|
|
|
|
2013-05-29 20:43:41 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2009-04-25 09:00:14 +00:00
|
|
|
#include "nsXHTMLContentSerializer.h"
|
2000-09-10 06:44:06 +00:00
|
|
|
#include "nsIEntityConverter.h"
|
2002-11-22 12:20:05 +00:00
|
|
|
#include "nsString.h"
|
2000-09-10 06:44:06 +00:00
|
|
|
|
|
|
|
class nsIContent;
|
|
|
|
class nsIAtom;
|
2000-09-10 02:17:54 +00:00
|
|
|
|
2009-04-25 09:00:14 +00:00
|
|
|
class nsHTMLContentSerializer : public nsXHTMLContentSerializer {
|
2000-09-10 02:17:54 +00:00
|
|
|
public:
|
|
|
|
nsHTMLContentSerializer();
|
|
|
|
virtual ~nsHTMLContentSerializer();
|
|
|
|
|
2010-10-22 21:25:22 +00:00
|
|
|
NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
|
|
|
|
mozilla::dom::Element* aOriginalElement,
|
2013-05-29 20:43:41 +00:00
|
|
|
nsAString& aStr) MOZ_OVERRIDE;
|
2010-10-22 21:25:22 +00:00
|
|
|
|
|
|
|
NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement,
|
2013-05-29 20:43:41 +00:00
|
|
|
nsAString& aStr) MOZ_OVERRIDE;
|
2002-08-13 18:41:16 +00:00
|
|
|
|
2010-05-04 13:19:54 +00:00
|
|
|
NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument,
|
2013-05-29 20:43:41 +00:00
|
|
|
nsAString& aStr) MOZ_OVERRIDE;
|
2000-09-10 02:17:54 +00:00
|
|
|
protected:
|
2009-04-25 09:00:14 +00:00
|
|
|
|
2009-09-01 14:31:05 +00:00
|
|
|
virtual void SerializeHTMLAttributes(nsIContent* aContent,
|
2010-05-04 13:19:54 +00:00
|
|
|
nsIContent *aOriginalElement,
|
2009-09-01 14:31:05 +00:00
|
|
|
nsAString& aTagPrefix,
|
|
|
|
const nsAString& aTagNamespaceURI,
|
|
|
|
nsIAtom* aTagName,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aNamespace,
|
2009-09-01 14:31:05 +00:00
|
|
|
nsAString& aStr);
|
2010-03-18 16:07:32 +00:00
|
|
|
|
|
|
|
virtual void AppendAndTranslateEntities(const nsAString& aStr,
|
2013-05-29 20:43:41 +00:00
|
|
|
nsAString& aOutputStr) MOZ_OVERRIDE;
|
2010-03-18 16:07:32 +00:00
|
|
|
|
2000-09-10 02:17:54 +00:00
|
|
|
};
|
2000-09-10 19:36:22 +00:00
|
|
|
|
2003-03-05 15:08:41 +00:00
|
|
|
nsresult
|
|
|
|
NS_NewHTMLContentSerializer(nsIContentSerializer** aSerializer);
|
2000-09-10 19:36:22 +00:00
|
|
|
|
|
|
|
#endif
|