Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef OdsFileHandler_H
00030 #define OdsFileHandler_H
00031
00032 #include <QXmlDefaultHandler>
00033 #include <vector>
00034
00035 class ApplicationWindow;
00036 class Table;
00037
00038 class OdsFileHandler : public QXmlDefaultHandler
00039 {
00040 public:
00041 OdsFileHandler(ApplicationWindow *app, const QString& odsFileName);
00042
00043 bool startElement(const QString &namespaceURI, const QString &localName,
00044 const QString &qName, const QXmlAttributes &attributes);
00045 bool endElement(const QString &namespaceURI, const QString &localName,
00046 const QString &qName);
00047 bool characters(const QString &str);
00048 bool fatalError(const QXmlParseException &){return false;};
00049 QString errorString() const;
00050
00051 Table *sheet(int index);
00052 int sheetsCount(){return d_tables.size();};
00053
00054 private:
00055 ApplicationWindow * d_app;
00056 QString d_ods_file_name;
00057 QString currentText;
00058 QString errorStr;
00059
00060 int d_last_column;
00061
00062 int d_rows;
00063
00064 int d_col;
00065
00066 enum CellType {EmptyCell = 0, Float, String, Date, Time, Boolean, Currency, Percent};
00067
00068 struct cell_data{
00069 int row;
00070 int col;
00071 double d;
00072 QString str;
00073 CellType type;
00074 };
00075
00076 std::vector <cell_data> cells;
00077
00078 QStringList d_sheet_names;
00079 QList<Table *> d_tables;
00080 };
00081
00082 #endif