Handle pasting disallowed clipboard contents on iOS
[LibreOffice.git] / helpcompiler / inc / BasCodeTagger.hxx
blobbf72ce0028b5f66427de489d9c16c5e73e564ee8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #pragma once
12 #include <deque>
13 #include <memory>
14 #include <vector>
15 #include <libxml/parser.h>
16 #include <comphelper/syntaxhighlight.hxx>
18 class LibXmlTreeWalker;
20 //!Tagger class.
21 class BasicCodeTagger
23 private:
24 xmlDocPtr m_pDocument;
25 std::vector<xmlNodePtr> m_BasicCodeContainerTags;
26 std::unique_ptr<LibXmlTreeWalker> m_pXmlTreeWalker;
27 SyntaxHighlighter m_Highlighter;
28 bool m_bTaggingCompleted;
29 void tagParagraph( xmlNodePtr paragraph );
30 static xmlChar* getTypeString( TokenType tokenType );
31 void getBasicCodeContainerNodes();
32 void tagBasCodeParagraphs();
34 public:
35 enum TaggerException { NULL_DOCUMENT, EMPTY_DOCUMENT };
36 BasicCodeTagger( xmlDocPtr rootDoc );
37 ~BasicCodeTagger();
38 void tagBasicCodes();
41 //================LibXmlTreeWalker===========================================================
43 class LibXmlTreeWalker
45 private:
46 xmlNodePtr m_pCurrentNode;
47 std::deque<xmlNodePtr> m_Queue; //!Queue for breath-first search
49 public:
50 LibXmlTreeWalker( xmlDocPtr doc );
51 void nextNode();
52 xmlNodePtr currentNode() { return m_pCurrentNode;}
53 bool end() const;
54 void ignoreCurrNodesChildren();
57 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */