filters

gnumericimport.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1999 David Faure <faure@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef GNUMERICFILTER_H
00021 #define GNUMERICFILTER_H
00022 
00023 #include <KoFilter.h>
00024 
00025 #include <qdatetime.h>
00026 #include <qdom.h>
00027 
00028 namespace KSpread
00029 {
00030 class Cell;
00031 class Sheet;
00032 }
00033 
00034 class GNUMERICFilter : public KoFilter
00035 {
00036     Q_OBJECT
00037  public:
00038     GNUMERICFilter(KoFilter *parent, const char *name, const QStringList&);
00039     virtual ~GNUMERICFilter() {}
00040 
00041     virtual KoFilter::ConversionStatus convert( const QCString& from, const QCString& to );
00042 
00043 enum borderStyle { Left, Right, Top, Bottom, Diagonal, Revdiagonal};
00044  private:
00045   class GnumericDate : public QDate
00046   {
00047    public:
00048     static uint greg2jul( int y, int m, int d );
00049     static void jul2greg( double num, int & y, int & m, int & d );
00050     static QTime getTime( double num );
00051 
00052   };
00053 
00054   void dateInit();
00055   QString convertVars( QString const & str, KSpread::Sheet * table ) const;
00056   void ParsePrintInfo( QDomNode const & printInfo, KSpread::Sheet * table );
00057   void ParseFormat(QString const & formatString, KSpread::Cell* kspread_cell);
00058   void setStyleInfo(QDomNode * sheet, KSpread::Sheet * table);
00059   bool setType( KSpread::Cell* kspread_cell, QString const & formatString, QString & cell_content );
00060   void convertFormula( QString & formula ) const;
00061     void importBorder( QDomElement  border, borderStyle _style,  KSpread::Cell*cell);
00062     void ParseBorder( QDomElement & gmr_styleborder, KSpread::Cell* kspread_cell );
00063     double parseAttribute( const QDomElement &_element );
00064 
00065 };
00066 #endif // GNUMERICFILTER_H
KDE Home | KDE Accessibility Home | Description of Access Keys