34#include <tqtextcodec.h>
37#include <kgenericfactory.h>
38#include <KoFilterChain.h>
39#include <KoFilterManager.h>
41#include <KWEFBaseWorker.h>
42#include <KWEFKWordLeader.h>
44#include "ExportDialog.h"
45#include "ExportFilter.h"
47#include "ExportBasic.h"
48#include "ExportDocStruct.h"
50#include <htmlexport.h>
51#include <htmlexport.moc>
53typedef KGenericFactory<HTMLExport, KoFilter> HTMLExportFactory;
54K_EXPORT_COMPONENT_FACTORY( libhtmlexport, HTMLExportFactory( "kofficefilters" ) )
60HTMLExport::HTMLExport(KoFilter *, const char *, const TQStringList &) :
64KoFilter::ConversionStatus HTMLExport::convert( const TQCString& from, const TQCString& to )
66 if ((from != "application/x-kword") || (to != "text/html"))
68 return KoFilter::NotImplemented;
72 if ( m_chain->manager() )
73 batch = m_chain->manager()->getBatchMode();
79 worker= new HtmlCssWorker();
81 worker->setCodec(TQTextCodec::codecForName( "UTF-8"));
85 HtmlExportDialog dialog;
89 kdDebug(30503) << "Dialog was aborted! Aborting filter!" << endl;
90 return KoFilter::UserCancelled;
93 const HtmlExportDialog::Mode mode = dialog.getMode();
96 case HtmlExportDialog::Light:
97 worker= new HtmlDocStructWorker();
99 case HtmlExportDialog::Basic:
100 worker= new HtmlBasicWorker();
102 case HtmlExportDialog::CustomCSS:
103 worker= new HtmlBasicWorker( dialog.cssURL() );
106 worker= new HtmlCssWorker();
109 worker->setXML(dialog.isXHtml());
110 worker->setCodec(dialog.getCodec());
113 KWEFKWordLeader* leader= new KWEFKWordLeader(worker);
117 kdError(30503) << "Cannot create Worker! Aborting!" << endl;
119 return KoFilter::StupidError;
121 KoFilter::ConversionStatus result=leader->convert(m_chain,from,to);
|