Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes

IE_Exp Class Reference

#include <ie_exp.h>

Inheritance diagram for IE_Exp:
IE_Exp_Applix IE_Exp_Cairo IE_Exp_DocBook IE_Exp_EPUB IE_Exp_HRText IE_Exp_HTML IE_Exp_KWord_1 IE_Exp_LaTeX IE_Exp_MIF IE_Exp_MsWord_97 IE_Exp_OpenDocument IE_Exp_OpenWriter IE_Exp_OpenXML IE_Exp_Passepartout IE_Exp_Psion IE_Exp_RTF IE_Exp_S5 IE_Exp_Text IE_Exp_WML IE_Exp_WordPerfect IE_Exp_XML IE_Exp_XSL_FO

List of all members.

Public Member Functions

virtual ~IE_Exp ()
UT_Error writeFile (const char *szFilename)
UT_Error writeFile (GsfOutput *fp)
virtual UT_Error copyToBuffer (PD_DocumentRange *pDocRange, UT_ByteBuf *pBuf)
virtual void write (const char *sz)
virtual void write (const char *sz, UT_uint32 length)
virtual char rewindChar (void)
void write (const std::string &inStr)
void write (const UT_String &inStr)
virtual const char * getFileName (void) const
UT_Confidence_t getFidelity () const
void setProps (const char *props)
bool isCopying () const
void populateFields ()
std::string getProperty (const std::string &key) const

Static Public Member Functions

static IEFileType fileTypeForSuffix (const char *szSuffix)
static IEFileType fileTypeForMimetype (const char *szMimetype)
static IEFileType fileTypeForDescription (const char *szSuffix)
static IEFileType fileTypeForSuffixes (const char *suffixList)
static IE_ExpSniffersnifferForFileType (IEFileType ieft)
static const char * suffixesForFileType (IEFileType ieft)
static const char * descriptionForFileType (IEFileType ieft)
static UT_UTF8String preferredSuffixForFileType (IEFileType ieft)
static UT_Error constructExporter (PD_Document *pDocument, const char *szFilename, IEFileType ieft, IE_Exp **ppie, IEFileType *pieft=NULL)
static UT_Error constructExporter (PD_Document *pDocument, GsfOutput *output, IEFileType ieft, IE_Exp **ppie, IEFileType *pieft=NULL)
static bool enumerateDlgLabels (UT_uint32 ndx, const char **pszDesc, const char **pszSuffixList, IEFileType *ft)
static UT_uint32 getExporterCount (void)
static void registerExporter (IE_ExpSniffer *)
static void unregisterExporter (IE_ExpSniffer *)
static void unregisterAllExporters ()
static UT_Error writeBufferToFile (const UT_ConstByteBufPtr &pByteBuf, const std::string &imagedir, const std::string &filename)

Protected Member Functions

 IE_Exp (PD_Document *pDocument, UT_Confidence_t fidelity=0)
virtual UT_Error _writeDocument (void)=0
GsfOutput * openFile (const char *szFilename)
virtual GsfOutput * _openFile (const char *szFilename)
virtual UT_uint32 _writeBytes (const UT_Byte *pBytes, UT_uint32 length)
virtual bool _writeBytes (const UT_Byte *sz)
virtual void _abortFile (void)
void _cancelExport ()
bool _closeFile (void)
PD_DocumentgetDoc () const
PD_DocumentRangegetDocRange () const
GsfOutput * getFp () const
 Return the file pointer, for convenience.
void _setByteBuf (UT_ByteBuf *pBuf)
UT_ByteBuf_getByteBuf (void) const

Protected Attributes

bool m_error

Private Attributes

PD_Documentm_pDocument
PD_DocumentRangem_pDocRange
UT_ByteBufm_pByteBuf
std::string m_szFileName
GsfOutput * m_fp
bool m_bOwnsFp
bool m_bCancelled
std::map< std::string,
std::string > 
m_props_map
UT_Confidence_t m_fidelity
IE_FieldUpdaterm_fieldUpdater

Constructor & Destructor Documentation

IE_Exp::~IE_Exp (  )  [virtual]
IE_Exp::IE_Exp ( PD_Document pDocument,
UT_Confidence_t  fidelity = 0 
) [protected]

Member Function Documentation

void IE_Exp::_abortFile ( void   )  [protected, virtual]

Reimplemented in IE_Exp_MsWord_97.

References _closeFile(), m_fp, m_szFileName, UT_DEBUGMSG, and UT_go_file_remove().

Referenced by writeFile().

void IE_Exp::_cancelExport (  )  [inline, protected]
bool IE_Exp::_closeFile ( void   )  [protected]
UT_ByteBuf* IE_Exp::_getByteBuf ( void   )  const [inline, protected]

Referenced by IE_Exp_RTF::getByteBuf().

GsfOutput * IE_Exp::_openFile ( const char *  szFilename  )  [protected, virtual]

Reimplemented in IE_Exp_OpenDocument, and IE_Exp_MsWord_97.

References UT_go_file_create().

Referenced by openFile().

void IE_Exp::_setByteBuf ( UT_ByteBuf pBuf  )  [inline, protected]

Referenced by IE_Exp_RTF::setByteBuf().

bool IE_Exp::_writeBytes ( const UT_Byte sz  )  [protected, virtual]

Reimplemented in IE_Exp_PalmDoc, and IE_Exp_MsWord_97.

References _writeBytes().

UT_uint32 IE_Exp::_writeBytes ( const UT_Byte pBytes,
UT_uint32  length 
) [protected, virtual]

Reimplemented in IE_Exp_PalmDoc, and IE_Exp_MsWord_97.

References m_fp.

Referenced by _writeBytes(), and write().

UT_Error IE_Exp::constructExporter ( PD_Document pDocument,
GsfOutput *  output,
IEFileType  ieft,
IE_Exp **  ppie,
IEFileType pieft = NULL 
) [static]
UT_Error IE_Exp::constructExporter ( PD_Document pDocument,
const char *  szFilename,
IEFileType  ieft,
IE_Exp **  ppie,
IEFileType pieft = NULL 
) [static]

Construct an exporter of the right type.

Parameters:
pDocument Document
szFilename Name of file - optional
ieft Desired filetype - pass IEFT_Unknown for best guess
ppie Pointer to return importer in
pieft Pointer to fill in actual filetype

Caller is responsible for deleting the exporter object when finished with it. This function should closely match IE_Imp::contructImporter()

References IE_ExpSniffer::constructExporter(), fileTypeForSuffix(), getExporterCount(), IEFT_Bogus, IEFT_Unknown, m_sniffers, s, IE_ExpSniffer::supportsFileType(), UT_ERROR, UT_IE_NOMEMORY, UT_OK, UT_pathSuffix(), and UT_return_val_if_fail.

Referenced by PD_Document::_save(), PD_Document::_saveAs(), abi_widget_get_selection(), constructExporter(), IE_Exp_OpenDocument::copyToBuffer(), IE_Exp_HTML::copyToBuffer(), and AP_UnixApp::copyToClipboard().

const char * IE_Exp::descriptionForFileType ( IEFileType  ieft  )  [static]

Find the description for the given filetype.

Parameters:
ieft Numerical "export filetype" ID

Returns 0 if filetype doesn't exist. This function should closely resemble IE_Exp::descriptionForFileType()

References IE_ExpSniffer::getDlgLabels(), snifferForFileType(), UT_ASSERT_HARMLESS, and UT_SHOULD_NOT_HAPPEN.

bool IE_Exp::enumerateDlgLabels ( UT_uint32  ndx,
const char **  pszDesc,
const char **  pszSuffixList,
IEFileType ft 
) [static]
IEFileType IE_Exp::fileTypeForDescription ( const char *  szDescription  )  [static]

Find the filetype for the given filetype description.

Parameters:
szDescription Filetype description

Returns IEFT_Unknown if no importer has this description. This function should closely resemble IE_Exp::fileTypeForDescription()

References IE_ExpSniffer::getDlgLabels(), getExporterCount(), m_sniffers, UT_ASSERT_HARMLESS, and UT_SHOULD_NOT_HAPPEN.

IEFileType IE_Exp::fileTypeForMimetype ( const char *  szMimetype  )  [static]

Find the filetype for the given mimetype.

Parameters:
szMimetype File mimetype

Returns IEFT_AbiWord_1 if no exporter knows this mimetype. Note that more than one exporter may support a mimetype. We return the first one we find. This function should closely resemble IE_Exp::fileTypeForMimetype()

References fileTypeForSuffix(), getExporterCount(), IEFT_Unknown, m_sniffers, s, IE_ExpSniffer::supportsFileType(), IE_ExpSniffer::supportsMIME(), UT_DEBUGMSG, and UT_return_val_if_fail.

Referenced by AP_Convert::convertTo(), IE_Exp_OpenDocument::copyToBuffer(), IE_Exp_HTML::copyToBuffer(), AP_UnixApp::copyToClipboard(), getExportFileType(), and s_abi_widget_get_file_type().

IEFileType IE_Exp::fileTypeForSuffix ( const char *  szSuffix  )  [static]
IEFileType IE_Exp::fileTypeForSuffixes ( const char *  suffixList  )  [static]
PD_Document * IE_Exp::getDoc ( void   )  const [protected]

References m_pDocument.

Referenced by IE_Exp_HTML::_buildStyleTree(), IE_Exp_WordPerfect::_constructListener(), IE_Exp_Text::_constructListener(), IE_Exp_Psion_TextEd::_constructListener(), IE_Exp_Psion_Word::_constructListener(), IE_Exp_Passepartout::_constructListener(), IE_Exp_ISCII::_constructListener(), IE_Exp_HTML::_createChapter(), IE_Exp_HTML::_createMultipart(), IE_Exp_Text::_doEncodingDialog(), IE_Exp_RTF::_output_ListRTF(), IE_Exp_RTF::_output_MultiLevelRTF(), IE_Exp_RTF::_output_revision(), IE_Exp_RTF::_output_SimpleListRTF(), IE_Exp_RTF::_selectStyles(), IE_Exp_RTF::_write_charfmt(), IE_Exp_RTF::_write_listtable(), IE_Exp_RTF::_write_parafmt(), IE_Exp_RTF::_write_rtf_header(), IE_Exp_RTF::_write_stylesheets(), IE_Exp_XSL_FO::_writeDocument(), IE_Exp_WordPerfect::_writeDocument(), IE_Exp_WML::_writeDocument(), IE_Exp_Text::_writeDocument(), IE_Exp_S5::_writeDocument(), IE_Exp_Psion::_writeDocument(), IE_Exp_Cairo::_writeDocument(), IE_Exp_Passepartout::_writeDocument(), IE_Exp_OpenWriter::_writeDocument(), IE_Exp_OpenDocument::_writeDocument(), IE_Exp_MsWord_97::_writeDocument(), IE_Exp_MIF::_writeDocument(), IE_Exp_LaTeX::_writeDocument(), IE_Exp_KWord_1::_writeDocument(), IE_Exp_HTML::_writeDocument(), IE_Exp_HRText::_writeDocument(), IE_Exp_EPUB::_writeDocument(), IE_Exp_DocBook::_writeDocument(), IE_Exp_Applix::_writeDocument(), IE_Exp_AbiWord_1::_writeDocument(), IE_Exp_RTF::_writeDocumentLocal(), IE_Exp_S5::_writeHeader(), IE_Exp_S5::_writeSlide(), IE_Exp_EPUB::EPUB2_writeNavigation(), IE_Exp_EPUB::EPUB2_writeStructure(), IE_Exp_EPUB::EPUB3_writeStructure(), IE_Exp_RTF::exportHdrFtr(), IE_Exp_EPUB::getAuthor(), IE_Exp_EPUB::getLanguage(), IE_Exp_EPUB::getTitle(), IE_Exp_EPUB::package(), populateFields(), and IE_Exp_HTML::setWriterFactory().

UT_Confidence_t IE_Exp::getFidelity (  )  const [inline]
GsfOutput * IE_Exp::openFile ( const char *  szFilename  )  [protected]

References _openFile(), file, m_fp, m_szFileName, and UT_return_val_if_fail.

Referenced by writeFile().

UT_UTF8String IE_Exp::preferredSuffixForFileType ( IEFileType  ieft  )  [static]

Find the preferred suffix for the given filetype.

Parameters:
szSuffix File suffix

Returns "" if no exporter knows this filetype.

References IE_ExpSniffer::getPreferredSuffix(), snifferForFileType(), and UT_return_val_if_fail.

Referenced by AppendDefaultSuffixFunctorUsing_IE_Exp_preferredSuffixForFileType(), AP_Convert::convertTo(), and XAP_UnixDialog_FileOpenSaveAs::runModal().

void IE_Exp::registerExporter ( IE_ExpSniffer s  )  [static]
char IE_Exp::rewindChar ( void   )  [virtual]

This method deletes the last char in the output buffer. The value of the character at the last position is returned.

References UT_ByteBuf::del(), UT_ByteBuf::getLength(), UT_ByteBuf::getPointer(), and m_pByteBuf.

void IE_Exp::setProps ( const char *  props  ) 
IE_ExpSniffer * IE_Exp::snifferForFileType ( IEFileType  ieft  )  [static]

Find the filetype sniffer for the given filetype.

Parameters:
ieft Filetype

Returns 0 if no exporter knows this filetype. This function should closely resemble IE_Exp::snifferForFileType()

References getExporterCount(), m_sniffers, s, and IE_ExpSniffer::supportsFileType().

Referenced by XAP_UnixDialog_FileOpenSaveAs::_run_gtk_main(), descriptionForFileType(), preferredSuffixForFileType(), and suffixesForFileType().

const char * IE_Exp::suffixesForFileType ( IEFileType  ieft  )  [static]

Find the suffixes for the given filetype.

Parameters:
szSuffix File suffix

Returns 0 if no exporter knows this filetype. This function should closely resemble IE_Exp::suffixesForFileType()

References IE_ExpSniffer::getDlgLabels(), snifferForFileType(), UT_ASSERT_HARMLESS, UT_return_val_if_fail, and UT_SHOULD_NOT_HAPPEN.

Referenced by PD_Document::_syncFileTypes().

void IE_Exp::unregisterAllExporters (  )  [static]

References DELETEP, m_sniffers, and size.

Referenced by IE_ImpExp_UnRegisterXP().

void IE_Exp::unregisterExporter ( IE_ExpSniffer s  )  [static]
void IE_Exp::write ( const char *  sz  )  [virtual]

Reimplemented in IE_Exp_MsWord_97.

Referenced by s_WML_Listener::_closeAnchor(), s_WML_Listener::_closeBlock(), Text_Listener::_closeBlock(), Passepartout_Listener::_closeBlock(), s_LaTeX_Listener::_closeBlock(), s_KWord_1_Listener::_closeBlock(), s_WML_Listener::_closeCell(), s_LaTeX_Listener::_closeCell(), Passepartout_Listener::_closeFont(), s_WML_Listener::_closeHyperlink(), s_LaTeX_Listener::_closeList(), s_LaTeX_Listener::_closeParagraph(), s_WML_Listener::_closeRow(), s_LaTeX_Listener::_closeSection(), s_KWord_1_Listener::_closeSection(), s_WML_Listener::_closeSpan(), s_LaTeX_Listener::_closeSpan(), s_HRText_Listener::_closeSpan(), s_WML_Listener::_closeTable(), s_LaTeX_Listener::_closeTable(), s_HRText_Listener::_closeTag(), IE_Exp_HTML::_createMultipart(), s_WML_Listener::_emitTOC(), s_RTF_ListenerWriteDoc::_exportCellProps(), s_Applix_Listener::_flush(), s_KWord_1_Listener::_handleAttributes(), s_WML_Listener::_handleBookmark(), s_WML_Listener::_handleEmbedded(), s_XSL_FO_Listener::_handleField(), s_WML_Listener::_handleField(), s_DocBook_Listener::_handleField(), s_WML_Listener::_handleHyperlink(), s_WML_Listener::_handleImage(), s_LaTeX_Listener::_handleImage(), s_DocBook_Listener::_handleImage(), s_WML_Listener::_handleMath(), s_WML_Listener::_handleMetaData(), s_DocBook_Listener::_handleMetaData(), s_XSL_FO_Listener::_handlePageSize(), s_KWord_1_Listener::_handlePageSize(), s_DocBook_Listener::_handlePositionedImage(), s_DocBook_Listener::_handleRevisions(), s_KWord_1_Listener::_handleStyles(), s_DocBook_Listener::_handleTOC(), s_DocBook_Listener::_initFile(), s_RTF_ListenerWriteDoc::_newRow(), Passepartout_Listener::_openBlock(), s_KWord_1_Listener::_openBlock(), s_WML_Listener::_openCell(), s_LaTeX_Listener::_openCell(), Passepartout_Listener::_openFont(), s_RTF_ListenerWriteDoc::_openFrame(), s_XSL_FO_Listener::_openListItem(), s_WML_Listener::_openParagraph(), s_LaTeX_Listener::_openParagraph(), s_WML_Listener::_openRow(), s_WML_Listener::_openSection(), s_LaTeX_Listener::_openSection(), s_KWord_1_Listener::_openSection(), s_HRText_Listener::_openSection(), s_WML_Listener::_openSpan(), s_LaTeX_Listener::_openSpan(), s_KWord_1_Listener::_openSpan(), s_HRText_Listener::_openSpan(), s_WML_Listener::_openTable(), s_LaTeX_Listener::_openTable(), s_RTF_ListenerWriteDoc::_openTag(), s_HRText_Listener::_openTag(), IE_Exp_RTF::_output_LevelText(), s_LaTeX_Listener::_outputBabelPackage(), s_RTF_ListenerWriteDoc::_outputCellBorders(), s_XSL_FO_Listener::_outputData(), Text_Listener::_outputData(), Passepartout_Listener::_outputData(), s_LaTeX_Listener::_outputData(), s_KWord_1_Listener::_outputData(), s_HRText_Listener::_outputData(), s_DocBook_Listener::_outputData(), s_WML_Listener::_outputDataUnchecked(), s_RTF_ListenerWriteDoc::_outputTableBorders(), IE_Exp_RTF::_rtf_chardata(), IE_Exp_RTF::_rtf_close_brace(), IE_Exp_RTF::_rtf_fontname(), IE_Exp_RTF::_rtf_keyword(), IE_Exp_RTF::_rtf_keyword_hex2(), IE_Exp_RTF::_rtf_keyword_ifnotdefault(), IE_Exp_RTF::_rtf_keyword_ifnotdefault_twips(), IE_Exp_RTF::_rtf_keyword_space(), IE_Exp_RTF::_rtf_nl(), IE_Exp_RTF::_rtf_nonascii_hex2(), IE_Exp_RTF::_rtf_open_brace(), IE_Exp_RTF::_rtf_pcdata(), IE_Exp_RTF::_rtf_semi(), s_XSL_FO_Listener::_tagClose(), s_DocBook_Listener::_tagClose(), s_XSL_FO_Listener::_tagOpen(), s_DocBook_Listener::_tagOpen(), s_XSL_FO_Listener::_tagOpenClose(), s_DocBook_Listener::_tagOpenClose(), IE_Exp_S5::_write(), s_Applix_Listener::_write(), IE_Exp_RTF::_write_parafmt(), IE_Exp_WordPerfect::_writeDocument(), IE_Exp_Psion::_writeDocument(), IE_Exp_HTML::_writeDocument(), IE_Exp_EML::_writeDocument(), s_RTF_ListenerWriteDoc::_writeFieldPreamble(), s_RTF_ListenerWriteDoc::_writeFieldTrailer(), IE_Exp_S5::_writeFooter(), IE_Exp_S5::_writeHeader(), s_RTF_ListenerWriteDoc::_writeHyperlink(), s_KWord_1_Listener::_writeMarginSize(), IE_Exp_S5::_writeSlide(), s_RTF_ListenerWriteDoc::_writeSPNumProp(), copyToBuffer(), IE_Exp_DocBook::iwrite(), Passepartout_Listener::Passepartout_Listener(), s_RTF_ListenerWriteDoc::populate(), s_LaTeX_Listener::populate(), Text_Listener::populateStrux(), s_LaTeX_Listener::populateStrux(), s_KWord_1_Listener::s_KWord_1_Listener(), s_LaTeX_Listener::s_LaTeX_Listener(), s_WML_Listener::s_WML_Listener(), s_XSL_FO_Listener::s_XSL_FO_Listener(), IE_Exp_DocBook::writeln(), Passepartout_Listener::~Passepartout_Listener(), s_KWord_1_Listener::~s_KWord_1_Listener(), s_LaTeX_Listener::~s_LaTeX_Listener(), and s_WML_Listener::~s_WML_Listener().

void IE_Exp::write ( const std::string &  inStr  )  [inline]

References tls_tunnel::write().

void IE_Exp::write ( const char *  sz,
UT_uint32  length 
) [virtual]
void IE_Exp::write ( const UT_String inStr  )  [inline]
UT_Error IE_Exp::writeBufferToFile ( const UT_ConstByteBufPtr pByteBuf,
const std::string &  imagedir,
const std::string &  filename 
) [static]
UT_Error IE_Exp::writeFile ( GsfOutput *  fp  ) 

Member Data Documentation

bool IE_Exp::m_bCancelled [private]

Referenced by writeFile().

bool IE_Exp::m_bOwnsFp [private]

Referenced by _closeFile(), and writeFile().

GsfOutput* IE_Exp::m_fp [private]
std::map<std::string, std::string> IE_Exp::m_props_map [private]

Referenced by getProperty(), and setProps().

std::string IE_Exp::m_szFileName [private]

The documentation for this class was generated from the following files: