2001-09-25 05:32:19 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 01:52:36 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2000-09-10 01:47:23 +04:00
|
|
|
*
|
2004-04-18 01:52:36 +04:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
2000-09-10 01:47:23 +04:00
|
|
|
*
|
2001-09-25 05:32:19 +04:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
2000-09-10 01:47:23 +04:00
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 01:52:36 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-25 05:32:19 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
2000-09-10 01:47:23 +04:00
|
|
|
*
|
2001-09-25 05:32:19 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 01:52:36 +04:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-09-25 05:32:19 +04:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-18 01:52:36 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-25 05:32:19 +04:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-18 01:52:36 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-25 05:32:19 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2000-09-10 01:47:23 +04:00
|
|
|
|
|
|
|
#ifndef _nsIContentSerializer_h__
|
|
|
|
#define _nsIContentSerializer_h__
|
|
|
|
|
|
|
|
#include "nsISupports.h"
|
|
|
|
|
2010-05-04 17:19:54 +04:00
|
|
|
class nsIContent;
|
|
|
|
class nsIDocument;
|
2006-03-22 21:36:36 +03:00
|
|
|
class nsAString;
|
2000-09-10 01:47:23 +04:00
|
|
|
|
|
|
|
/* starting interface: nsIContentSerializer */
|
|
|
|
|
|
|
|
#define NS_ICONTENTSERIALIZER_IID \
|
2010-05-04 17:19:54 +04:00
|
|
|
{ 0xb1ee32f2, 0xb8c4, 0x49b9, \
|
|
|
|
{ 0x93, 0xdf, 0xb6, 0xfa, 0xb5, 0xd5, 0x46, 0x88 } }
|
2000-09-10 01:47:23 +04:00
|
|
|
|
|
|
|
class nsIContentSerializer : public nsISupports {
|
|
|
|
public:
|
|
|
|
|
2005-11-11 17:36:26 +03:00
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTSERIALIZER_IID)
|
2000-09-10 01:47:23 +04:00
|
|
|
|
2001-02-13 04:00:14 +03:00
|
|
|
NS_IMETHOD Init(PRUint32 flags, PRUint32 aWrapColumn,
|
2007-08-11 04:38:53 +04:00
|
|
|
const char* aCharSet, PRBool aIsCopying,
|
|
|
|
PRBool aIsWholeDocument) = 0;
|
2000-09-10 01:47:23 +04:00
|
|
|
|
2010-05-04 17:19:54 +04:00
|
|
|
NS_IMETHOD AppendText(nsIContent* aText, PRInt32 aStartOffset,
|
2002-03-24 02:54:46 +03:00
|
|
|
PRInt32 aEndOffset, nsAString& aStr) = 0;
|
2000-09-10 01:47:23 +04:00
|
|
|
|
2010-05-04 17:19:54 +04:00
|
|
|
NS_IMETHOD AppendCDATASection(nsIContent* aCDATASection,
|
2000-09-10 04:09:14 +04:00
|
|
|
PRInt32 aStartOffset, PRInt32 aEndOffset,
|
2002-03-24 02:54:46 +03:00
|
|
|
nsAString& aStr) = 0;
|
2000-09-10 01:47:23 +04:00
|
|
|
|
2010-05-04 17:19:54 +04:00
|
|
|
NS_IMETHOD AppendProcessingInstruction(nsIContent* aPI,
|
2000-09-10 04:09:14 +04:00
|
|
|
PRInt32 aStartOffset,
|
|
|
|
PRInt32 aEndOffset,
|
2002-03-24 02:54:46 +03:00
|
|
|
nsAString& aStr) = 0;
|
2000-09-10 01:47:23 +04:00
|
|
|
|
2010-05-04 17:19:54 +04:00
|
|
|
NS_IMETHOD AppendComment(nsIContent* aComment, PRInt32 aStartOffset,
|
2002-03-24 02:54:46 +03:00
|
|
|
PRInt32 aEndOffset, nsAString& aStr) = 0;
|
2000-09-10 01:47:23 +04:00
|
|
|
|
2010-05-04 17:19:54 +04:00
|
|
|
NS_IMETHOD AppendDoctype(nsIContent *aDoctype,
|
2002-03-24 02:54:46 +03:00
|
|
|
nsAString& aStr) = 0;
|
2000-09-10 01:47:23 +04:00
|
|
|
|
2010-05-04 17:19:54 +04:00
|
|
|
NS_IMETHOD AppendElementStart(nsIContent *aElement,
|
|
|
|
nsIContent *aOriginalElement,
|
2002-03-24 02:54:46 +03:00
|
|
|
nsAString& aStr) = 0;
|
2000-09-10 01:47:23 +04:00
|
|
|
|
2010-05-04 17:19:54 +04:00
|
|
|
NS_IMETHOD AppendElementEnd(nsIContent *aElement,
|
2002-03-24 02:54:46 +03: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 14:57:30 +04:00
|
|
|
|
2002-03-24 02:54:46 +03:00
|
|
|
NS_IMETHOD Flush(nsAString& aStr) = 0;
|
2002-08-13 22:41:16 +04: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 17:19:54 +04:00
|
|
|
NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument,
|
2002-08-13 22:41:16 +04:00
|
|
|
nsAString& aStr) = 0;
|
2000-09-10 01:47:23 +04:00
|
|
|
};
|
|
|
|
|
2005-11-11 17:36:26 +03:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentSerializer, NS_ICONTENTSERIALIZER_IID)
|
|
|
|
|
2000-09-14 03:57:52 +04:00
|
|
|
#define NS_CONTENTSERIALIZER_CONTRACTID_PREFIX \
|
|
|
|
"@mozilla.org/layout/contentserializer;1?mimetype="
|
2000-09-10 01:47:23 +04:00
|
|
|
|
|
|
|
#endif /* __gen_nsIContentSerializer_h__ */
|