kmail

bodypart.h

00001 /*  -*- mode: C++; c-file-style: "gnu" -*-
00002     bodypart.h
00003 
00004     This file is part of KMail's plugin interface.
00005     Copyright (c) 2004 Marc Mutz <mutz@kde.org>,
00006                        Ingo Kloecker <kloecker@kde.org>
00007 
00008     KMail is free software; you can redistribute it and/or modify it
00009     under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     KMail is distributed in the hope that it will be useful, but
00014     WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with this program; if not, write to the Free Software
00020     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00021 
00022     In addition, as a special exception, the copyright holders give
00023     permission to link the code of this program with any edition of
00024     the TQt library by Trolltech AS, Norway (or with modified versions
00025     of TQt that use the same license as TQt), and distribute linked
00026     combinations including the two.  You must obey the GNU General
00027     Public License in all respects for all of the code used other than
00028     TQt.  If you modify this file, you may extend this exception to
00029     your version of the file, but you are not obligated to do so.  If
00030     you do not wish to do so, delete this exception statement from
00031     your version.
00032 */
00033 
00034 #ifndef __KMAIL_INTERFACES_BODYPART_H__
00035 #define __KMAIL_INTERFACES_BODYPART_H__
00036 
00037 #include <tqcstring.h>
00038 
00039 template <typename T> class TQMemArray;
00040 class TQString;
00041 
00042 namespace KMail {
00043   namespace Interface {
00044 
00045     class Observer;
00046     class Observable;
00047 
00051     class BodyPartMemento {
00052     public:
00053       virtual ~BodyPartMemento() {}
00054 
00061       virtual Observer * asObserver() = 0;
00062 
00069       virtual Observable * asObservable() = 0;
00070     };
00071 
00075     class BodyPart {
00076     public:
00077       virtual ~BodyPart() {}
00078 
00083       virtual TQString makeLink( const TQString & path ) const = 0;
00084 
00090       virtual TQString asText() const = 0;
00091 
00096       virtual TQByteArray asBinary() const = 0;
00097 
00114       virtual TQString contentTypeParameter( const char * parameter ) const = 0;
00115 
00121       virtual TQString contentDescription() const = 0;
00122 
00123       //virtual int contentDisposition() const = 0;
00133       virtual TQString contentDispositionParameter( const char * parameter ) const = 0;
00134 
00139       virtual bool hasCompleteBody() const = 0;
00140 
00145       virtual BodyPartMemento * memento() const = 0;
00146 
00151       virtual void setBodyPartMemento( BodyPartMemento * ) = 0;
00152 
00153       enum Display { None, AsIcon, Inline };
00157       virtual Display defaultDisplay() const = 0;
00158     };
00159 
00160   } // namespace Interface
00161 
00162 } // namespace KMail
00163 
00164 #endif // __KMAIL_INTERFACES_BODYPART_H__