2015-05-03 19:32:37 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
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-09 21:47:23 +00:00
|
|
|
|
2010-10-22 21:25:22 +00:00
|
|
|
#ifndef nsIContentSerializer_h
|
|
|
|
#define nsIContentSerializer_h
|
2000-09-09 21:47:23 +00:00
|
|
|
|
|
|
|
#include "nsISupports.h"
|
|
|
|
|
2010-05-04 13:19:54 +00:00
|
|
|
class nsIContent;
|
|
|
|
class nsIDocument;
|
2006-03-22 18:36:36 +00:00
|
|
|
class nsAString;
|
2000-09-09 21:47:23 +00:00
|
|
|
|
2010-10-22 21:25:22 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class Element;
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2000-09-09 21:47:23 +00:00
|
|
|
|
|
|
|
#define NS_ICONTENTSERIALIZER_IID \
|
2015-01-13 18:50:12 +00:00
|
|
|
{ 0xb1ee32f2, 0xb8c4, 0x49b9, \
|
|
|
|
{ 0x93, 0xdf, 0xb6, 0xfa, 0xb5, 0xd5, 0x46, 0x88 } }
|
2000-09-09 21:47:23 +00:00
|
|
|
|
|
|
|
class nsIContentSerializer : public nsISupports {
|
|
|
|
public:
|
|
|
|
|
2005-11-11 14:36:26 +00:00
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTSERIALIZER_IID)
|
2000-09-09 21:47:23 +00:00
|
|
|
|
2015-01-13 18:50:12 +00:00
|
|
|
NS_IMETHOD Init(uint32_t flags, uint32_t aWrapColumn,
|
|
|
|
const char* aCharSet, bool aIsCopying,
|
|
|
|
bool aIsWholeDocument) = 0;
|
2000-09-09 21:47:23 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
NS_IMETHOD AppendText(nsIContent* aText, int32_t aStartOffset,
|
|
|
|
int32_t aEndOffset, nsAString& aStr) = 0;
|
2000-09-09 21:47:23 +00:00
|
|
|
|
2010-05-04 13:19:54 +00:00
|
|
|
NS_IMETHOD AppendCDATASection(nsIContent* aCDATASection,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aStartOffset, int32_t aEndOffset,
|
2002-03-23 23:54:46 +00:00
|
|
|
nsAString& aStr) = 0;
|
2000-09-09 21:47:23 +00:00
|
|
|
|
2010-05-04 13:19:54 +00:00
|
|
|
NS_IMETHOD AppendProcessingInstruction(nsIContent* aPI,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aStartOffset,
|
|
|
|
int32_t aEndOffset,
|
2002-03-23 23:54:46 +00:00
|
|
|
nsAString& aStr) = 0;
|
2000-09-09 21:47:23 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
NS_IMETHOD AppendComment(nsIContent* aComment, int32_t aStartOffset,
|
|
|
|
int32_t aEndOffset, nsAString& aStr) = 0;
|
2000-09-09 21:47:23 +00:00
|
|
|
|
2010-05-04 13:19:54 +00:00
|
|
|
NS_IMETHOD AppendDoctype(nsIContent *aDoctype,
|
2002-03-23 23:54:46 +00:00
|
|
|
nsAString& aStr) = 0;
|
2000-09-09 21:47:23 +00:00
|
|
|
|
2010-10-22 21:25:22 +00:00
|
|
|
NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
|
|
|
|
mozilla::dom::Element* aOriginalElement,
|
2002-03-23 23:54:46 +00:00
|
|
|
nsAString& aStr) = 0;
|
2000-09-09 21:47:23 +00:00
|
|
|
|
2010-10-22 21:25:22 +00:00
|
|
|
NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement,
|
2002-03-23 23:54:46 +00:00
|
|
|
nsAString& aStr) = 0;
|
Checking in for bug 50742, this change removes the use of XIF in mozilla and replaces the XIF converter with a HTML (and XML) serializer.
Contextual information added to HTML copy and intelligence added to HTML paste in the editor (fixes bugs 47014, 50568 and 46554, and partly (at least) fixes bug 53188).
Code written by vidur, jfrancis, jst, akkana. Tested by jfrancis, akkana, vidur, jst, kin. Reviwed (and super reviewed) by waterson, vidur, kin, jfrancis, jst
2000-10-07 10:57:30 +00:00
|
|
|
|
2002-03-23 23:54:46 +00:00
|
|
|
NS_IMETHOD Flush(nsAString& aStr) = 0;
|
2002-08-13 18:41:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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 13:19:54 +00:00
|
|
|
NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument,
|
2002-08-13 18:41:16 +00:00
|
|
|
nsAString& aStr) = 0;
|
2000-09-09 21:47:23 +00:00
|
|
|
};
|
|
|
|
|
2005-11-11 14:36:26 +00:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentSerializer, NS_ICONTENTSERIALIZER_IID)
|
|
|
|
|
2000-09-13 23:57:52 +00:00
|
|
|
#define NS_CONTENTSERIALIZER_CONTRACTID_PREFIX \
|
|
|
|
"@mozilla.org/layout/contentserializer;1?mimetype="
|
2000-09-09 21:47:23 +00:00
|
|
|
|
2010-10-22 21:25:22 +00:00
|
|
|
#endif /* nsIContentSerializer_h */
|