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 #ifndef WPS8_TEXTSTYLE_H
00023 #define WPS8_TEXTSTYLE_H
00024
00025 #include <ostream>
00026 #include <string>
00027 #include <vector>
00028
00029 #include "libwps_internal.h"
00030
00031 #include "WPSDebug.h"
00032
00033 namespace WPS8Struct
00034 {
00035 struct FileData;
00036 }
00037
00038 namespace WPS8TextStyleInternal
00039 {
00040 struct State;
00041 }
00042
00043 class WPS8Text;
00044
00045 class WPS8TextStyle
00046 {
00047 friend class WPS8Text;
00048 public:
00049 struct FontData;
00050
00051 WPS8TextStyle(WPS8Text &parser);
00052 ~WPS8TextStyle();
00053
00055 void setListener(WPSContentListenerPtr &listen)
00056 {
00057 m_listener = listen;
00058 }
00059
00061 bool readStructures();
00062
00063 protected:
00065 bool readFontNames(WPSEntry const &entry);
00067 bool readFont(long endPos, int &id, std::string &mess);
00068
00069 void sendFont(int fId, FontData &data);
00070
00072 bool readParagraph(long endPos, int &id, std::string &mess);
00073
00074 void sendParagraph(int pId);
00075
00078 bool readSTSH(WPSEntry const &entry);
00079
00081 bool readSGP(WPSEntry const &entry);
00082
00083
00084
00085
00086
00089 bool findFDPStructures(int which, std::vector<WPSEntry> &result);
00092 bool findFDPStructuresByHand(int which, std::vector<WPSEntry> &result);
00093
00094 protected:
00096 libwps::DebugFile &ascii()
00097 {
00098 return m_asciiFile;
00099 }
00100
00101 private:
00103 WPS8TextStyle(WPS8TextStyle const &orig);
00105 WPS8TextStyle &operator=(WPS8TextStyle const &orig);
00106
00107 protected:
00109 WPS8Text &m_mainParser;
00111 RVNGInputStreamPtr m_input;
00113 WPSContentListenerPtr m_listener;
00115 mutable shared_ptr<WPS8TextStyleInternal::State> m_state;
00117 libwps::DebugFile &m_asciiFile;
00118 public:
00119 struct FontData
00120 {
00121 FontData() : m_type(T_None), m_fieldType(F_None), m_fieldFormat(0) {}
00123 friend std::ostream &operator<<(std::ostream &o, FontData const &fData);
00125 std::string format() const;
00126
00127 enum { T_None=0, T_Object=2, T_Footnote=3, T_Endnote=4, T_Field=5, T_Comment=6 };
00129 int m_type;
00130 enum { F_None=0, F_PageNumber=-1, F_Date=-4, F_Time=-5 };
00132 int m_fieldType;
00134 int m_fieldFormat;
00135 };
00136 protected:
00137 };
00138
00139
00140 #endif
00141