KCodecs
kemailaddress.cpp
89splitAddressInternal(const QByteArray &address, QByteArray &displayName, QByteArray &addrSpec, QByteArray &comment, bool allowMultipleAddresses)
251EmailParseResult KEmailAddress::splitAddress(const QByteArray &address, QByteArray &displayName, QByteArray &addrSpec, QByteArray &comment)
257EmailParseResult KEmailAddress::splitAddress(const QString &address, QString &displayName, QString &addrSpec, QString &comment)
479KEmailAddress::EmailParseResult KEmailAddress::isValidAddressList(const QString &aStr, QString &badAddr)
614 if (localPart[0] == QLatin1Char('\"') || localPart[localPart.length() - 1] == QLatin1Char('\"')) {
617 addrRx = QStringLiteral("[a-zA-Z]*[~|{}`\\^?=/+*'&%$#!_\\w.-]*[~|{}`\\^?=/+*'&%$#!_a-zA-Z0-9-]@");
619 if (domainPart[0] == QLatin1Char('[') || domainPart[domainPart.length() - 1] == QLatin1Char(']')) {
625 const QRegularExpression rx(QRegularExpression::anchoredPattern(addrRx), QRegularExpression::UseUnicodePropertiesOption);
650 const EmailParseResult result = splitAddressInternal(address, dummy1, addrSpec, dummy2, false /* don't allow multiple addresses */);
688 const EmailParseResult result = splitAddressInternal(addresses, dummy1, addrSpec, dummy2, true /* allow multiple addresses */);
715bool KEmailAddress::extractEmailAddressAndName(const QString &aStr, QString &mail, QString &name)
940QString KEmailAddress::normalizedAddress(const QString &displayName, const QString &addrSpec, const QString &comment)
947 return quoteNameIfNecessary(realDisplayName) + QLatin1String(" <") + addrSpec + QLatin1Char('>');
954 return realDisplayName + QLatin1String(" (") + comment + QLatin1String(") <") + addrSpec + QLatin1Char('>');
1012 normalizedAddressList << normalizedAddress(QString::fromUtf8(displayName), fromIdn(QString::fromUtf8(addrSpec)), QString::fromUtf8(comment));
1042 normalizedAddressList << normalizedAddress(QString::fromUtf8(displayName), toIdn(QString::fromUtf8(addrSpec)), QString::fromUtf8(comment));
1095 static const QRegularExpression needQuotes(QStringLiteral("[^ 0-9A-Za-z\\x{0080}-\\x{FFFF}]"));
1098 quoted = QLatin1String("\"") + escapeQuotes(quoted.mid(1, quoted.length() - 2)) + QLatin1String("\"");
bool isEmpty() const
void stop(Ekos::AlignState mode)
KCODECS_EXPORT QString normalizedAddress(const QString &displayName, const QString &addrSpec, const QString &comment=QString())
Returns a normalized address built from the given parts.
Definition kemailaddress.cpp:940
KCODECS_EXPORT QByteArray extractEmailAddress(const QByteArray &address)
Returns the pure email address (addr-spec in RFC2822) of the given address (mailbox in RFC2822).
Definition kemailaddress.cpp:639
KCODECS_EXPORT QString quoteNameIfNecessary(const QString &str)
Add quote characters around the given string if it contains a character that makes that necessary,...
Definition kemailaddress.cpp:1088
KCODECS_EXPORT bool extractEmailAddressAndName(const QString &aStr, QString &mail, QString &name)
Return email address and name from string.
Definition kemailaddress.cpp:715
KCODECS_EXPORT bool compareEmail(const QString &email1, const QString &email2, bool matchName)
Compare two email addresses.
Definition kemailaddress.cpp:911
KCODECS_EXPORT QByteArray firstEmailAddress(const QByteArray &addresses)
Returns the pure email address (addr-spec in RFC2822) of the first email address of a list of address...
Definition kemailaddress.cpp:677
KCODECS_EXPORT QString fromIdn(const QString &addrSpec)
Decodes the punycode domain part of the given addr-spec if it's an IDN.
Definition kemailaddress.cpp:959
KCODECS_EXPORT QString normalizeAddressesAndEncodeIdn(const QString &str)
Normalizes all email addresses in the given list and encodes all IDNs in punycode.
Definition kemailaddress.cpp:1025
KCODECS_EXPORT QString normalizeAddressesAndDecodeIdn(const QString &addresses)
Normalizes all email addresses in the given list and decodes all IDNs.
Definition kemailaddress.cpp:991
KCODECS_EXPORT QString toIdn(const QString &addrSpec)
Encodes the domain part of the given addr-spec in punycode if it's an IDN.
Definition kemailaddress.cpp:975
KCODECS_EXPORT EmailParseResult isValidAddress(const QString &aStr)
Validates an email address in the form of "Joe User" joe@example.org.
Definition kemailaddress.cpp:275
KCODECS_EXPORT QString simpleEmailAddressErrorMsg()
Returns a i18n string to be used in msgboxes.
Definition kemailaddress.cpp:630
KCODECS_EXPORT EmailParseResult isValidAddressList(const QString &aStr, QString &badAddr)
Validates a list of email addresses, and also allow aliases and distribution lists to be expanded bef...
Definition kemailaddress.cpp:479
KCODECS_EXPORT QStringList splitAddressList(const QString &aStr)
Split a comma separated list of email addresses.
Definition kemailaddress.cpp:16
KCODECS_EXPORT EmailParseResult splitAddress(const QByteArray &address, QByteArray &displayName, QByteArray &addrSpec, QByteArray &comment)
Splits the given address into display name, email address and comment.
Definition kemailaddress.cpp:251
KCODECS_EXPORT bool isValidSimpleAddress(const QString &aStr)
Validates an email address in the form of joe@example.org.
Definition kemailaddress.cpp:576
KCODECS_EXPORT QString emailParseResultToString(EmailParseResult errorCode)
Translate the enum errorcodes from emailParseResult into i18n'd strings that can be used for msg boxe...
Definition kemailaddress.cpp:499
This file provides static methods for email address validation.
AKONADI_CALENDAR_EXPORT QString displayName(Akonadi::ETMCalendar *calendar, const Akonadi::Collection &collection)
KCODECS_EXPORT QByteArray encodeRFC2047String(QStringView src, const QByteArray &charset)
Encodes string src according to RFC2047 using charset charset.
Definition kcodecs.cpp:407
KCODECS_EXPORT QString decodeRFC2047String(QStringView text)
Decodes string text according to RFC2047, i.e., the construct =?charset?[qb]?encoded?...
Definition kcodecs.cpp:340
Definition kemailaddress.h:30
KCODECS_EXPORT QUrl encodeMailtoUrl(const QString &mailbox)
Creates a valid mailto: URL from the given mailbox.
Definition kemailaddress.cpp:1106
KCODECS_EXPORT QString decodeMailtoUrl(const QUrl &mailtoUrl)
Extracts the mailbox out of the mailto: URL.
Definition kemailaddress.cpp:1115
PostalAddress address(const QVariant &location)
bool isEmpty() const const
QByteArray trimmed() const const
char toLatin1() const const
const_iterator cbegin() const const
const_iterator cend() const const
QString tr(const char *sourceText, const char *disambiguation, int n)
QRegularExpressionMatch match(QStringView subjectView, qsizetype offset, MatchType matchType, MatchOptions matchOptions) const const
UseUnicodePropertiesOption
QString anchoredPattern(QStringView expression)
bool hasMatch() const const
qsizetype count() const const
QString & append(QChar ch)
void clear()
QString fromUtf8(QByteArrayView str)
qsizetype indexOf(QChar ch, qsizetype from, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
qsizetype lastIndexOf(QChar ch, Qt::CaseSensitivity cs) const const
QString left(qsizetype n) const const
qsizetype length() const const
QString mid(qsizetype position, qsizetype n) const const
QString & prepend(QChar ch)
QString & remove(QChar ch, Qt::CaseSensitivity cs)
void reserve(qsizetype size)
QString simplified() const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
QByteArray toLatin1() const const
QByteArray toUtf8() const const
QString trimmed() const const
void truncate(qsizetype position)
QString join(QChar separator) const const
QString fromAce(const QByteArray &domain, AceProcessingOptions options)
QString path(ComponentFormattingOptions options) const const
QString scheme() const const
void setPath(const QString &path, ParsingMode mode)
void setScheme(const QString &scheme)
QByteArray toAce(const QString &domain, AceProcessingOptions options)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.