001    /*
002     * Copyright (c) 2009-2010 Mozilla Foundation
003     *
004     * Permission is hereby granted, free of charge, to any person obtaining a 
005     * copy of this software and associated documentation files (the "Software"), 
006     * to deal in the Software without restriction, including without limitation 
007     * the rights to use, copy, modify, merge, publish, distribute, sublicense, 
008     * and/or sell copies of the Software, and to permit persons to whom the 
009     * Software is furnished to do so, subject to the following conditions:
010     *
011     * The above copyright notice and this permission notice shall be included in 
012     * all copies or substantial portions of the Software.
013     *
014     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
015     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
016     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
017     * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
018     * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
019     * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
020     * DEALINGS IN THE SOFTWARE.
021     */
022    
023    package nu.validator.htmlparser.impl;
024    
025    /**
026     * Interface for exposing the state of the HTML5 tree builder so that the
027     * interface can be implemented by the tree builder itself and by snapshots.
028     * 
029     * @version $Id$
030     * @author hsivonen
031     */
032    public interface TreeBuilderState<T> {
033    
034        /**
035         * Returns the stack.
036         * 
037         * @return the stack
038         */
039        public StackNode<T>[] getStack();
040    
041        /**
042         * Returns the listOfActiveFormattingElements.
043         * 
044         * @return the listOfActiveFormattingElements
045         */
046        public StackNode<T>[] getListOfActiveFormattingElements();
047    
048        /**
049         * Returns the formPointer.
050         * 
051         * @return the formPointer
052         */
053        public T getFormPointer();
054    
055        /**
056         * Returns the headPointer.
057         * 
058         * @return the headPointer
059         */
060        public T getHeadPointer();
061        
062        /**
063         * Returns the deepTreeSurrogateParent.
064         * 
065         * @return the deepTreeSurrogateParent
066         */
067        public T getDeepTreeSurrogateParent();
068    
069        /**
070         * Returns the mode.
071         * 
072         * @return the mode
073         */
074        public int getMode();
075    
076        /**
077         * Returns the originalMode.
078         * 
079         * @return the originalMode
080         */
081        public int getOriginalMode();
082    
083        /**
084         * Returns the framesetOk.
085         * 
086         * @return the framesetOk
087         */
088        public boolean isFramesetOk();
089        
090        /**
091         * Returns the needToDropLF.
092         * 
093         * @return the needToDropLF
094         */
095        public boolean isNeedToDropLF();
096    
097        /**
098         * Returns the quirks.
099         * 
100         * @return the quirks
101         */
102        public boolean isQuirks();
103        
104        /**
105         * Return the length of the stack.
106         * @return the length of the stack.
107         */
108        public int getStackLength();
109        
110        /**
111         * Return the length of the list of active formatting elements.
112         * @return the length of the list of active formatting elements.
113         */
114        public int getListOfActiveFormattingElementsLength();
115    }