gnumericimport.h
1/* This file is part of the KDE project
2 Copyright (C) 1999 David Faure <faure@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef GNUMERICFILTER_H
21#define GNUMERICFILTER_H
22
23#include <KoFilter.h>
24
25#include <tqdatetime.h>
26#include <tqdom.h>
27
28namespace KSpread
29{
30class Cell;
31class Sheet;
32}
33
34class GNUMERICFilter : public KoFilter
35{
36 TQ_OBJECT
37
38 public:
39 GNUMERICFilter(KoFilter *parent, const char *name, const TQStringList&);
40 virtual ~GNUMERICFilter() {}
41
42 virtual KoFilter::ConversionStatus convert( const TQCString& from, const TQCString& to );
43
44enum borderStyle { Left, Right, Top, Bottom, Diagonal, Revdiagonal};
45 private:
46 class GnumericDate : public TQDate
47 {
48 public:
49 static uint greg2jul( int y, int m, int d );
50 static void jul2greg( double num, int & y, int & m, int & d );
51 static TQTime getTime( double num );
52
53 };
54
55 void dateInit();
56 TQString convertVars( TQString const & str, KSpread::Sheet * table ) const;
57 void ParsePrintInfo( TQDomNode const & printInfo, KSpread::Sheet * table );
58 void ParseFormat(TQString const & formatString, KSpread::Cell* kspread_cell);
59 void setStyleInfo(TQDomNode * sheet, KSpread::Sheet * table);
60 bool setType( KSpread::Cell* kspread_cell, TQString const & formatString, TQString & cell_content );
61 void convertFormula( TQString & formula ) const;
62 void importBorder( TQDomElement border, borderStyle _style, KSpread::Cell*cell);
63 void ParseBorder( TQDomElement & gmr_styleborder, KSpread::Cell* kspread_cell );
64 double parseAttribute( const TQDomElement &_element );
65
66};
67#endif // GNUMERICFILTER_H