KMIME Library
kmime_message.h
00001 /* 00002 kmime_message.h 00003 00004 KMime, the KDE internet mail/usenet news message library. 00005 Copyright (c) 2001 the KMime authors. 00006 See file AUTHORS for details 00007 00008 This library is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU Library General Public 00010 License as published by the Free Software Foundation; either 00011 version 2 of the License, or (at your option) any later version. 00012 00013 This library is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Library General Public License for more details. 00017 00018 You should have received a copy of the GNU Library General Public License 00019 along with this library; see the file COPYING.LIB. If not, write to 00020 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00021 Boston, MA 02110-1301, USA. 00022 */ 00023 #ifndef __KMIME_MESSAGE_H__ 00024 #define __KMIME_MESSAGE_H__ 00025 00026 #include "kmime_export.h" 00027 #include "kmime_content.h" 00028 #include "kmime_headers.h" 00029 #include "boolflags.h" 00030 00031 namespace KMime { 00032 00033 class MessagePrivate; 00034 00038 class KMIME_EXPORT Message : public Content 00039 { 00040 public: 00041 typedef QList<KMime::Message*> List; 00042 00044 Message(); 00045 ~Message(); 00046 00047 //content handling 00048 virtual void parse(); 00049 virtual void clear(); 00050 00051 //header access 00053 virtual KDE_DEPRECATED KMime::Headers::Base *getHeaderByType( const char *type ); 00055 virtual KMime::Headers::Base *headerByType( const char *type ); 00056 virtual void setHeader( KMime::Headers::Base *h ); 00057 virtual bool removeHeader( const char *type ); 00058 00062 virtual KMime::Headers::MessageID *messageID( bool create = true ); 00063 virtual KMime::Headers::Subject *subject( bool create = true ); 00064 virtual KMime::Headers::Date *date( bool create = true ); 00065 virtual KMime::Headers::From *from( bool create = true ); 00066 virtual KMime::Headers::Organization *organization( bool create = true ); 00067 virtual KMime::Headers::ReplyTo *replyTo( bool create = true ); 00068 virtual KMime::Headers::To *to( bool create = true ); 00069 virtual KMime::Headers::Cc *cc( bool create = true ); 00070 virtual KMime::Headers::Bcc *bcc( bool create = true ); 00071 virtual KMime::Headers::References *references( bool create = true ); 00072 virtual KMime::Headers::UserAgent *userAgent( bool create = true ); 00073 virtual KMime::Headers::InReplyTo *inReplyTo( bool create = true ); 00074 virtual KMime::Headers::Sender *sender( bool create = true ); 00075 00076 virtual bool isTopLevel() const; 00077 00087 Content* mainBodyPart( const QByteArray &type = QByteArray() ); 00088 00089 protected: 00090 virtual QByteArray assembleHeaders(); 00091 00092 // @cond PRIVATE 00093 explicit Message( MessagePrivate *d ); 00094 // @endcond 00095 00096 private: 00097 Q_DECLARE_PRIVATE( Message ) 00098 00099 }; // class Message 00100 00101 } // namespace KMime 00102 00103 #endif // __KMIME_MESSAGE_H__