Fix nepomukindexer usage, add minimal error handling.
[kdepim.git] / messageviewer / teehtmlwriter.h
blob7e476215b5b79c80b1dfab3c598b53bb17ae4e02
1 /* -*- c++ -*-
2 teehtmlwriter.h
4 This file is part of KMail, the KDE mail client.
5 Copyright (c) 2003 Marc Mutz <mutz@kde.org>
7 KMail is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License, version 2, as
9 published by the Free Software Foundation.
11 KMail is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 In addition, as a special exception, the copyright holders give
21 permission to link the code of this program with any edition of
22 the Qt library by Trolltech AS, Norway (or with modified versions
23 of Qt that use the same license as Qt), and distribute linked
24 combinations including the two. You must obey the GNU General
25 Public License in all respects for all of the code used other than
26 Qt. If you modify this file, you may extend this exception to
27 your version of the file, but you are not obligated to do so. If
28 you do not wish to do so, delete this exception statement from
29 your version.
32 #ifndef __MESSAGEVIEWER_TEEHTMLWRITER_H__
33 #define __MESSAVEVIEWER_TEEHTMLWRITER_H__
35 #include "interfaces/htmlwriter.h"
37 #include <QList>
39 class QString;
41 namespace MessageViewer {
43 /** @short A HtmlWriter that dispatches all calls to a list of other HtmlWriters
44 @author Marc Mutz <mutz@kde.org>
45 **/
46 class TeeHtmlWriter : public HtmlWriter {
47 public:
48 explicit TeeHtmlWriter( HtmlWriter * writer1 = 0,
49 HtmlWriter * writer2 = 0 );
50 virtual ~TeeHtmlWriter();
52 void addHtmlWriter( HtmlWriter * writer );
55 // HtmlWriter Interface
57 void begin( const QString & cssDefs );
58 void end();
59 void reset();
60 void write( const QString & str );
61 void queue( const QString & str );
62 void flush();
63 void embedPart( const QByteArray & contentId, const QString & url );
65 private:
66 /** We own the HtmlWriters added to us! */
67 QList<HtmlWriter*> mWriters;
70 } // namespace MessageViewer
72 #endif // __MESSAGEVIEWER_TEEHTMLWRITER_H__