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 WPS8TextStyleInternal
00034 {
00035 struct State;
00036 }
00037
00038 class WPS8Text;
00039
00040 class WPS8TextStyle
00041 {
00042 friend class WPS8Text;
00043 public:
00044 struct FontData;
00045
00046 WPS8TextStyle(WPS8Text &parser);
00047 ~WPS8TextStyle();
00048
00050 void setListener(WPSContentListenerPtr &listen)
00051 {
00052 m_listener = listen;
00053 }
00054
00056 bool readStructures();
00057
00058 protected:
00060 bool readFontNames(WPSEntry const &entry);
00062 bool readFont(long endPos, int &id, std::string &mess);
00063
00064 void sendFont(int fId, FontData &data);
00065
00067 bool readParagraph(long endPos, int &id, std::string &mess);
00068
00069 void sendParagraph(int pId);
00070
00073 bool readSTSH(WPSEntry const &entry);
00074
00076 bool readSGP(WPSEntry const &entry);
00077
00078
00079
00080
00081
00084 bool findFDPStructures(int which, std::vector<WPSEntry> &result);
00087 bool findFDPStructuresByHand(int which, std::vector<WPSEntry> &result);
00088
00089 protected:
00091 libwps::DebugFile &ascii()
00092 {
00093 return m_asciiFile;
00094 }
00095
00096 private:
00098 WPS8TextStyle(WPS8TextStyle const &orig);
00100 WPS8TextStyle &operator=(WPS8TextStyle const &orig);
00101
00102 protected:
00104 WPS8Text &m_mainParser;
00106 RVNGInputStreamPtr m_input;
00108 WPSContentListenerPtr m_listener;
00110 mutable shared_ptr<WPS8TextStyleInternal::State> m_state;
00112 libwps::DebugFile &m_asciiFile;
00113 public:
00114 struct FontData
00115 {
00116 FontData() : m_type(T_None), m_fieldType(F_None), m_fieldFormat(0) {}
00118 friend std::ostream &operator<<(std::ostream &o, FontData const &fData);
00120 std::string format() const;
00121
00122 enum { T_None=0, T_Object=2, T_Footnote=3, T_Endnote=4, T_Field=5, T_Comment=6 };
00124 int m_type;
00125 enum { F_None=0, F_PageNumber=-1, F_Date=-4, F_Time=-5 };
00127 int m_fieldType;
00129 int m_fieldFormat;
00130 };
00131 protected:
00132 };
00133
00134
00135 #endif
00136