KMime::Types::Mailbox

Search for usage in LXR

#include <kmime_types.h>

Public Types

typedef QList< 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 QList< MailboxlistFrom7BitString (const QByteArray &s)
 
static QList< MailboxlistFromUnicodeString (const QString &s)
 
static QString listToUnicodeString (const QList< Mailbox > &mailboxes)
 

Detailed Description

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

Definition at line 37 of file kmime_types.h.

Member Typedef Documentation

◆ List

Definition at line 40 of file kmime_types.h.

Member Enumeration Documentation

◆ Quoting

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 91 of file kmime_types.h.

Member Function Documentation

◆ address()

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

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

Definition at line 93 of file kmime_types.cpp.

◆ addrSpec()

AddrSpec KMime::Types::Mailbox::addrSpec ( ) const

Definition at line 104 of file kmime_types.cpp.

◆ as7BitString()

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 182 of file kmime_types.cpp.

◆ from7BitString()

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

Parses the given 7bit encoded string.

Definition at line 176 of file kmime_types.cpp.

◆ fromUnicodeString()

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

Parses the given unicode string.

Definition at line 171 of file kmime_types.cpp.

◆ hasAddress()

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

Returns true if this mailbox has an address.

Definition at line 144 of file kmime_types.cpp.

◆ hasName()

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

Returns true if this mailbox has a display name.

Definition at line 149 of file kmime_types.cpp.

◆ listFrom7BitString()

QList< 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 205 of file kmime_types.cpp.

◆ listFromUnicodeString()

QList< 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 201 of file kmime_types.cpp.

◆ listToUnicodeString()

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

Returns a unicode string representing the given list of mailboxes.

Since
5.15

Definition at line 220 of file kmime_types.cpp.

◆ name()

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

Returns the display name.

Definition at line 109 of file kmime_types.cpp.

◆ prettyAddress()

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 154 of file kmime_types.cpp.

◆ setAddress() [1/2]

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

Sets the email address.

Definition at line 114 of file kmime_types.cpp.

◆ setAddress() [2/2]

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

Sets the email address.

Definition at line 119 of file kmime_types.cpp.

◆ setName()

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

Sets the name.

Definition at line 132 of file kmime_types.cpp.

◆ setNameFrom7Bit()

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

Sets the name based on a 7bit encoded string.

Definition at line 137 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-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:46:48 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.