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
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef CW_DBASE_CONTENT
00039 # define CW_DBASE_CONTENT
00040
00041 #include <iostream>
00042 #include <map>
00043 #include <vector>
00044
00045 #include "libmwaw_internal.hxx"
00046
00047 #include "MWAWEntry.hxx"
00048 #include "MWAWFont.hxx"
00049
00050
00051 #include "CWStyleManager.hxx"
00052
00053 class CWStyleManager;
00054
00056 class CWDbaseContent
00057 {
00058 public:
00060 CWDbaseContent(MWAWParserStatePtr parserState, shared_ptr<CWStyleManager> styleManager, bool spreadsheet);
00062 ~CWDbaseContent();
00064 bool readContent();
00065
00067 bool getExtrema(Vec2i &min, Vec2i &max) const;
00069 bool getRecordList(std::vector<int> &list) const;
00070
00072 bool send(Vec2i const &pos);
00074 void setDatabaseFormats(std::vector<CWStyleManager::CellFormat> const &format);
00075 protected:
00077 struct Record {
00079 enum Type { R_Unknown, R_Long, R_Double, R_String };
00081 Record() : m_style(-1), m_resType(R_Unknown), m_resLong(0), m_resDouble(0), m_resString(), m_format(0), m_font(3,9), m_justify(0), m_borders(0) {
00082 }
00083
00085 int m_style;
00087 Type m_resType;
00089 long m_resLong;
00091 double m_resDouble;
00093 MWAWEntry m_resString;
00095 int m_format;
00097 MWAWFont m_font;
00099 int m_justify;
00101 int m_borders;
00102 };
00104 struct Column {
00106 Column() : m_idRecordMap() {
00107 }
00109 std::map<int,Record> m_idRecordMap;
00110 };
00111
00113 bool readColumnList();
00115 bool readColumn(int c);
00117 bool readRecordList(Vec2i const &where, Column &col);
00119 bool readRecordSS(Vec2i const &where, long pos, Record &record);
00121 bool readRecordSSV1(Vec2i const &where, long pos, Record &record);
00123 bool readRecordDB(Vec2i const &where, long pos, Record &record);
00124
00126 void send(double val, CWStyleManager::CellFormat const &format);
00127
00129 int m_version;
00131 bool m_isSpreadsheet;
00132
00134 MWAWParserStatePtr m_parserState;
00136 shared_ptr<CWStyleManager> m_styleManager;
00137
00139 std::map<int, Column> m_idColumnMap;
00141 std::vector<CWStyleManager::CellFormat> m_dbFormatList;
00142 };
00143 #endif
00144
00145
00146