filters
xsltimport.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <xsltimport.h>
00021 #include <xsltimport.moc>
00022 #include <kdebug.h>
00023 #include <KoFilterChain.h>
00024 #include <kgenericfactory.h>
00025 #include <kglobal.h>
00026 #include <klocale.h>
00027 #include <qtextcodec.h>
00028 #include "xsltimportdia.h"
00029
00030
00031 typedef KGenericFactory<XSLTImport, KoFilter> XSLTImportFactory;
00032 K_EXPORT_COMPONENT_FACTORY( libxsltimport, XSLTImportFactory( "kofficefilters" ) )
00033
00034
00035 XSLTImport::XSLTImport(KoFilter *, const char *, const QStringList&) :
00036 KoFilter() {
00037 }
00038
00039 KoFilter::ConversionStatus XSLTImport::convert( const QCString&, const QCString& to )
00040 {
00041 QString config;
00042
00043 if(to != "application/x-kword" &&
00044 to != "application/x-kontour" && to != "application/x-kspread" &&
00045 to != "application/x-kivio" && to != "application/x-kchart" &&
00046 to != "application/x-kpresenter")
00047 return KoFilter::NotImplemented;
00048
00049
00050 KoStore* out = KoStore::createStore(QString(m_chain->outputFile()), KoStore::Write);
00051 if(!out || !out->open("root"))
00052 {
00053 kdError() << "Unable to create output file!" << endl;
00054 delete out;
00055 return KoFilter::FileNotFound;
00056 }
00057
00058 out->close();
00059 kdDebug() << "here" << endl;
00060 XSLTImportDia* dialog = new XSLTImportDia(out, to, 0, "Importation", true);
00061 dialog->setInputFile(m_chain->inputFile());
00062
00063 dialog->exec();
00064 delete dialog;
00065 delete out;
00066
00067 return KoFilter::OK;
00068 }
|