kmail

app_octetstream.cpp
1/*
2 app_octetstream.cpp
3
4 This file is part of KMail, the KDE mail client.
5 Copyright (c) 2004 Marc Mutz <mutz@kde.org>
6
7 KMail is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 KMail is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
21 In addition, as a special exception, the copyright holders give
22 permission to link the code of this program with any edition of
23 the TQt library by Trolltech AS, Norway (or with modified versions
24 of TQt that use the same license as TQt), and distribute linked
25 combinations including the two. You must obey the GNU General
26 Public License in all respects for all of the code used other than
27 TQt. If you modify this file, you may extend this exception to
28 your version of the file, but you are not obligated to do so. If
29 you do not wish to do so, delete this exception statement from
30 your version.
31*/
32
33#include "interfaces/bodypartformatter.h"
34
35#include <tdemacros.h>
36
37namespace {
38
39 class Formatter : public KMail::Interface::BodyPartFormatter {
40 public:
41 Result format( KMail::Interface::BodyPart *, KMail::HtmlWriter *, KMail::Callback & ) const { return AsIcon; }
42 };
43
44 class Plugin : public KMail::Interface::BodyPartFormatterPlugin {
45 public:
46 const KMail::Interface::BodyPartFormatter * bodyPartFormatter( int idx ) const {
47 return idx == 0 ? new Formatter() : 0 ;
48 }
49 const char * type( int idx ) const {
50 return idx == 0 ? "application" : 0 ;
51 }
52 const char * subtype( int idx ) const {
53 return idx == 0 ? "octet-stream" : 0 ;
54 }
55
56 const KMail::Interface::BodyPartURLHandler * urlHandler( int ) const { return 0; }
57 };
58
59}
60
61extern "C"
63libkmail_bodypartformatter_application_octetstream_create_bodypart_formatter_plugin() {
64 return new Plugin();
65}
66
This class is used for callback hooks needed by bodypart formatter plugins.
Definition: callback.h:55
An interface to HTML sinks.
Definition: htmlwriter.h:99
interface for BodyPartFormatter plugins
An interface to body part reader link handlers.
interface of message body parts.
Definition: bodypart.h:75