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 );
311 KDE_DEPRECATED
virtual Headers::Base *getHeaderByType(
const char *type );
332 template <
typename T> T *header(
bool create =
false );
339 virtual QList<Headers::Base*> headersByType(
const char *type );
377 virtual bool removeHeader(
const char *type );
385 bool hasHeader(
const char *type );
440 int storageSize()
const;
445 int lineCount()
const;
455 QByteArray body()
const;
467 void setBody(
const QByteArray &body );
476 QByteArray preamble()
const;
487 void setPreamble(
const QByteArray &preamble );
496 QByteArray epilogue()
const;
506 void setEpilogue(
const QByteArray &epilogue );
522 QByteArray encodedContent(
bool useCrLf =
false );
530 QByteArray encodedBody();
541 QByteArray decodedContent();
558 QString decodedText(
bool trimText =
false,
559 bool removeTrailingNewlines =
false );
577 void fromUnicodeString(
const QString &s );
589 List attachments(
bool incAlternatives =
false );
596 List contents()
const;
615 void addContent(
Content *content,
bool prepend =
false );
634 void removeContent(
Content *content,
bool del =
false );
642 void changeEncoding( Headers::contentEncoding e );
651 void toStream( QTextStream &ts,
bool scrambleFromLines =
false );
665 QByteArray defaultCharset()
const;
674 void setDefaultCharset(
const QByteArray &cs );
682 bool forceDefaultCharset()
const;
693 virtual void setForceDefaultCharset(
bool b );
716 virtual bool isTopLevel()
const;
724 void setParent(
Content *parent );
751 bool bodyIsMessage()
const;
772 boost::shared_ptr<Message> bodyAsMessage()
const;
780 virtual QByteArray assembleHeaders();
786 KDE_DEPRECATED QByteArray rawHeader(
const char *name )
const;
792 KDE_DEPRECATED QList<QByteArray> rawHeaders(
const char *name )
const;
804 template <
class T> KDE_DEPRECATED T *headerInstance( T *ptr,
bool create );
814 ContentPrivate *d_ptr;
815 explicit Content( ContentPrivate *d );
826 template <class T> T *Content::headerInstance( T *ptr,
bool create )
828 return header<T>( create );
836 Q_ASSERT( dynamic_cast<T*>( h ) );
837 }
else if ( create ) {
841 return static_cast<T*
>( h );
846 #endif // __KMIME_CONTENT_H__
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:25:45 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.