• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

KMIME Library

  • KMime
  • Headers
  • ContentType
Public Member Functions | Protected Member Functions
KMime::Headers::ContentType Class Reference

Represents a "Content-Type" header. More...

#include <kmime_headers.h>

Inheritance diagram for KMime::Headers::ContentType:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual QByteArray as7BitString (bool withHeaderType=true) const
QByteArray boundary () const
contentCategory category () const
QByteArray charset () const
virtual void clear ()
QByteArray id () const
virtual bool isEmpty () const
bool isHTMLText () const
bool isImage () const
bool isMediatype (const char *mediatype) const
bool isMultipart () const
bool isPartial () const
bool isPlainText () const
bool isSubtype (const char *subtype) const
bool isText () const
QByteArray mediaType () const
QByteArray mimeType () const
QString name () const
int partialCount () const
int partialNumber () const
void setBoundary (const QByteArray &s)
void setCategory (contentCategory c)
void setCharset (const QByteArray &s)
void setId (const QByteArray &s)
void setMimeType (const QByteArray &mimeType)
void setName (const QString &s, const QByteArray &cs)
void setPartialParams (int total, int number)
QByteArray subType () const

Protected Member Functions

bool parse (const char *&scursor, const char *const send, bool isCRLF=false)

Detailed Description

Represents a "Content-Type" header.

See also:
RFC 2045, section 5.

Definition at line 1040 of file kmime_headers.h.


Member Function Documentation

QByteArray KMime::Headers::ContentType::as7BitString ( bool  withHeaderType = true) const [virtual]

Returns the encoded header.

Parameters:
withHeaderTypeSpecifies whether the header-type should be included.

Reimplemented from KMime::Headers::Generics::Parametrized.

Definition at line 1709 of file kmime_headers.cpp.

QByteArray KMime::Headers::ContentType::boundary ( ) const

Returns the boundary (for mulitpart containers).

Definition at line 1826 of file kmime_headers.cpp.

QByteArray KMime::Headers::ContentType::charset ( ) const

Returns the charset for the associated MIME entity.

Definition at line 1811 of file kmime_headers.cpp.

void KMime::Headers::ContentType::clear ( ) [virtual]

Deletes.

Reimplemented from KMime::Headers::Generics::Parametrized.

Definition at line 1700 of file kmime_headers.cpp.

QByteArray KMime::Headers::ContentType::id ( ) const

Returns the identifier of the associated MIME entity.

Definition at line 1848 of file kmime_headers.cpp.

bool KMime::Headers::ContentType::isEmpty ( ) const [virtual]

Checks if this header contains any data.

Reimplemented from KMime::Headers::Generics::Parametrized.

Definition at line 1695 of file kmime_headers.cpp.

bool KMime::Headers::ContentType::isHTMLText ( ) const

Returns true if the associated MIME entity is a HTML file.

Definition at line 1791 of file kmime_headers.cpp.

bool KMime::Headers::ContentType::isImage ( ) const

Returns true if the associated MIME entity is an image.

Definition at line 1796 of file kmime_headers.cpp.

bool KMime::Headers::ContentType::isMediatype ( const char *  mediatype) const

Tests if the media type equals mediatype.

Definition at line 1769 of file kmime_headers.cpp.

bool KMime::Headers::ContentType::isMultipart ( ) const

Returns true if the associated MIME entity is a mulitpart container.

Definition at line 1801 of file kmime_headers.cpp.

bool KMime::Headers::ContentType::isPartial ( ) const

Returns true if the associated MIME entity contains partial data.

See also:
partialNumber(), partialCount()

Definition at line 1806 of file kmime_headers.cpp.

bool KMime::Headers::ContentType::isPlainText ( ) const

Returns true if the associated MIME entity is a plain text.

Definition at line 1785 of file kmime_headers.cpp.

bool KMime::Headers::ContentType::isSubtype ( const char *  subtype) const

Tests if the mime sub-type equals subtype.

Definition at line 1774 of file kmime_headers.cpp.

bool KMime::Headers::ContentType::isText ( ) const

Returns true if the associated MIME entity is a text.

Definition at line 1779 of file kmime_headers.cpp.

QByteArray KMime::Headers::ContentType::mediaType ( ) const

Returns the media type (first part of the mimetype).

Definition at line 1739 of file kmime_headers.cpp.

QByteArray KMime::Headers::ContentType::mimeType ( ) const

Returns the mimetype.

Definition at line 1728 of file kmime_headers.cpp.

QString KMime::Headers::ContentType::name ( ) const

Returns the name of the associated MIME entity.

Definition at line 1836 of file kmime_headers.cpp.

bool KMime::Headers::ContentType::parse ( const char *&  scursor,
const char *const  send,
bool  isCRLF = false 
) [protected, virtual]

This method parses the raw header and needs to be implemented in every sub-class.

Parameters:
scursorPointer to the start of the data still to parse.
sendPointer to the end of the data.
isCRLFtrue if input string is terminated with a CRLF.

Reimplemented from KMime::Headers::Generics::Parametrized.

Definition at line 1895 of file kmime_headers.cpp.

int KMime::Headers::ContentType::partialCount ( ) const

Returns the total number of parts in a multi-part set.

See also:
isPartial(), partialNumber()

Definition at line 1868 of file kmime_headers.cpp.

int KMime::Headers::ContentType::partialNumber ( ) const

Returns the position of this part in a multi-part set.

See also:
isPartial(), partialCount()

Definition at line 1858 of file kmime_headers.cpp.

void KMime::Headers::ContentType::setBoundary ( const QByteArray &  s)

Sets the mulitpart container boundary.

Definition at line 1831 of file kmime_headers.cpp.

void KMime::Headers::ContentType::setCharset ( const QByteArray &  s)

Sets the charset.

Definition at line 1821 of file kmime_headers.cpp.

void KMime::Headers::ContentType::setId ( const QByteArray &  s)

Sets the identifier.

Definition at line 1853 of file kmime_headers.cpp.

void KMime::Headers::ContentType::setMimeType ( const QByteArray &  mimeType)

Sets the mimetype and clears already existing parameters.

Parameters:
mimeTypeThe new mimetype.

Definition at line 1749 of file kmime_headers.cpp.

void KMime::Headers::ContentType::setName ( const QString &  s,
const QByteArray &  cs 
)

Sets the name to s using charset cs.

Definition at line 1841 of file kmime_headers.cpp.

void KMime::Headers::ContentType::setPartialParams ( int  total,
int  number 
)

Sets parameters of a partial MIME entity.

Parameters:
totalThe total number of entities in the multi-part set.
numberThe number of this entity in a multi-part set.

Definition at line 1889 of file kmime_headers.cpp.

QByteArray KMime::Headers::ContentType::subType ( ) const

Returns the mime sub-type (second part of the mimetype).

Definition at line 1744 of file kmime_headers.cpp.


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

KMIME Library

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal