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_MWAW_STRUCT
00039 # define CW_MWAW_STRUCT
00040
00041 #include <iostream>
00042 #include <map>
00043 #include <set>
00044 #include <string>
00045 #include <vector>
00046
00047 #include "libmwaw_internal.hxx"
00048
00049 class CWParser;
00050
00052 namespace CWStruct
00053 {
00055 struct DSET {
00056 struct Child;
00057
00059 enum Type { T_Main=0, T_Header, T_Footer, T_Frame, T_Footnote, T_Table, T_Slide, T_Unknown};
00060
00062 DSET() : m_size(0), m_numData(0), m_dataSz(-1), m_headerSz(-1),
00063 m_type(T_Unknown), m_fileType(-1), m_id(0), m_fathersList(), m_validedChildList(),
00064 m_beginSelection(0), m_endSelection(-1), m_textType(0),
00065 m_childs(), m_otherChilds(), m_parsed(false), m_internal(0) {
00066 for (int i = 0; i < 4; i++) m_flags[i] = 0;
00067 }
00068
00070 virtual ~DSET() {}
00071
00073 bool okChildId(int zoneId) const {
00074 return m_validedChildList.find(zoneId) != m_validedChildList.end();
00075 }
00076
00078 friend std::ostream &operator<<(std::ostream &o, DSET const &doc);
00079
00081 long m_size;
00082
00084 long m_numData;
00085
00087 long m_dataSz;
00088
00090 long m_headerSz;
00091
00093 Type m_type;
00094
00096 int m_fileType;
00097
00099 int m_id;
00100
00102 std::set<int> m_fathersList;
00103
00105 std::set<int> m_validedChildList;
00106
00108 int m_beginSelection;
00109
00111 int m_endSelection;
00112
00114 int m_textType;
00115
00117 int m_flags[4];
00118
00120 std::vector<Child> m_childs;
00121
00123 std::vector<int> m_otherChilds;
00124
00126 mutable bool m_parsed;
00127
00129 mutable int m_internal;
00130
00132 struct Child {
00134 enum Type { ZONE, TEXT, GRAPHIC, TABLE, UNKNOWN };
00135
00137 Child() : m_type(UNKNOWN), m_id(-1), m_posC(-1), m_box() {
00138 }
00139
00141 friend std::ostream &operator<<(std::ostream &o, Child const &ch) {
00142 switch(ch.m_type) {
00143 case TEXT:
00144 o << "text,";
00145 break;
00146 case ZONE:
00147 o << "zone,";
00148 break;
00149 case GRAPHIC:
00150 o << "graphic,";
00151 break;
00152 case TABLE:
00153 o << "table,";
00154 break;
00155 case UNKNOWN:
00156 o << "#type,";
00157 default:
00158 break;
00159 }
00160 if (ch.m_id != -1) o << "id=" << ch.m_id << ",";
00161 if (ch.m_posC != -1) o << "posC=" << ch.m_posC << ",";
00162 if (ch.m_box.size().x() > 0 || ch.m_box.size().y() > 0)
00163 o << "box=" << ch.m_box << ",";
00164 return o;
00165 }
00166
00168 int m_type;
00170 int m_id;
00172 long m_posC;
00174 Box2i m_box;
00175 };
00176 };
00177 }
00178
00179 #endif
00180