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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 #include "svtools/svtdllapi.h"
24 #include <svtools/svparser.hxx>
27 struct RtfParserState_Impl
29 rtl_TextEncoding eCodeSet
;
30 sal_uInt8 nUCharOverread
;
32 RtfParserState_Impl( sal_uInt8 nUOverread
, rtl_TextEncoding eCdSt
)
33 : eCodeSet( eCdSt
), nUCharOverread( nUOverread
)
37 typedef std::stack
< RtfParserState_Impl
> RtfParserStates_Impl
;
39 class SVT_DLLPUBLIC SvRTFParser
: public SvParser
41 RtfParserStates_Impl aParserStates
;
44 rtl_TextEncoding eCodeSet
, eUNICodeSet
;
45 sal_uInt8 nUCharOverread
;
48 static short _inSkipGroup
;
51 sal_Unicode
GetHexValue();
52 void ScanText( const sal_Unicode
= 0 );
55 // scanne das naechste Token,
56 virtual int _GetNextToken();
58 virtual void ReadUnknownData();
59 virtual void ReadBitmapData();
60 virtual void ReadOLEData();
62 virtual ~SvRTFParser();
64 rtl_TextEncoding
GetCodeSet() const { return eCodeSet
; }
65 void SetEncoding( rtl_TextEncoding eEnc
);
67 rtl_TextEncoding
GetUNICodeSet() const { return eUNICodeSet
; }
68 void SetUNICodeSet( rtl_TextEncoding eSet
) { eUNICodeSet
= eSet
; }
71 SvRTFParser( SvStream
& rIn
, sal_uInt8 nStackSize
= 3 );
73 virtual SvParserState
CallParser(); // Aufruf des Parsers
75 int GetOpenBrakets() const { return nOpenBrakets
; }
77 // fuers asynchrone lesen aus dem SvStream
78 // virtual void SaveState( int nToken );
79 // virtual void RestoreState();
80 virtual void Continue( int nToken
);
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */