• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kmail

KMMessagePart Class Reference

#include <kmmsgpart.h>

List of all members.


Detailed Description

Definition at line 31 of file kmmsgpart.h.


Public Member Functions

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

Protected Attributes

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

Constructor & Destructor Documentation

KMMessagePart::KMMessagePart (  ) 

Definition at line 28 of file kmmsgpart.cpp.

KMMessagePart::KMMessagePart ( QDataStream &  stream  ) 

Definition at line 35 of file kmmsgpart.cpp.

KMMessagePart::~KMMessagePart (  )  [virtual]

Definition at line 55 of file kmmsgpart.cpp.


Member Function Documentation

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

Definition at line 132 of file kmmsgpart.h.

QByteArray KMMessagePart::body ( void   )  const

Get or set the message body.

Definition at line 481 of file kmmsgpart.cpp.

QByteArray 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 280 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 250 of file kmmsgpart.cpp.

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

Returns the body part decoded to unicode.

Definition at line 140 of file kmmsgpart.cpp.

QByteArray KMMessagePart::charset (  )  const [inline]

Get the message part charset.

Definition at line 172 of file kmmsgpart.h.

void KMMessagePart::clear ( void   ) 

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

Definition at line 61 of file kmmsgpart.cpp.

const QTextCodec * KMMessagePart::codec (  )  const

Get a QTextCodec suitable for this message part.

Definition at line 124 of file kmmsgpart.cpp.

QString KMMessagePart::contentDescription ( void   )  const

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

Definition at line 418 of file kmmsgpart.cpp.

QByteArray KMMessagePart::contentDescriptionEncoded (  )  const [inline]

Definition at line 164 of file kmmsgpart.h.

QByteArray KMMessagePart::contentDisposition (  )  const [inline]

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

Definition at line 168 of file kmmsgpart.h.

QByteArray KMMessagePart::contentId (  )  const [inline]

Content-Id.

Definition at line 118 of file kmmsgpart.h.

int KMMessagePart::contentTransferEncoding ( void   )  const

Definition at line 394 of file kmmsgpart.cpp.

QByteArray 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 387 of file kmmsgpart.cpp.

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

Definition at line 157 of file kmmsgpart.h.

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

Cte is short for ContentTransferEncoding.

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

Definition at line 156 of file kmmsgpart.h.

int KMMessagePart::decodedSize (  )  const

Returns decoded length of body.

Definition at line 93 of file kmmsgpart.cpp.

void KMMessagePart::duplicate ( const KMMessagePart &  msgPart  ) 

Obtains an independent copy (i.e.

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

Definition at line 84 of file kmmsgpart.cpp.

QString KMMessagePart::fileName ( void   )  const

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

Definition at line 438 of file kmmsgpart.cpp.

QString KMMessagePart::iconName ( int  size = KIconLoader::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 309 of file kmmsgpart.cpp.

bool KMMessagePart::isComplete (  )  [inline]

If this part is complete (contains a body).

Definition at line 195 of file kmmsgpart.h.

bool KMMessagePart::loadHeaders (  )  [inline]

Returns true if the headers should be loaded.

Definition at line 204 of file kmmsgpart.h.

bool KMMessagePart::loadPart (  )  [inline]

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

Definition at line 210 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 296 of file kmmsgpart.cpp.

QString KMMessagePart::name (  )  const [inline]

Get or set name parameter.

Definition at line 181 of file kmmsgpart.h.

QByteArray 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 101 of file kmmsgpart.h.

QByteArray KMMessagePart::parameterAttribute ( void   )  const

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

Definition at line 367 of file kmmsgpart.cpp.

QString KMMessagePart::parameterValue ( void   )  const

Definition at line 373 of file kmmsgpart.cpp.

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

Returns the parent part.

Definition at line 198 of file kmmsgpart.h.

QString KMMessagePart::partSpecifier (  )  const [inline]

Returns the part number.

Definition at line 189 of file kmmsgpart.h.

void KMMessagePart::setAdditionalCTypeParamStr ( const QByteArray &  param  )  [inline]

Definition at line 136 of file kmmsgpart.h.

void KMMessagePart::setBody ( const QByteArray &  aStr  ) 

Definition at line 102 of file kmmsgpart.cpp.

void KMMessagePart::setBodyAndGuessCte ( const QByteArray &  aBuf,
QList< 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 167 of file kmmsgpart.cpp.

void KMMessagePart::setBodyEncoded ( const QByteArray &  aStr  ) 

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

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

Definition at line 161 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!

Definition at line 191 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 113 of file kmmsgpart.cpp.

void KMMessagePart::setCharset ( const QByteArray &  c  ) 

Set the message part charset.

Definition at line 149 of file kmmsgpart.cpp.

void KMMessagePart::setContentDescription ( const QString &  aStr  ) 

Definition at line 425 of file kmmsgpart.cpp.

void KMMessagePart::setContentDisposition ( const QByteArray &  cd  )  [inline]

Definition at line 169 of file kmmsgpart.h.

void KMMessagePart::setContentId ( const QByteArray &  aStr  )  [inline]

Definition at line 119 of file kmmsgpart.h.

void KMMessagePart::setContentTransferEncoding ( int  aCte  ) 

Definition at line 408 of file kmmsgpart.cpp.

void KMMessagePart::setContentTransferEncodingStr ( const QByteArray &  aStr  ) 

Definition at line 401 of file kmmsgpart.cpp.

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

Definition at line 159 of file kmmsgpart.h.

void KMMessagePart::setCteStr ( const QByteArray &  aStr  )  [inline]

Definition at line 158 of file kmmsgpart.h.

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

Set to true if the headers should be loaded.

Definition at line 207 of file kmmsgpart.h.

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

Set to true if the part itself should be loaded.

Definition at line 213 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 224 of file kmmsgpart.cpp.

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

Definition at line 182 of file kmmsgpart.h.

void KMMessagePart::setOriginalContentTypeStr ( const QByteArray &  txt  )  [inline]

Definition at line 104 of file kmmsgpart.h.

void KMMessagePart::setParameter ( const QByteArray &  attribute,
const QString &  value 
)

Definition at line 379 of file kmmsgpart.cpp.

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

Set the parent of this part.

Definition at line 201 of file kmmsgpart.h.

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

Sets the part number.

Definition at line 192 of file kmmsgpart.h.

void KMMessagePart::setSubtype ( int  aSubtype  ) 

Definition at line 359 of file kmmsgpart.cpp.

void KMMessagePart::setSubtypeStr ( const QByteArray &  aStr  )  [inline]

Definition at line 113 of file kmmsgpart.h.

void KMMessagePart::setType ( int  aType  ) 

Definition at line 345 of file kmmsgpart.cpp.

void KMMessagePart::setTypeStr ( const QByteArray &  aStr  )  [inline]

Definition at line 108 of file kmmsgpart.h.

int KMMessagePart::subtype (  )  const

Definition at line 353 of file kmmsgpart.cpp.

QByteArray KMMessagePart::subtypeStr (  )  const [inline]

Subtype.

Definition at line 112 of file kmmsgpart.h.

int KMMessagePart::type (  )  const

Definition at line 339 of file kmmsgpart.cpp.

QByteArray KMMessagePart::typeStr (  )  const [inline]

Definition at line 107 of file kmmsgpart.h.


Member Data Documentation

QByteArray KMMessagePart::mAdditionalCTypeParamStr [protected]

Definition at line 224 of file kmmsgpart.h.

QByteArray KMMessagePart::mBody [protected]

Definition at line 223 of file kmmsgpart.h.

int KMMessagePart::mBodyDecodedSize [mutable, protected]

Definition at line 230 of file kmmsgpart.h.

QByteArray KMMessagePart::mCharset [protected]

Definition at line 228 of file kmmsgpart.h.

QByteArray KMMessagePart::mContentDescription [protected]

Definition at line 220 of file kmmsgpart.h.

QByteArray KMMessagePart::mContentDisposition [protected]

Definition at line 221 of file kmmsgpart.h.

QByteArray KMMessagePart::mContentId [protected]

Definition at line 222 of file kmmsgpart.h.

QByteArray KMMessagePart::mCte [protected]

Definition at line 219 of file kmmsgpart.h.

bool KMMessagePart::mLoadHeaders [protected]

Definition at line 232 of file kmmsgpart.h.

bool KMMessagePart::mLoadPart [protected]

Definition at line 233 of file kmmsgpart.h.

QString KMMessagePart::mName [protected]

Definition at line 225 of file kmmsgpart.h.

QByteArray KMMessagePart::mOriginalContentTypeStr [protected]

Definition at line 216 of file kmmsgpart.h.

QByteArray KMMessagePart::mParameterAttribute [protected]

Definition at line 226 of file kmmsgpart.h.

QString KMMessagePart::mParameterValue [protected]

Definition at line 227 of file kmmsgpart.h.

KMMessagePart* KMMessagePart::mParent [protected]

Definition at line 231 of file kmmsgpart.h.

QString KMMessagePart::mPartSpecifier [protected]

Definition at line 229 of file kmmsgpart.h.

QByteArray KMMessagePart::mSubtype [protected]

Definition at line 218 of file kmmsgpart.h.

QByteArray KMMessagePart::mType [protected]

Definition at line 217 of file kmmsgpart.h.


The documentation for this class was generated from the following files:
  • kmmsgpart.h
  • kmmsgpart.cpp

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages