KMime::Headers::Base

Search for usage in LXR

KMime::Headers::Base Class Referenceabstract

#include <kmime_headers.h>

Inheritance diagram for KMime::Headers::Base:

Public Types

typedef QVector< KMime::Headers::Base * > List
 

Public Member Functions

 Base ()
 
virtual ~Base ()
 
virtual QByteArray as7BitString (bool withHeaderType=true) const =0
 
virtual QString asUnicodeString () const =0
 
virtual void clear ()=0
 
virtual void from7BitString (const char *s, size_t len)
 
virtual void from7BitString (const QByteArray &s)=0
 
virtual void fromUnicodeString (const QString &s, const QByteArray &b)=0
 
bool is (const char *t) const
 
virtual bool isEmpty () const =0
 
bool isMimeHeader () const
 
QByteArray rfc2047Charset () const
 
void setRFC2047Charset (const QByteArray &cs)
 
virtual const char * type () const
 

Protected Member Functions

QByteArray typeIntro () const
 

Detailed Description

Baseclass of all header-classes.

It represents a header-field as described in RFC-822.

Definition at line 103 of file kmime_headers.h.

Member Typedef Documentation

A vector of headers.

Definition at line 109 of file kmime_headers.h.

Constructor & Destructor Documentation

KMime::Headers::Base::Base ( )

Creates an empty header.

Definition at line 95 of file kmime_headers.cpp.

KMime::Headers::Base::~Base ( )
virtual

Destructor.

Definition at line 104 of file kmime_headers.cpp.

Member Function Documentation

virtual QString KMime::Headers::Base::asUnicodeString ( ) const
pure virtual

Returns the decoded content of the header without the header-type.

Note
The return value of this method should only be used when showing an address to the user. It is not guaranteed that fromUnicodeString( asUnicodeString(), ... ) will return the original string.

Implemented in KMime::Headers::Lines, KMime::Headers::Newsgroups, KMime::Headers::MailCopiesTo, KMime::Headers::Generics::DotAtom, KMime::Headers::Generics::PhraseList, KMime::Headers::Generics::AddressList, KMime::Headers::Generics::MailboxList, KMime::Headers::Generics::Structured, and KMime::Headers::Generics::Unstructured.

void KMime::Headers::Base::from7BitString ( const char *  s,
size_t  len 
)
virtual

Parses the given string.

Take care of RFC2047-encoded strings.

Parameters
sThe encoded header data.

Reimplemented in KMime::Headers::Generics::Structured.

Definition at line 110 of file kmime_headers.cpp.

virtual void KMime::Headers::Base::fromUnicodeString ( const QString s,
const QByteArray b 
)
pure virtual

Parses the given string and set the charset.

Parameters
sThe header data as unicode string.
bThe charset preferred for encoding.

Implemented in KMime::Headers::Newsgroups, KMime::Headers::Generics::AddressList, KMime::Headers::Generics::MailboxList, KMime::Headers::Generics::Structured, and KMime::Headers::Generics::Unstructured.

bool KMime::Headers::Base::is ( const char *  t) const

Checks if this header is of type t.

Definition at line 134 of file kmime_headers.cpp.

bool KMime::Headers::Base::isMimeHeader ( ) const

Checks if this header is a MIME header.

Definition at line 139 of file kmime_headers.cpp.

QByteArray KMime::Headers::Base::rfc2047Charset ( ) const

Returns the charset that is used for RFC2047-encoding.

Definition at line 115 of file kmime_headers.cpp.

void KMime::Headers::Base::setRFC2047Charset ( const QByteArray cs)

Sets the charset for RFC2047-encoding.

Parameters
csThe new charset used for RFC2047 encoding.

Definition at line 124 of file kmime_headers.cpp.

const char * KMime::Headers::Base::type ( ) const
virtual

Returns the type of this header (e.g.

"From").

Reimplemented in KMime::Headers::Generic.

Definition at line 129 of file kmime_headers.cpp.

QByteArray KMime::Headers::Base::typeIntro ( ) const
protected

Helper method, returns the header prefix including ":".

Definition at line 144 of file kmime_headers.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri May 14 2021 23:12:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.