KMIME Library
kmime_content_p.h
00001 /* 00002 Copyright (c) 2007 Volker Krause <vkrause@kde.org> 00003 00004 This library is free software; you can redistribute it and/or modify it 00005 under the terms of the GNU Library General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or (at your 00007 option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to the 00016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 02110-1301, USA. 00018 */ 00019 00020 #ifndef KMIME_CONTENT_P_H 00021 #define KMIME_CONTENT_P_H 00022 00023 //@cond PRIVATE 00024 00025 #include <boost/shared_ptr.hpp> 00026 00027 namespace KMime { 00028 class Message; 00029 typedef boost::shared_ptr<Message> MessagePtr; 00030 } 00031 00032 namespace KMime { 00033 00034 class ContentPrivate 00035 { 00036 public: 00037 ContentPrivate( Content *q ) 00038 : forceDefaultCS( false ), parent( 0 ), frozen( false ) 00039 , q_ptr( q ) 00040 { 00041 defaultCS = KMime::cachedCharset( "ISO-8859-1" ); 00042 } 00043 00044 virtual ~ContentPrivate() 00045 { 00046 qDeleteAll( multipartContents ); 00047 multipartContents.clear(); 00048 } 00049 00050 bool parseUuencoded(); 00051 bool parseYenc(); 00052 bool parseMultipart(); 00053 Headers::Generic *nextHeader( QByteArray &head ); 00054 void clearBodyMessage(); 00055 00056 // This one returns the normal multipartContents for multipart contents, but returns 00057 // a list with just bodyAsMessage in it for contents that are encapsulated messages. 00058 // That makes it possible to handle encapsulated messages in a transparent way. 00059 Content::List contents() const; 00060 00061 QByteArray head; 00062 QByteArray body; 00063 QByteArray frozenBody; 00064 QByteArray defaultCS; 00065 QByteArray preamble; 00066 QByteArray epilogue; 00067 bool forceDefaultCS; 00068 Content *parent; 00069 bool frozen; 00070 00071 Content::List multipartContents; 00072 MessagePtr bodyAsMessage; 00073 00074 Content* q_ptr; 00075 Q_DECLARE_PUBLIC( Content ) 00076 }; 00077 00078 } 00079 00080 //@endcond 00081 00082 #endif