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
17 #include <libxml/xmlmemory.h>
18 #include <libxml/parser.h>
19 #include <rtl/ustring.hxx>
20 #include <comphelper/syntaxhighlight.hxx>
21 #include <helpcompiler/dllapi.h>
23 class BasicCodeTagger
;
24 class LibXmlTreeWalker
;
27 class L10N_DLLPUBLIC BasicCodeTagger
30 xmlDocPtr m_pDocument
;
31 std::list
<xmlNodePtr
> m_BasicCodeContainerTags
;
32 LibXmlTreeWalker
*m_pXmlTreeWalker
;
33 std::list
<std::string
> m_BasicCodeStringList
;
34 SyntaxHighlighter m_Highlighter
;
35 bool m_bTaggingCompleted
;
36 void tagParagraph( xmlNodePtr paragraph
);
37 static xmlChar
* getTypeString( TokenTypes tokenType
);
38 void getBasicCodeContainerNodes();
39 void tagBasCodeParagraphs();
42 enum TaggerException
{ FILE_WRITING
, NULL_DOCUMENT
, EMPTY_DOCUMENT
};
43 BasicCodeTagger( xmlDocPtr rootDoc
);
48 //================LibXmlTreeWalker===========================================================
50 class L10N_DLLPUBLIC LibXmlTreeWalker
53 xmlNodePtr m_pCurrentNode
;
54 std::list
<xmlNodePtr
> m_Queue
; //!Queue for breath-first search
57 LibXmlTreeWalker( xmlDocPtr doc
);
58 ~LibXmlTreeWalker() {}
60 xmlNodePtr
currentNode() { return m_pCurrentNode
;}
62 void ignoreCurrNodesChildren();
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */