1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef INCLUDED_HELPCOMPILER_INC_BASCODETAGGER_HXX
11 #define INCLUDED_HELPCOMPILER_INC_BASCODETAGGER_HXX
16 #include <libxml/parser.h>
17 #include <comphelper/syntaxhighlight.hxx>
18 #include <helpcompiler/dllapi.h>
20 class LibXmlTreeWalker
;
26 xmlDocPtr m_pDocument
;
27 std::vector
<xmlNodePtr
> m_BasicCodeContainerTags
;
28 std::unique_ptr
<LibXmlTreeWalker
> m_pXmlTreeWalker
;
29 SyntaxHighlighter m_Highlighter
;
30 bool m_bTaggingCompleted
;
31 void tagParagraph( xmlNodePtr paragraph
);
32 static xmlChar
* getTypeString( TokenType tokenType
);
33 void getBasicCodeContainerNodes();
34 void tagBasCodeParagraphs();
37 enum TaggerException
{ NULL_DOCUMENT
, EMPTY_DOCUMENT
};
38 BasicCodeTagger( xmlDocPtr rootDoc
);
43 //================LibXmlTreeWalker===========================================================
45 class LibXmlTreeWalker
48 xmlNodePtr m_pCurrentNode
;
49 std::deque
<xmlNodePtr
> m_Queue
; //!Queue for breath-first search
52 LibXmlTreeWalker( xmlDocPtr doc
);
54 xmlNodePtr
currentNode() { return m_pCurrentNode
;}
56 void ignoreCurrNodesChildren();
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */