kmail

KMMessagePart Class Reference

#include <kmmsgpart.h>

List of all members.


Public Member Functions

QCString additionalCTypeParamStr (void) const
QCString body (void) const
QCString bodyDecoded (void) const
QByteArray bodyDecodedBinary (void) const
QString bodyToUnicode (const QTextCodec *codec=0) const
QCString charset () const
void clear ()
const QTextCodeccodec () const
QString contentDescription () const
QCString contentDescriptionEncoded () const
QCString contentDisposition () const
QCString contentId () const
int contentTransferEncoding (void) const
QCString contentTransferEncodingStr (void) const
int cte (void) const
QCString cteStr (void) const
int decodedSize (void) const
void duplicate (const KMMessagePart &msgPart)
DwString dwBody () const
QString fileName (void) const
QString iconName (int size=KIcon::Desktop) const
bool isComplete ()
 KMMessagePart (QDataStream &stream)
 KMMessagePart ()
bool loadHeaders ()
bool loadPart ()
void magicSetType (bool autoDecode=TRUE)
QString name () const
QCString originalContentTypeStr (void) const
QCString parameterAttribute (void) const
QString parameterValue (void) const
KMMessagePartparent ()
QString partSpecifier () const
void setAdditionalCTypeParamStr (const QCString &param)
void setBody (const QByteArray &arr)
void setBody (const DwString &aStr)
void setBody (const QCString &aStr)
void setBodyAndGuessCte (const QCString &aBuf, QValueList< int > &allowedCte, bool allow8Bit=false, bool willBeSigned=false)
void setBodyAndGuessCte (const QByteArray &aBuf, QValueList< int > &allowedCte, bool allow8Bit=false, bool willBeSigned=false)
void setBodyEncoded (const QCString &aStr)
void setBodyEncodedBinary (const QByteArray &aStr)
void setBodyFromUnicode (const QString &str)
void setCharset (const QCString &c)
void setContentDescription (const QString &aStr)
void setContentDisposition (const QCString &cd)
void setContentId (const QCString &aStr)
void setContentTransferEncoding (int aCte)
void setContentTransferEncodingStr (const QCString &aStr)
void setCte (int aCte)
void setCteStr (const QCString &aStr)
void setLoadHeaders (bool load)
void setLoadPart (bool load)
void setMessageBody (const QByteArray &aBuf)
void setName (const QString &name)
void setOriginalContentTypeStr (const QCString &txt)
void setParameter (const QCString &attribute, const QString &value)
void setParent (KMMessagePart *part)
void setPartSpecifier (const QString &part)
void setSubtype (int aSubtype)
void setSubtypeStr (const QCString &aStr)
void setType (int aType)
void setTypeStr (const QCString &aStr)
int subtype () const
QCString subtypeStr () const
int type () const
QCString typeStr () const
virtual ~KMMessagePart ()

Protected Attributes

QCString mAdditionalCTypeParamStr
QByteArray mBody
int mBodyDecodedSize
QCString mCharset
QCString mContentDescription
QCString mContentDisposition
QCString mContentId
QCString mCte
bool mLoadHeaders
bool mLoadPart
QString mName
QCString mOriginalContentTypeStr
QCString mParameterAttribute
QString mParameterValue
KMMessagePartmParent
QString mPartSpecifier
QCString mSubtype
QCString mType

Detailed Description

Definition at line 34 of file kmmsgpart.h.


Constructor & Destructor Documentation

KMMessagePart::KMMessagePart (  ) 

Definition at line 30 of file kmmsgpart.cpp.

KMMessagePart::KMMessagePart ( QDataStream stream  ) 

Definition at line 37 of file kmmsgpart.cpp.

KMMessagePart::~KMMessagePart (  )  [virtual]

Definition at line 57 of file kmmsgpart.cpp.


Member Function Documentation

QCString KMMessagePart::additionalCTypeParamStr ( void   )  const [inline]

Definition at line 150 of file kmmsgpart.h.

QCString KMMessagePart::body ( void   )  const

Get or set the message body.

Definition at line 594 of file kmmsgpart.cpp.

QCString KMMessagePart::bodyDecoded ( void   )  const

Returns body as decoded string.

Assumes that content-transfer-encoding contains the correct encoding. This routine is meant for text strings!

Definition at line 359 of file kmmsgpart.cpp.

QByteArray KMMessagePart::bodyDecodedBinary ( void   )  const

Returns body as decoded string.

Assumes that content-transfer-encoding contains the correct encoding. This routine is meant for binary data. No trailing 0 is appended.

Definition at line 328 of file kmmsgpart.cpp.

QString KMMessagePart::bodyToUnicode ( const QTextCodec codec = 0  )  const

Returns the body part decoded to unicode.

Definition at line 164 of file kmmsgpart.cpp.

QCString KMMessagePart::charset (  )  const [inline]

Get the message part charset.

Definition at line 190 of file kmmsgpart.h.

void KMMessagePart::clear (  ) 

Reset to text/plain with 7bit cte and clear all other properties.

Definition at line 63 of file kmmsgpart.cpp.

const QTextCodec * KMMessagePart::codec (  )  const

Get a QTextCodec suitable for this message part.

Definition at line 148 of file kmmsgpart.cpp.

QString KMMessagePart::contentDescription ( void   )  const

Get or set the 'Content-Description' header field.

Definition at line 535 of file kmmsgpart.cpp.

QCString KMMessagePart::contentDescriptionEncoded (  )  const [inline]

Definition at line 182 of file kmmsgpart.h.

QCString KMMessagePart::contentDisposition (  )  const [inline]

Get or set the 'Content-Disposition' header field.

Definition at line 186 of file kmmsgpart.h.

QCString KMMessagePart::contentId (  )  const [inline]

Content-Id.

Definition at line 136 of file kmmsgpart.h.

int KMMessagePart::contentTransferEncoding ( void   )  const

Definition at line 511 of file kmmsgpart.cpp.

QCString KMMessagePart::contentTransferEncodingStr ( void   )  const

Get or set the 'Content-Transfer-Encoding' header field The member functions that involve enumerated types (ints) will work only for well-known encodings.

Definition at line 504 of file kmmsgpart.cpp.

int KMMessagePart::cte ( void   )  const [inline]

Definition at line 175 of file kmmsgpart.h.

QCString KMMessagePart::cteStr ( void   )  const [inline]

Cte is short for ContentTransferEncoding.

These functions are an alternative to the ones with longer names.

Definition at line 174 of file kmmsgpart.h.

int KMMessagePart::decodedSize ( void   )  const

Returns decoded length of body.

Definition at line 95 of file kmmsgpart.cpp.

void KMMessagePart::duplicate ( const KMMessagePart msgPart  ) 

Obtains an independant copy (i.e.

without explicitely shared data) of the data contained in msgPart.

Definition at line 86 of file kmmsgpart.cpp.

DwString KMMessagePart::dwBody (  )  const

Definition at line 599 of file kmmsgpart.cpp.

QString KMMessagePart::fileName ( void   )  const

Returns name of filename part of 'Content-Disposition' header field, if present.

Definition at line 552 of file kmmsgpart.cpp.

QString KMMessagePart::iconName ( int  size = KIcon::Desktop  )  const

Tries to find a good icon for the 'Content-Type' by scanning the installed mimelnk files.

Returns the found icon. If no matching icon is found, the one for application/octet-stream is returned.

Definition at line 432 of file kmmsgpart.cpp.

bool KMMessagePart::isComplete (  )  [inline]

If this part is complete (contains a body).

Definition at line 213 of file kmmsgpart.h.

bool KMMessagePart::loadHeaders (  )  [inline]

Returns true if the headers should be loaded.

Definition at line 222 of file kmmsgpart.h.

bool KMMessagePart::loadPart (  )  [inline]

Returns true if the part itself (as returned by kioslave) should be loaded.

Definition at line 228 of file kmmsgpart.h.

void KMMessagePart::magicSetType ( bool  autoDecode = TRUE  ) 

Set the 'Content-Type' by mime-magic from the contents of the body.

If autoDecode is TRUE the decoded body will be used for mime type determination (this does not change the body itself).

Definition at line 417 of file kmmsgpart.cpp.

QString KMMessagePart::name (  )  const [inline]

Get or set name parameter.

Definition at line 199 of file kmmsgpart.h.

QCString KMMessagePart::originalContentTypeStr ( void   )  const [inline]

Get or set the 'Content-Type' header field The member functions that involve enumerated types (ints) will work only for well-known types or subtypes.

Definition at line 120 of file kmmsgpart.h.

QCString KMMessagePart::parameterAttribute ( void   )  const

Get or set a custom content type parameter, consisting of an attribute name and a corresponding value.

Definition at line 484 of file kmmsgpart.cpp.

QString KMMessagePart::parameterValue ( void   )  const

Definition at line 490 of file kmmsgpart.cpp.

KMMessagePart* KMMessagePart::parent ( void   )  [inline]

Returns the parent part.

Definition at line 216 of file kmmsgpart.h.

QString KMMessagePart::partSpecifier (  )  const [inline]

Returns the part number.

Definition at line 207 of file kmmsgpart.h.

void KMMessagePart::setAdditionalCTypeParamStr ( const QCString param  )  [inline]

Definition at line 154 of file kmmsgpart.h.

void KMMessagePart::setBody ( const QByteArray arr  ) 

Definition at line 126 of file kmmsgpart.cpp.

void KMMessagePart::setBody ( const DwString &  aStr  ) 

Definition at line 115 of file kmmsgpart.cpp.

void KMMessagePart::setBody ( const QCString aStr  ) 

Definition at line 104 of file kmmsgpart.cpp.

void KMMessagePart::setBodyAndGuessCte ( const QCString aBuf,
QValueList< int > &  allowedCte,
bool  allow8Bit = false,
bool  willBeSigned = false 
)

Same for text.

Definition at line 245 of file kmmsgpart.cpp.

void KMMessagePart::setBodyAndGuessCte ( const QByteArray aBuf,
QValueList< int > &  allowedCte,
bool  allow8Bit = false,
bool  willBeSigned = false 
)

Sets body, encoded in the best fitting content-transfer-encoding, which is determined by character frequency count.

Parameters:
aBuf input buffer
allowedCte return: list of allowed cte's
allow8Bit whether "8bit" is allowed as cte.
willBeSigned whether "7bit"/"8bit" is allowed as cte according to RFC 3156

Definition at line 222 of file kmmsgpart.cpp.

void KMMessagePart::setBodyEncoded ( const QCString aStr  ) 

Sets body, encoded according to the content-transfer-encoding.

This one is for text strings, the trailing 0 is not used.

For speed reasons, prefer setBodyEncodedBinary. When possible (the QCString isn't used afterwards), change setBodyEncoded(myQCString) into: setBodyEncodedBinary(byteArrayFromQCStringNoDetach(myQCString));

Definition at line 185 of file kmmsgpart.cpp.

void KMMessagePart::setBodyEncodedBinary ( const QByteArray aStr  ) 

Sets body, encoded according to the content-transfer-encoding.

BEWARE: The entire aStr is used including trailing 0 of text strings! This version is faster than setBodyEncoded, no duplication necessary.

Definition at line 269 of file kmmsgpart.cpp.

void KMMessagePart::setBodyFromUnicode ( const QString str  ) 

Sets this body part's content to str.

str is subject to automatic charset and CTE detection.

Definition at line 137 of file kmmsgpart.cpp.

void KMMessagePart::setCharset ( const QCString c  ) 

Set the message part charset.

Definition at line 173 of file kmmsgpart.cpp.

void KMMessagePart::setContentDescription ( const QString aStr  ) 

Definition at line 542 of file kmmsgpart.cpp.

void KMMessagePart::setContentDisposition ( const QCString cd  )  [inline]

Definition at line 187 of file kmmsgpart.h.

void KMMessagePart::setContentId ( const QCString aStr  )  [inline]

Definition at line 137 of file kmmsgpart.h.

void KMMessagePart::setContentTransferEncoding ( int  aCte  ) 

Definition at line 525 of file kmmsgpart.cpp.

void KMMessagePart::setContentTransferEncodingStr ( const QCString aStr  ) 

Definition at line 518 of file kmmsgpart.cpp.

void KMMessagePart::setCte ( int  aCte  )  [inline]

Definition at line 177 of file kmmsgpart.h.

void KMMessagePart::setCteStr ( const QCString aStr  )  [inline]

Definition at line 176 of file kmmsgpart.h.

void KMMessagePart::setLoadHeaders ( bool  load  )  [inline]

Set to true if the headers should be loaded.

Definition at line 225 of file kmmsgpart.h.

void KMMessagePart::setLoadPart ( bool  load  )  [inline]

Set to true if the part itself should be loaded.

Definition at line 231 of file kmmsgpart.h.

void KMMessagePart::setMessageBody ( const QByteArray aBuf  ) 

Set a full message string as the body of the message part, disallowing anything but 7bit or 8bit encoding.

(RFC 1521 section 7.3)

Definition at line 303 of file kmmsgpart.cpp.

void KMMessagePart::setName ( const QString name  )  [inline]

Definition at line 200 of file kmmsgpart.h.

void KMMessagePart::setOriginalContentTypeStr ( const QCString txt  )  [inline]

Definition at line 121 of file kmmsgpart.h.

void KMMessagePart::setParameter ( const QCString attribute,
const QString value 
)

Definition at line 496 of file kmmsgpart.cpp.

void KMMessagePart::setParent ( KMMessagePart part  )  [inline]

Set the parent of this part.

Definition at line 219 of file kmmsgpart.h.

void KMMessagePart::setPartSpecifier ( const QString part  )  [inline]

Sets the part number.

Definition at line 210 of file kmmsgpart.h.

void KMMessagePart::setSubtype ( int  aSubtype  ) 

Definition at line 476 of file kmmsgpart.cpp.

void KMMessagePart::setSubtypeStr ( const QCString aStr  )  [inline]

Definition at line 131 of file kmmsgpart.h.

void KMMessagePart::setType ( int  aType  ) 

Definition at line 462 of file kmmsgpart.cpp.

void KMMessagePart::setTypeStr ( const QCString aStr  )  [inline]

Definition at line 126 of file kmmsgpart.h.

int KMMessagePart::subtype (  )  const

Definition at line 470 of file kmmsgpart.cpp.

QCString KMMessagePart::subtypeStr (  )  const [inline]

Subtype.

Definition at line 130 of file kmmsgpart.h.

int KMMessagePart::type ( void   )  const

Definition at line 456 of file kmmsgpart.cpp.

QCString KMMessagePart::typeStr (  )  const [inline]

Definition at line 125 of file kmmsgpart.h.


Member Data Documentation

Definition at line 242 of file kmmsgpart.h.

Definition at line 241 of file kmmsgpart.h.

int KMMessagePart::mBodyDecodedSize [mutable, protected]

Definition at line 248 of file kmmsgpart.h.

Definition at line 246 of file kmmsgpart.h.

Definition at line 238 of file kmmsgpart.h.

Definition at line 239 of file kmmsgpart.h.

Definition at line 240 of file kmmsgpart.h.

Definition at line 237 of file kmmsgpart.h.

bool KMMessagePart::mLoadHeaders [protected]

Definition at line 250 of file kmmsgpart.h.

bool KMMessagePart::mLoadPart [protected]

Definition at line 251 of file kmmsgpart.h.

Definition at line 243 of file kmmsgpart.h.

Definition at line 234 of file kmmsgpart.h.

Definition at line 244 of file kmmsgpart.h.

Definition at line 245 of file kmmsgpart.h.

Definition at line 249 of file kmmsgpart.h.

Definition at line 247 of file kmmsgpart.h.

Definition at line 236 of file kmmsgpart.h.

Definition at line 235 of file kmmsgpart.h.


The documentation for this class was generated from the following files: