filters
latexexport.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <latexexport.h>
00022 #include <latexexport.moc>
00023 #include <kdebug.h>
00024 #include <KoFilterChain.h>
00025 #include <kgenericfactory.h>
00026 #include <kglobal.h>
00027 #include <klocale.h>
00028 #include <qtextcodec.h>
00029 #include "kwordlatexexportdia.h"
00030
00031 typedef KGenericFactory<LATEXExport, KoFilter> LATEXExportFactory;
00032 K_EXPORT_COMPONENT_FACTORY( libkwordlatexexport, LATEXExportFactory( "kofficefilters" ) )
00033
00034
00035 LATEXExport::LATEXExport(KoFilter *, const char *, const QStringList&) :
00036 KoFilter() {
00037 }
00038
00039 KoFilter::ConversionStatus LATEXExport::convert( const QCString& from, const QCString& to )
00040 {
00041 QString config;
00042
00043 if(to != "text/x-tex" || from != "application/x-kword")
00044 return KoFilter::NotImplemented;
00045
00046 KoStore* in = KoStore::createStore(m_chain->inputFile(), KoStore::Read);
00047 if(!in || !in->open("root")) {
00048 kdError(30503) << "Unable to open input file!" << endl;
00049 delete in;
00050 return KoFilter::FileNotFound;
00051 }
00052
00053 in->close();
00054
00055 KWordLatexExportDia* dialog = new KWordLatexExportDia(in);
00056 dialog->setOutputFile(m_chain->outputFile());
00057
00058 dialog->exec();
00059 delete dialog;
00060 delete in;
00061
00062 return KoFilter::OK;
00063 }
|