KMime::Types::Mailbox

#include <kmime_types.h>

Public Types

typedef QVector< MailboxList
 
enum  Quoting { QuoteNever, QuoteWhenNecessary, QuoteAlways }
 

Public Member Functions

QByteArray address () const
 
AddrSpec addrSpec () const
 
QByteArray as7BitString (const QByteArray &encCharset) const
 
void from7BitString (const QByteArray &s)
 
void fromUnicodeString (const QString &s)
 
bool hasAddress () const
 
bool hasName () const
 
QString name () const
 
QString prettyAddress (Quoting quoting=QuoteNever) const
 
void setAddress (const AddrSpec &addr)
 
void setAddress (const QByteArray &addr)
 
void setName (const QString &name)
 
void setNameFrom7Bit (const QByteArray &name, const QByteArray &defaultCharset=QByteArray())
 

Static Public Member Functions

static QVector< MailboxlistFrom7BitString (const QByteArray &s)
 
static QVector< MailboxlistFromUnicodeString (const QString &s)
 
static QString listToUnicodeString (const QVector< Mailbox > &mailboxes)
 

Detailed Description

Represents an (email address, display name) pair according RFC 2822, section 3.4.

Definition at line 51 of file kmime_types.h.

Member Enumeration Documentation

Describes how display names should be quoted.

Since
4.5
Enumerator
QuoteNever 

Don't quote display names at all.

Such an unquoted display name can not

QuoteWhenNecessary 

be machine-processed anymore in some cases, for example when it contains commas, like in "Lastname, Firstname".

Only quote display names when they contain characters that need to be

QuoteAlways 

quoted, like commas or quote signs.

Always quote the display name

Definition at line 105 of file kmime_types.h.

Member Function Documentation

QByteArray KMime::Types::Mailbox::address ( ) const

Returns a string representation of the email address, without the angle brackets.

Definition at line 106 of file kmime_types.cpp.

QByteArray KMime::Types::Mailbox::as7BitString ( const QByteArray encCharset) const

Returns a 7bit transport encoded representation of this mailbox.

Parameters
encCharsetThe charset used for encoding.

Definition at line 194 of file kmime_types.cpp.

void KMime::Types::Mailbox::from7BitString ( const QByteArray s)

Parses the given 7bit encoded string.

Definition at line 188 of file kmime_types.cpp.

void KMime::Types::Mailbox::fromUnicodeString ( const QString s)

Parses the given unicode string.

Definition at line 183 of file kmime_types.cpp.

bool KMime::Types::Mailbox::hasAddress ( ) const

Returns true if this mailbox has an address.

Definition at line 157 of file kmime_types.cpp.

bool KMime::Types::Mailbox::hasName ( ) const

Returns true if this mailbox has a display name.

Definition at line 162 of file kmime_types.cpp.

QVector< KMime::Types::Mailbox > KMime::Types::Mailbox::listFrom7BitString ( const QByteArray s)
static

Returns a list of mailboxes from an encoded 7bit string.

Since
5.14

Definition at line 218 of file kmime_types.cpp.

QVector< KMime::Types::Mailbox > KMime::Types::Mailbox::listFromUnicodeString ( const QString s)
static

Returns a list of mailboxes from an unicode string.

Since
5.14

Definition at line 213 of file kmime_types.cpp.

QString KMime::Types::Mailbox::listToUnicodeString ( const QVector< Mailbox > &  mailboxes)
static

Returns a unicode string representing the given list of mailboxes.

Since
5.15

Definition at line 234 of file kmime_types.cpp.

QString KMime::Types::Mailbox::name ( ) const

Returns the display name.

Definition at line 122 of file kmime_types.cpp.

QString KMime::Types::Mailbox::prettyAddress ( Quoting  quoting = QuoteNever) const

Overloaded method that gives more control over the quoting of the display name.

Parameters
quotingdescribes how the display name should be quoted
Since
4.5

Definition at line 167 of file kmime_types.cpp.

void KMime::Types::Mailbox::setAddress ( const AddrSpec &  addr)

Sets the email address.

Definition at line 127 of file kmime_types.cpp.

void KMime::Types::Mailbox::setAddress ( const QByteArray addr)

Sets the email address.

Definition at line 132 of file kmime_types.cpp.

void KMime::Types::Mailbox::setName ( const QString name)

Sets the name.

Definition at line 145 of file kmime_types.cpp.

void KMime::Types::Mailbox::setNameFrom7Bit ( const QByteArray name,
const QByteArray defaultCharset = QByteArray() 
)

Sets the name based on a 7bit encoded string.

Definition at line 150 of file kmime_types.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Aug 10 2020 23:16:30 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.