• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

fd_Field.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 2000 AbiSource, Inc.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
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     // TBD: convention for naming
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     // probably need different types of update
00120     // which are overridden in the appropriate subclass
00121     // eg positionChangeUpdate
00122     //    referenceChangeUpdate
00123  protected:
00124     bool                            _deleteSpan(void);
00125     void                            _throwChangeRec(PT_DocPosition docPos);
00126     fl_BlockLayout * m_pBlock;
00127     // will need some more helper functions in here eg. to test
00128     // whether text has changed to avoid unnecessary updates
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 

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1