KMIME Library
Go to the documentation of this file.
48 #ifndef __KMIME_CONTENT_H__
49 #define __KMIME_CONTENT_H__
51 #include "kmime_export.h"
53 #include "kmime_util.h"
56 #include <QtCore/QTextStream>
57 #include <QtCore/QByteArray>
58 #include <QtCore/QList>
60 #include <boost/shared_ptr.hpp>
119 typedef QList<KMime::Content*>
List;
139 Content(
const QByteArray &head,
const QByteArray &body );
150 Content(
const QByteArray &head,
const QByteArray &body,
Content *parent );
160 bool hasContent()
const;
172 void setContent(
const QList<QByteArray> &l );
187 void setContent(
const QByteArray &s );
207 virtual void parse();
218 bool isFrozen()
const;
226 void setFrozen(
bool frozen =
true );
247 virtual void assemble();
253 virtual void clear();
266 void clearContents(
bool del =
true );
273 QByteArray head()
const;
285 void setHead(
const QByteArray &head );
312 KMIME_DEPRECATED
virtual Headers::Base *getHeaderByType(
const char *type );
334 template <
typename T> T *header(
bool create =
false );
342 virtual QList<Headers::Base*> headersByType(
const char *type );
380 virtual bool removeHeader(
const char *type );
388 bool hasHeader(
const char *type );
443 int storageSize()
const;
448 int lineCount()
const;
458 QByteArray body()
const;
470 void setBody(
const QByteArray &body );
479 QByteArray preamble()
const;
490 void setPreamble(
const QByteArray &preamble );
499 QByteArray epilogue()
const;
509 void setEpilogue(
const QByteArray &epilogue );
525 QByteArray encodedContent(
bool useCrLf =
false );
533 QByteArray encodedBody();
544 QByteArray decodedContent();
561 QString decodedText(
bool trimText =
false,
562 bool removeTrailingNewlines =
false );
580 void fromUnicodeString(
const QString &s );
592 List attachments(
bool incAlternatives =
false );
599 List contents()
const;
618 void addContent(
Content *content,
bool prepend =
false );
638 void removeContent(
Content *content,
bool del =
false );
655 void toStream( QTextStream &ts,
bool scrambleFromLines =
false );
669 QByteArray defaultCharset()
const;
678 void setDefaultCharset(
const QByteArray &cs );
686 bool forceDefaultCharset()
const;
697 virtual void setForceDefaultCharset(
bool b );
720 virtual bool isTopLevel()
const;
728 void setParent(
Content *parent );
755 bool bodyIsMessage()
const;
776 boost::shared_ptr<Message> bodyAsMessage()
const;
784 virtual QByteArray assembleHeaders();
791 KMIME_DEPRECATED QByteArray rawHeader(
const char *name )
const;
797 KMIME_DEPRECATED QList<QByteArray> rawHeaders(
const char *name )
const;
809 template <
class T> KMIME_DEPRECATED T *headerInstance( T *ptr,
bool create );
819 ContentPrivate *d_ptr;
820 explicit Content( ContentPrivate *d );
833 return header<T>( create );
841 Q_ASSERT(
dynamic_cast<T*
>( h ) );
842 }
else if ( create ) {
846 return static_cast<T*
>( h );
851 #endif // __KMIME_CONTENT_H__
A class to uniquely identify message parts (Content) in a hierarchy.
A class that encapsulates MIME encoded Content.
virtual Headers::Base * headerByType(const char *type)
Returns the first header of type type, if it exists.
T * header(bool create=false)
Returns the first header of type T, if it exists.
virtual void setHeader(Headers::Base *h)
Sets the specified header to this Content.
Headers::Base::List h_eaders
The list of headers in this Content.
Defines the ContentIndex class.
KMIME_DEPRECATED T * headerInstance(T *ptr, bool create)
Returns the first header of type T, if it exists.
QList< KMime::Content * > List
Describes a list of Content objects.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jan 29 2020 00:00:00 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.