00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef FIELD_H
00020 #define FIELD_H
00021
00022 #include "ut_types.h"
00023 #include "ut_xml.h"
00024 #include "pf_Frag_Object.h"
00025 #include "pf_Frag_Text.h"
00026 #include "pt_Types.h"
00027
00028 class fl_BlockLayout;
00029 class pf_Frag_Object;
00030
00036 class ABI_EXPORT fd_Field
00037 {
00038 public:
00039
00040 enum FieldType
00041 {
00042 FD_None,
00043 FD_Test,
00044 FD_MartinTest,
00045 FD_Time,
00046 FD_PageNumber,
00047 FD_PageCount,
00048 FD_ListLabel,
00049 FD_FileName,
00050 FD_Date,
00051
00052 FD_Date_MMDDYY,
00053 FD_Date_DDMMYY,
00054 FD_Date_MDY,
00055 FD_Date_MthDY,
00056 FD_Date_DFL,
00057 FD_Date_NTDFL,
00058 FD_Date_Wkday,
00059 FD_Date_DOY,
00060
00061 FD_Time_MilTime,
00062 FD_Time_AMPM,
00063 FD_Time_Zone,
00064 FD_Time_Epoch,
00065
00066 FD_Table_sum_rows,
00067 FD_Table_sum_cols,
00068
00069 FD_DateTime_Custom,
00070
00071 FD_Doc_WordCount,
00072 FD_Doc_CharCount,
00073 FD_Doc_LineCount,
00074 FD_Doc_ParaCount,
00075 FD_Doc_NbspCount,
00076
00077 FD_App_Version,
00078 FD_App_ID,
00079 FD_App_Options,
00080 FD_App_Target,
00081 FD_App_CompileTime,
00082 FD_App_CompileDate,
00083
00084 FD_Endnote_Ref,
00085 FD_Endnote_Anchor,
00086
00087 FD_Footnote_Ref,
00088 FD_Footnote_Anchor,
00089
00090 FD_PageReference,
00091 FD_MailMerge,
00092
00093 FD_Meta_Title,
00094 FD_Meta_Creator,
00095 FD_Meta_Subject,
00096 FD_Meta_Publisher,
00097 FD_Meta_Date,
00098 FD_Meta_Date_Last_Changed,
00099 FD_Meta_Type,
00100 FD_Meta_Language,
00101 FD_Meta_Rights,
00102 FD_Meta_Keywords,
00103 FD_Meta_Contributor,
00104 FD_Meta_Coverage,
00105 FD_Meta_Description,
00106
00107 __last_field_dont_use__
00108 };
00109
00110 fd_Field(pf_Frag_Object& fO, pt_PieceTable * pt, FieldType fieldType, const gchar *pParam);
00111 virtual ~fd_Field(void);
00112 bool update(void);
00113 void setBlock(fl_BlockLayout * pBlock);
00114 fl_BlockLayout * getBlock( void) const;
00115 FieldType getFieldType(void) const;
00116 gchar * getValue(void) const;
00117 void setValue(const gchar * szValue);
00118 const gchar * getParameter(void) const {return static_cast<const gchar *>(m_pParameter);};
00119
00120
00121
00122
00123 protected:
00124 bool _deleteSpan(void);
00125 void _throwChangeRec(PT_DocPosition docPos);
00126 fl_BlockLayout * m_pBlock;
00127
00128
00129 private:
00130 pf_Frag_Object& m_fragObject;
00131 pt_PieceTable * m_pPieceTable;
00132 UT_uint32 m_updateCount;
00133 FieldType m_iFieldType;
00134 gchar * m_szValue;
00135 gchar * m_pParameter;
00136 };
00137
00138 #endif
00139
00140
00141
00142