KMime::Headers::Base

Search for usage in LXR

KMime::Headers::Base Class Referenceabstract

#include <headers.h>

Inheritance diagram for KMime::Headers::Base:

Public Types

typedef QList< 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 from7BitString (QByteArrayView s)=0
 
virtual void fromUnicodeString (const QString &s)=0
 
void fromUnicodeString (const QString &s, const QByteArray &b)
 
bool is (QByteArrayView t) const
 
virtual bool isEmpty () const =0
 
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 96 of file headers.h.

Member Typedef Documentation

◆ List

A vector of headers.

Definition at line 102 of file headers.h.

Constructor & Destructor Documentation

◆ Base()

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

Creates an empty header.

Definition at line 93 of file headers.cpp.

◆ ~Base()

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

Destructor.

Definition at line 102 of file headers.cpp.

Member Function Documentation

◆ as7BitString()

◆ asUnicodeString()

virtual QString KMime::Headers::Base::asUnicodeString ( ) const
nodiscardpure 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::Generics::AddressList, KMime::Headers::Generics::DotAtom, KMime::Headers::Generics::MailboxList, KMime::Headers::Generics::PhraseList, KMime::Headers::Generics::Structured, KMime::Headers::Generics::Unstructured, KMime::Headers::Lines, KMime::Headers::MailCopiesTo, and KMime::Headers::Newsgroups.

◆ from7BitString()

virtual void KMime::Headers::Base::from7BitString ( QByteArrayView s)
pure virtual

Parses the given string.

Take care of RFC2047-encoded strings.

Parameters
sThe encoded header data.

Implemented in KMime::Headers::Generics::Structured, and KMime::Headers::Generics::Unstructured.

◆ fromUnicodeString() [1/2]

virtual void KMime::Headers::Base::fromUnicodeString ( const QString & s)
pure virtual

Parses the given Unicode representation of the header content.

Parameters
sThe header data as Unicode string.

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

◆ fromUnicodeString() [2/2]

void KMime::Headers::Base::fromUnicodeString ( const QString & s,
const QByteArray & b )
inline

Definition at line 144 of file headers.h.

◆ is()

bool KMime::Headers::Base::is ( QByteArrayView t) const
nodiscard

Checks if this header is of type t.

Definition at line 127 of file headers.cpp.

◆ isEmpty()

◆ rfc2047Charset()

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

Returns the charset that is used for RFC2047-encoding.

Definition at line 108 of file headers.cpp.

◆ setRFC2047Charset()

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 117 of file headers.cpp.

◆ type()

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

Returns the type of this header (e.g.

"From").

Reimplemented in KMime::Headers::Generic.

Definition at line 122 of file headers.cpp.

◆ typeIntro()

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

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

Definition at line 132 of file headers.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:30:05 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.