KMime::Types::Mailbox

Search for usage in LXR

#include <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 (QByteArrayView s)
 
void fromUnicodeString (QStringView 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 (QByteArrayView s)
 
static QList< MailboxlistFromUnicodeString (QStringView 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 types.h.

Member Typedef Documentation

◆ List

Definition at line 40 of file 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 types.h.

Member Function Documentation

◆ address()

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

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

Definition at line 93 of file types.cpp.

◆ addrSpec()

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

Definition at line 104 of file types.cpp.

◆ as7BitString()

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

Returns a 7bit transport encoded representation of this mailbox.

Parameters
encCharsetThe charset used for encoding.

Definition at line 182 of file types.cpp.

◆ from7BitString()

void KMime::Types::Mailbox::from7BitString ( QByteArrayView s)

Parses the given 7bit encoded string.

Definition at line 176 of file types.cpp.

◆ fromUnicodeString()

void KMime::Types::Mailbox::fromUnicodeString ( QStringView s)

Parses the given unicode string.

Definition at line 171 of file types.cpp.

◆ hasAddress()

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

Returns true if this mailbox has an address.

Definition at line 144 of file types.cpp.

◆ hasName()

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

Returns true if this mailbox has a display name.

Definition at line 149 of file types.cpp.

◆ listFrom7BitString()

QList< KMime::Types::Mailbox > KMime::Types::Mailbox::listFrom7BitString ( QByteArrayView s)
staticnodiscard

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

Since
5.14

Definition at line 205 of file types.cpp.

◆ listFromUnicodeString()

QList< KMime::Types::Mailbox > KMime::Types::Mailbox::listFromUnicodeString ( QStringView s)
staticnodiscard

Returns a list of mailboxes from an unicode string.

Since
5.14

Definition at line 201 of file types.cpp.

◆ listToUnicodeString()

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

Returns a unicode string representing the given list of mailboxes.

Since
5.15

Definition at line 220 of file types.cpp.

◆ name()

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

Returns the display name.

Definition at line 109 of file types.cpp.

◆ prettyAddress()

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

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 types.cpp.

◆ setAddress() [1/2]

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

Sets the email address.

Definition at line 114 of file types.cpp.

◆ setAddress() [2/2]

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

Sets the email address.

Definition at line 119 of file types.cpp.

◆ setName()

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

Sets the name.

Definition at line 132 of file 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 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 Fri Jul 19 2024 11:52:51 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.