bump product version to 4.1.6.2
[LibreOffice.git] / writerfilter / source / rtftok / rtftokenizer.hxx
blob425e7734472843772ffb2cfa5106285edae1c27b
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 #ifndef _RTFTOKENIZER_HXX_
11 #define _RTFTOKENIZER_HXX_
13 #include <rtfdocumentimpl.hxx>
15 class SvStream;
17 namespace writerfilter {
18 namespace rtftok {
19 /// RTF tokenizer that separates control words from text.
20 class RTFTokenizer
22 public:
23 RTFTokenizer(RTFDocumentImpl& rImport, SvStream* pInStream, uno::Reference<task::XStatusIndicator> const& xStatusIndicator);
24 virtual ~RTFTokenizer();
26 int resolveParse();
27 int asHex(char ch);
28 /// Number of states on the stack.
29 int getGroup() const;
30 /// To be invoked by the pushState() callback to signal when the importer enters a group.
31 void pushGroup();
32 /// To be invoked by the popState() callback to single when the importer leaves a group.
33 void popGroup();
34 OUString getPosition();
35 private:
36 SvStream& Strm();
37 int resolveKeyword();
38 int dispatchKeyword(OString& rKeyword, bool bParam, int nParam);
40 RTFDocumentImpl& m_rImport;
41 SvStream* m_pInStream;
42 uno::Reference<task::XStatusIndicator> const& m_xStatusIndicator;
43 // This is the same as aRTFControlWords, but sorted
44 static std::vector<RTFSymbol> m_aRTFControlWords;
45 static bool m_bControlWordsSorted;
46 /// Same as the size of the importer's states, except that this can be negative for invalid input.
47 int m_nGroup;
48 sal_Int32 m_nLineNumber;
49 sal_Int32 m_nLineStartPos;
51 } // namespace rtftok
52 } // namespace writerfilter
54 #endif // _RTFTOKENIZER_HXX_
56 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */