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 #ifndef _ODI_TEXTCONTENT_LISTENERSTATE_H_
00026 #define _ODI_TEXTCONTENT_LISTENERSTATE_H_
00027
00028 #include <string>
00029 #include <map>
00030 #include <set>
00031
00032
00033 #include "../../common/xp/ODc_util.h"
00034 #include "ODi_ListenerState.h"
00035
00036
00037 #include <ut_types.h>
00038 #include <ut_stack.h>
00039
00040
00041 #include <gsf/gsf.h>
00042
00043
00044 class ODi_Office_Styles;
00045 class ODi_Style_List;
00046 class ODi_TableOfContent_ListenerState;
00047 class ODi_Abi_Data;
00048
00049
00050 class PD_Document;
00051 class pf_Frag_Strux;
00052
00053 #include <list>
00054
00077 class ODi_TextContent_ListenerState : public ODi_ListenerState {
00078
00079 public:
00080
00081 ODi_TextContent_ListenerState (
00082 PD_Document* pDocument,
00083 ODi_Office_Styles* pStyles,
00084 ODi_ElementStack& rElementStack,
00085 ODi_Abi_Data & rAbiData);
00086
00087 virtual ~ODi_TextContent_ListenerState();
00088
00089 void startElement (const gchar* pName, const gchar** ppAtts,
00090 ODi_ListenerStateAction& rAction);
00091
00092 void endElement (const gchar* pName, ODi_ListenerStateAction& rAction);
00093
00094 void charData (const gchar* pBuffer, int length);
00095
00096 private:
00097
00098 void _insertBookmark (const gchar * name, const gchar * type, const gchar* xmlid = 0 );
00099 void _flush ();
00100 void _startParagraphElement (const gchar* pName,
00101 const gchar** ppParagraphAtts,
00102 ODi_ListenerStateAction& rAction);
00103 void _endParagraphElement (const gchar* pName,
00104 ODi_ListenerStateAction& rAction);
00105 bool _pushInlineFmt(const gchar** ppAtts);
00106 void _popInlineFmt(void);
00107 void _insureInBlock(const gchar ** atts);
00108 void _insureInSection(const UT_UTF8String* pMasterPageName = NULL);
00109 void _openAbiSection(const UT_UTF8String& rProps,
00110 const UT_UTF8String* pMasterPageName = NULL);
00111 void _defineAbiTOCHeadingStyles();
00112 void _flushPendingParagraphBreak();
00113 void _insertAnnotation(void);
00114
00115 PD_Document* m_pAbiDocument;
00116 ODi_Office_Styles* m_pStyles;
00117
00118 bool m_bAcceptingText;
00119 bool m_bOpenedBlock;
00120
00121 bool m_inAbiSection;
00122 bool m_openedFirstAbiSection;
00123 bool m_bPendingSection;
00124 UT_UTF8String m_currentPageMarginLeft;
00125 UT_UTF8String m_currentPageMarginRight;
00126
00127
00128
00129
00130
00131
00132
00133 UT_UTF8String m_pendingParagraphBreak;
00134
00135 enum ODi_CurrentODSection {
00136
00137 ODI_SECTION_NONE,
00138
00139
00140
00141 ODI_SECTION_MAPPED,
00142
00143
00144
00145 ODI_SECTION_IGNORED,
00146
00147
00148 ODI_SECTION_UNDEFINED
00149 } m_currentODSection;
00150
00151 UT_GenericVector<const gchar*> m_vecInlineFmt;
00152 UT_NumberStack m_stackFmtStartIndex;
00153
00154 UT_sint8 m_elementParsingLevel;
00155
00156
00157
00158 UT_UCS4String m_charData;
00159
00166
00167 UT_GenericVector<pf_Frag_Strux*> m_tablesOfContent;
00168 UT_GenericVector<UT_UTF8String*> m_tablesOfContentProps;
00169
00170
00171 std::map<std::string, std::string> m_headingStyles;
00172 ODi_TableOfContent_ListenerState* m_pCurrentTOCParser;
00173
00174
00175
00176 bool m_bOnContentStream;
00177
00178
00179 ODi_Style_List* m_pCurrentListStyle;
00180 UT_uint8 m_listLevel;
00181 bool m_alreadyDefinedAbiParagraphForList;
00182
00183
00184 bool m_pendingNoteAnchorInsertion;
00185 UT_UTF8String m_currentNoteId;
00186
00187
00188 bool m_bPendingAnnotation;
00189 bool m_bPendingAnnotationAuthor;
00190 bool m_bPendingAnnotationDate;
00191 UT_uint32 m_iAnnotation;
00192 std::string m_sAnnotationAuthor;
00193 std::string m_sAnnotationDate;
00194 std::string m_sAnnotationName;
00195 std::string m_sAnnotationXMLID;
00196 std::set< std::string > m_openAnnotationNames;
00197
00198
00199 std::list< std::string > xmlidStackForTextMeta;
00200 std::map< std::string, std::string > xmlidMapForBookmarks;
00201
00202
00203 bool m_bPageReferencePending;
00204 UT_sint32 m_iPageNum;
00205 double m_dXpos;
00206 double m_dYpos;
00207 UT_UTF8String m_sProps;
00208 ODi_Abi_Data& m_rAbiData;
00209 bool m_bPendingTextbox;
00210 bool m_bHeadingList;
00211 UT_sint32 m_prevLevel;
00212 bool m_bContentWritten;
00213 };
00214
00215 #endif //_ODI_TEXTCONTENT_LISTENERSTATE_H_