1
// $Header: /home/kde/koffice/filters/kword/html/export/htmlexport.cc,v 1.17 2003/08/16 12:22:48 mueller Exp $
4
This file is part of the KDE project
5
Copyright (C) 2001, 2002 Nicolas GOUTTE <goutte@kde.org>
7
This library is free software; you can redistribute it and/or
8
modify it under the terms of the GNU Library General Public
9
License as published by the Free Software Foundation; either
10
version 2 of the License, or (at your option) any later version.
12
This library is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
Library General Public License for more details.
17
You should have received a copy of the GNU Library General Public License
18
along with this library; see the file COPYING.LIB. If not, write to
19
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
Boston, MA 02111-1307, USA.
24
This file is based on the old file:
25
/home/kde/koffice/filters/kword/ascii/asciiexport.cc
27
The old file was copyrighted by
28
Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
29
Copyright (c) 2000 ID-PRO Deutschland GmbH. All rights reserved.
30
Contact: Wolf-Michael Bolle <Bolle@ID-PRO.de>
32
The old file was licensed under the terms of the GNU Library General Public
37
#include <kgenericfactory.h>
38
#include <koFilterChain.h>
40
#include <KWEFBaseWorker.h>
41
#include <KWEFKWordLeader.h>
43
#include "ExportDialog.h"
44
#include "ExportFilter.h"
45
#include "ExportCss.h"
46
#include "ExportBasic.h"
47
#include "ExportDocStruct.h"
49
#include <htmlexport.h>
50
#include <htmlexport.moc>
52
typedef KGenericFactory<HTMLExport, KoFilter> HTMLExportFactory;
53
K_EXPORT_COMPONENT_FACTORY( libhtmlexport, HTMLExportFactory( "kwordhtmlexportfilter" ) )
59
HTMLExport::HTMLExport(KoFilter *, const char *, const QStringList &) :
63
KoFilter::ConversionStatus HTMLExport::convert( const QCString& from, const QCString& to )
65
if ((from != "application/x-kword") || (to != "text/html"))
67
return KoFilter::NotImplemented;
70
HtmlExportDialog dialog;
74
kdDebug(30503) << "Dialog was aborted! Aborting filter!" << endl;
75
return KoFilter::UserCancelled;
80
const HtmlExportDialog::Mode mode = dialog.getMode();
83
case HtmlExportDialog::Light:
84
worker=new HtmlDocStructWorker();
86
case HtmlExportDialog::Basic:
87
worker=new HtmlBasicWorker();
90
worker=new HtmlCssWorker();
93
worker->setXML(dialog.isXHtml());
94
worker->setCodec(dialog.getCodec());
96
KWEFKWordLeader* leader=new KWEFKWordLeader(worker);
100
kdError(30503) << "Cannot create Worker! Aborting!" << endl;
102
return KoFilter::StupidError;
104
KoFilter::ConversionStatus result=leader->convert(m_chain,from,to);