Backport r950340 | aacid | 2009-04-06 23:21:18 +0200 (Mon, 06 Apr 2009) | 4 lines
[kdepim.git] / kmail / partnodebodypart.h
blob52b9a92d1d09f2ec0f89c70c0cb966fa7e83fef7
1 /* -*- mode: C++; c-file-style: "gnu" -*-
2 partnodebodypart.h
4 This file is part of KMail, the KDE mail client.
5 Copyright (c) 2004 Marc Mutz <mutz@kde.org>,
6 Ingo Kloecker <kloecker@kde.org>
8 KMail is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 KMail is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 In addition, as a special exception, the copyright holders give
23 permission to link the code of this program with any edition of
24 the Qt library by Trolltech AS, Norway (or with modified versions
25 of Qt that use the same license as Qt), and distribute linked
26 combinations including the two. You must obey the GNU General
27 Public License in all respects for all of the code used other than
28 Qt. If you modify this file, you may extend this exception to
29 your version of the file, but you are not obligated to do so. If
30 you do not wish to do so, delete this exception statement from
31 your version.
34 #ifndef __KMAIL_PARTNODEBODYPART_H_
35 #define __KMAIL_PARTNODEBODYPART_H_
37 #include "interfaces/bodypart.h"
39 class partNode;
41 class QTextCodec;
43 namespace KMail {
45 /**
46 @short an implementation of the BodyPart interface using partNodes
48 class PartNodeBodyPart : public Interface::BodyPart {
49 public:
50 explicit PartNodeBodyPart( partNode & n, const QTextCodec * codec=0 );
52 QString makeLink( const QString & path ) const;
53 QString asText() const;
54 QByteArray asBinary() const;
55 QString contentTypeParameter( const char * param ) const;
56 QString contentDescription() const;
57 //int contentDisposition() const;
58 QString contentDispositionParameter( const char * param ) const;
59 bool hasCompleteBody() const;
61 Interface::BodyPartMemento * memento() const;
62 void setBodyPartMemento( Interface::BodyPartMemento * memento );
63 BodyPart::Display defaultDisplay() const;
64 void setDefaultDisplay( BodyPart::Display );
66 private:
67 partNode & mPartNode;
68 const QTextCodec * mCodec;
69 BodyPart::Display mDefaultDisplay;
72 } // namespace KMail
74 #endif // __KMAIL_PARTNODEBODYPART_H_