Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / source / filter / inc / lotimpop.hxx
blob7429cb4efb25c9c32ab3b103fce84ea5b737d4bc
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/.
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 .
20 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_LOTIMPOP_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_LOTIMPOP_HXX
23 #include <rtl/ustring.hxx>
25 #include "imp_op.hxx"
26 #include "ftools.hxx"
27 #include "lotform.hxx"
28 #include "lotattr.hxx"
30 struct LotusContext;
32 class ImportLotus : public ImportTyp
34 private:
35 SvStream* pIn; // needed due to multiple Read()!
36 LotusToSc aConv;
37 sal_uInt16 nTab; // currently handled table
38 sal_Int32 nExtTab;
40 // in WK?-Datei
41 void Bof(); // 0x0000 00
42 bool BofFm3(); // 0x0000 00
43 void Columnwidth( sal_uInt16 nRecLen ); // 0x0007 07
44 void Hiddencolumn( sal_uInt16 nRecLen ); // 0x0008 08
45 void Userrange(); // 0x0009 09
46 void Errcell(); // 0x0014 20
47 void Nacell(); // 0x0015 21
48 void Labelcell(); // 0x0016 22
49 void Numbercell(); // 0x0017 23
50 void Smallnumcell(); // 0x0018 24
51 void Formulacell( sal_uInt16 nRecLen ); // 0x0019 25
52 // 0x001b 27 special
53 void NamedSheet(); // 14000
54 void RowPresentation( sal_uInt16 nRecLen ); // 2007
56 // in FM? file
57 void Font_Face(); // 174
58 void Font_Type(); // 176
59 void Font_Ysize(); // 177
60 void Row_( const sal_uInt16 nRecLen ); // 197 ?
62 inline void Read( ScAddress& );
63 inline void Read( ScRange& );
64 // for addresses/ranges in the format row(16)/tab(8)/col(8)
65 inline void Read( sal_Char& );
66 inline void Read( sal_uInt8& );
67 inline void Read( sal_uInt16& );
68 inline void Read( sal_Int16& );
69 inline void Read( double& ); // read 10-byte IEEE
70 inline void Read( LotAttrWK3& );
71 void Read( OUString& ); // read in 0-terminated string
72 inline void Skip( const sal_uInt16 nNumBytes );
74 public:
75 ImportLotus(LotusContext& rContext, SvStream&, ScDocument*, rtl_TextEncoding eSrc);
77 virtual ~ImportLotus() override;
79 ErrCode parse(); //parse + CalcAfterLoad
80 ErrCode Read();
81 ErrCode Read( SvStream& ); // special for *.fm3 files
84 inline void ImportLotus::Read( ScAddress& rAddr )
86 sal_uInt16 nRow;
87 pIn->ReadUInt16( nRow );
88 rAddr.SetRow( static_cast<SCROW>(nRow) );
89 sal_uInt8 nByte;
90 pIn->ReadUChar( nByte );
91 rAddr.SetTab( static_cast<SCTAB>(nByte) );
92 pIn->ReadUChar( nByte );
93 rAddr.SetCol( static_cast<SCCOL>(nByte) );
96 inline void ImportLotus::Read( ScRange& rRange )
98 Read( rRange.aStart );
99 Read( rRange.aEnd );
102 inline void ImportLotus::Read( sal_Char& r )
104 pIn->ReadChar( r );
107 inline void ImportLotus::Read( sal_uInt8& r )
109 pIn->ReadUChar( r );
112 inline void ImportLotus::Read( sal_uInt16& r )
114 pIn->ReadUInt16( r );
117 inline void ImportLotus::Read( sal_Int16& r )
119 pIn->ReadInt16( r );
122 inline void ImportLotus::Read( double& r )
124 r = ScfTools::ReadLongDouble( *pIn );
127 inline void ImportLotus::Read( LotAttrWK3& r )
129 pIn->ReadUChar( r.nFont ).ReadUChar( r.nFontCol ).ReadUChar( r.nBack ).ReadUChar( r.nLineStyle );
132 inline void ImportLotus::Skip( const sal_uInt16 n )
134 pIn->SeekRel( n );
137 #endif
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */