Version 7.5.1.1, tag libreoffice-7.5.1.1
[LibreOffice.git] / sc / source / filter / inc / lotimpop.hxx
blob916cbda11a89610db97c6eed732fd1450cdb2707
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 #pragma once
22 #include <rtl/ustring.hxx>
24 #include "imp_op.hxx"
25 #include "ftools.hxx"
26 #include "lotform.hxx"
27 #include "lotattr.hxx"
29 struct LotusContext;
31 class ImportLotus : public ImportTyp
33 private:
34 SvStream* pIn; // needed due to multiple Read()!
35 LotusToSc aConv;
36 sal_uInt16 nTab; // currently handled table
37 sal_Int32 nExtTab;
39 // in WK?-Datei
40 void Bof(); // 0x0000 00
41 bool BofFm3(); // 0x0000 00
42 void Columnwidth( sal_uInt16 nRecLen ); // 0x0007 07
43 void Hiddencolumn( sal_uInt16 nRecLen ); // 0x0008 08
44 void Userrange(); // 0x0009 09
45 void Errcell(); // 0x0014 20
46 void Nacell(); // 0x0015 21
47 void Labelcell(); // 0x0016 22
48 void Numbercell(); // 0x0017 23
49 void Smallnumcell(); // 0x0018 24
50 void Formulacell( sal_uInt16 nRecLen ); // 0x0019 25
51 // 0x001b 27 special
52 void NamedSheet(); // 14000
53 void RowPresentation( sal_uInt16 nRecLen ); // 2007
55 // in FM? file
56 void Font_Face(); // 174
57 void Font_Type(); // 176
58 void Font_Ysize(); // 177
59 void Row_( const sal_uInt16 nRecLen ); // 197 ?
61 inline void Read( ScAddress& );
62 inline void Read( ScRange& );
63 // for addresses/ranges in the format row(16)/tab(8)/col(8)
64 inline void Read( char& );
65 inline void Read( sal_uInt8& );
66 inline void Read( sal_uInt16& );
67 inline void Read( sal_Int16& );
68 inline void Read( double& ); // read 10-byte IEEE
69 inline void Read( LotAttrWK3& );
70 void Read( OUString& ); // read in 0-terminated string
71 inline void Skip( const sal_uInt16 nNumBytes );
73 public:
74 ImportLotus(LotusContext& rContext, SvStream&, rtl_TextEncoding eSrc);
76 virtual ~ImportLotus() override;
78 ErrCode parse(); //parse + CalcAfterLoad
79 ErrCode Read();
80 ErrCode Read( SvStream& ); // special for *.fm3 files
83 inline void ImportLotus::Read( ScAddress& rAddr )
85 sal_uInt16 nRow;
86 pIn->ReadUInt16( nRow );
87 rAddr.SetRow( static_cast<SCROW>(nRow) );
88 sal_uInt8 nByte;
89 pIn->ReadUChar( nByte );
90 rAddr.SetTab( static_cast<SCTAB>(nByte) );
91 pIn->ReadUChar( nByte );
92 rAddr.SetCol( static_cast<SCCOL>(nByte) );
95 inline void ImportLotus::Read( ScRange& rRange )
97 Read( rRange.aStart );
98 Read( rRange.aEnd );
101 inline void ImportLotus::Read( char& r )
103 pIn->ReadChar( r );
106 inline void ImportLotus::Read( sal_uInt8& r )
108 pIn->ReadUChar( r );
111 inline void ImportLotus::Read( sal_uInt16& r )
113 pIn->ReadUInt16( r );
116 inline void ImportLotus::Read( sal_Int16& r )
118 pIn->ReadInt16( r );
121 inline void ImportLotus::Read( double& r )
123 ScfTools::ReadLongDouble(*pIn, r);
126 inline void ImportLotus::Read( LotAttrWK3& r )
128 pIn->ReadUChar( r.nFont ).ReadUChar( r.nFontCol ).ReadUChar( r.nBack ).ReadUChar( r.nLineStyle );
131 inline void ImportLotus::Skip( const sal_uInt16 n )
133 pIn->SeekRel( n );
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */