Back to index

lightning-sunbird  0.9+nobinonly
nsIHTMLContentSink.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is Mozilla Communicator client code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 #ifndef nsIHTMLContentSink_h___
00038 #define nsIHTMLContentSink_h___
00039 
00084 #include "nsIParserNode.h"
00085 #include "nsIContentSink.h"
00086 #include "nsHTMLTags.h"
00087 
00088 #define NS_IHTML_CONTENT_SINK_IID \
00089  { 0x59929de5, 0xe60b, 0x48b1,{0x81, 0x69, 0x48, 0x47, 0xb5, 0xc9, 0x44, 0x29}}
00090 
00091 #if defined(XP_MAC) || defined(WINCE) 
00092 #define MAX_REFLOW_DEPTH  75    //setting to 75 to prevent layout from crashing on mac. Bug 55095.
00093                                 //We will also change this for WinCE as it usually has a strict
00094                                 //memory upper limit (no vm, ~32mb)
00095 #else
00096 #define MAX_REFLOW_DEPTH  200   //windows and linux (etc) can do much deeper structures.
00097 #endif
00098 
00099 class nsIHTMLContentSink : public nsIContentSink 
00100 {
00101 public:
00102 
00103   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IHTML_CONTENT_SINK_IID)
00104 
00105   
00112   NS_IMETHOD SetTitle(const nsString& aValue) = 0;
00113 
00120   NS_IMETHOD OpenHTML(const nsIParserNode& aNode) = 0;
00121 
00126   NS_IMETHOD CloseHTML() = 0;
00127 
00134   NS_IMETHOD OpenHead(const nsIParserNode& aNode) = 0;
00135 
00139   NS_IMETHOD CloseHead() = 0;
00140   
00147   NS_IMETHOD OpenBody(const nsIParserNode& aNode) = 0;
00148 
00153   NS_IMETHOD CloseBody() = 0;
00154 
00161   NS_IMETHOD OpenForm(const nsIParserNode& aNode) = 0;
00162 
00167   NS_IMETHOD CloseForm() = 0;
00168 
00175   NS_IMETHOD OpenMap(const nsIParserNode& aNode) = 0;
00176 
00181   NS_IMETHOD CloseMap() = 0;
00182         
00189   NS_IMETHOD OpenFrameset(const nsIParserNode& aNode) = 0;
00190 
00195   NS_IMETHOD CloseFrameset() = 0;
00196 
00204   NS_IMETHOD BeginContext(PRInt32 aPosition) = 0;
00205   
00213   NS_IMETHOD EndContext(PRInt32 aPosition) = 0;
00214   
00219   NS_IMETHOD IsEnabled(PRInt32 aTag, PRBool* aReturn) = 0;
00220 
00225   NS_IMETHOD WillProcessTokens(void) = 0;
00226 
00233   NS_IMETHOD DidProcessTokens() = 0;
00234 
00239   NS_IMETHOD WillProcessAToken(void) = 0;
00240 
00247   NS_IMETHOD DidProcessAToken(void) = 0;
00248 
00255   NS_IMETHOD OpenContainer(const nsIParserNode& aNode) = 0;
00256 
00263   NS_IMETHOD CloseContainer(const nsHTMLTag aTag) = 0;
00264 
00270   NS_IMETHOD AddHeadContent(const nsIParserNode& aNode) = 0;
00271 
00280   NS_IMETHOD AddLeaf(const nsIParserNode& aNode) = 0;
00281 
00290   NS_IMETHOD AddComment(const nsIParserNode& aNode) = 0;
00291 
00300   NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode) = 0;
00301 
00310   NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode) = 0;
00311 
00318   NS_IMETHOD NotifyTagObservers(nsIParserNode* aNode) = 0;
00319 
00325   NS_IMETHOD_(PRBool) IsFormOnStack() = 0;
00326 
00327 };
00328 
00329 #endif /* nsIHTMLContentSink_h___ */
00330