Messagelib
stringutil.cpp
64 (c == QLatin1Char('>')) || (c == QLatin1Char(':')) || (c == QLatin1Char('|')) || (c == QLatin1Char(' ')) || (c == QLatin1Char('\t'));
102 // together into a single line in some cases. This is basically the main difference to flowText().
114 static bool flushPart(QString &msg, QStringList &textParts, const QString &indent, int maxLength)
265 || (!prefix.isEmpty() && line.startsWith(prefix) && line.mid(prefix.size()).indexOf(commonReplySearch) < 0)) {
294 qCWarning(MESSAGECORE_LOG) << "Error in address splitting: parseAddressList returned false!" << text;
416 KIdentityManagementCore::IdentityManager *im = KIdentityManagementCore::IdentityManager::self();
424 if (expandable == ExpandableAddresses && !expandableInserted && numberAddresses > collapseNumber) {
430 result = QStringLiteral("<span><input type=\"checkbox\" class=\"addresslist_checkbox\" id=\"%1\" checked=\"checked\"/><span class=\"short%1\">")
433 result += QStringLiteral("<label class=\"addresslist_label_short\" for=\"%1\"></label></span>").arg(fieldName);
441 QUrl::toPercentEncoding(KEmailAddress::encodeMailtoUrl(mailbox.prettyAddress(KMime::Types::Mailbox::QuoteWhenNecessary)).path()))
444 const bool foundMe = onlyOneIdentity && (im->identityForAddress(prettyAddressStr) != KIdentityManagementCore::Identity::null());
453 result += foundMe ? i18nMe : quoteHtmlChars(mailbox.prettyAddress(KMime::Types::Mailbox::QuoteWhenNecessary), true);
466 result += QStringLiteral("<label class=\"addresslist_label_full\" for=\"%1\"></label></span></span>").arg(fieldName);
480 return emailAddrAsAnchor(mailboxList->mailboxes(), display, cssStyle, link, expandable, fieldName, collapseNumber);
492 return emailAddrAsAnchor(addressList->mailboxes(), display, cssStyle, link, expandable, fieldName, collapseNumber);
501 if (qstricmp(addrSpec.toUtf8().data(), KEmailAddress::extractEmailAddress(*it).toUtf8().data()) == 0) {
523 address = KEmailAddress::quoteNameIfNecessary(fullName) + QLatin1String(" <") + address + QLatin1Char('>');
548 for (; needToContinue; lineStart = lineEnd + 1, lineEnd = msg.indexOf(QLatin1Char('\n'), lineStart)) {
725 MessageCore::MessageCoreSettings::self()->replyPrefixes() + MessageCore::MessageCoreSettings::self()->forwardPrefixes(),
731 QString cleanSubject(KMime::Message *msg, const QStringList &prefixRegExps, bool replace, const QString &newPrefix)
752 QString replacePrefixes(const QString &str, const QStringList &prefixRegExps, bool replace, const QString &newPrefix)
758 const QString bigRegExp = QStringLiteral("^(?:\\s+|(?:%1))+\\s*").arg(prefixRegExps.join(QStringLiteral(")|(?:")));
KCODECS_EXPORT QByteArray extractEmailAddress(const QByteArray &address)
void append(const T &value)
QString pattern() const const
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const const
void squeeze()
void truncate(int position)
Display
Used to determine if the visible part of the anchor contains only the name part and not the given ema...
Definition: stringutil.h:92
KCODECS_EXPORT QString quoteNameIfNecessary(const QString &str)
QString cleanSubject(KMime::Message *msg)
Return this mails subject, with all "forward" and "reply" prefixes removed.
Definition: stringutil.cpp:722
QList< QPair< QString, QString > > parseMailtoUrl(const QUrl &url)
Parses a mailto: url and extracts the information in the QMap (field name as key).
Definition: stringutil.cpp:162
QString replySubject(KMime::Message *msg)
Return this mails subject, formatted for "reply" mails.
Definition: stringutil.cpp:744
int size() const const
KPIMTEXTEDIT_EXPORT QString flowText(QString &text, const QString &indent, int maxLength)
void removePrivateHeaderFields(const KMime::Message::Ptr &message, bool cleanUpHeader)
Removes all private header fields (e.g.
Definition: stringutil.cpp:354
QString forwardSubject(KMime::Message *msg)
Return this mails subject, formatted for "forward" mails.
Definition: stringutil.cpp:736
QString scheme() const const
QDateTime currentDateTime()
int count(const T &value) const const
QString trimmed() const const
void clear()
QString asUnicodeString() const override
void chop(int n)
QStringList identities() const
QString stripSignature(const QString &msg)
Strips the signature blocks from a message text.
Definition: stringutil.cpp:223
Types::Mailbox::List mailboxes() const
QList::const_iterator constBegin() const const
void reserve(int size)
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const const
AddressList splitAddressField(const QByteArray &text)
Splits the given address list text into separate addresses.
Definition: stringutil.cpp:283
void removeAt(int i)
QString stripOffPrefixes(const QString &subject)
Removes the forward and reply marks (e.g.
Definition: stringutil.cpp:783
void removeLast()
KCODECS_EXPORT QString decodeMailtoUrl(const QUrl &mailtoUrl)
QString toString(QUrl::FormattingOptions options) const const
void setPattern(const QString &pattern)
KCODECS_EXPORT QString decodeRFC2047String(const QByteArray &src, QByteArray *usedCS, const QByteArray &defaultCS=QByteArray(), CharsetOption option=NoOption)
constexpr bool isEmpty() const
KCODECS_EXPORT QString toIdn(const QString &addrSpec)
QString smartQuote(const QString &msg, int maxLineLength)
Relayouts the given string so that the individual lines don't exceed the given maximal length.
Definition: stringutil.cpp:529
FullyDecoded
Types::Mailbox::List mailboxes() const
void setPatternOptions(QRegularExpression::PatternOptions options)
bool isEmpty() const const
bool isValid() const
QByteArray toUtf8() const const
int length() const const
QByteArray headerAsSendableString(const KMime::Message::Ptr &originalMessage)
Return the message header with the headers that should not be sent stripped off.
Definition: stringutil.cpp:394
QString replacePrefixes(const QString &str, const QStringList &prefixRegExps, bool replace, const QString &newPrefix)
Check for prefixes prefixRegExps in str.
Definition: stringutil.cpp:752
QString guessEmailAddressFromLoginName(const QString &loginName)
Uses the hostname as domain part and tries to determine the real name from the entries in the passwor...
Definition: stringutil.cpp:509
AddressMode
Used to determine if the address field should be expandable/collapsible.
Definition: stringutil.h:108
bool isEmpty() const const
QString formatQuotePrefix(const QString &wildString, const QString &fromDisplayString)
Convert quote wildcards into the final quote prefix.
Definition: stringutil.cpp:635
static IdentityManager * self()
QString join(const QString &separator) const const
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const const
QByteArray toPercentEncoding(const QString &input, const QByteArray &exclude, const QByteArray &include)
QRegularExpressionMatch match(const QString &subject, int offset, QRegularExpression::MatchType matchType, QRegularExpression::MatchOptions matchOptions) const const
bool addressIsInAddressList(const QString &address, const QStringList &addresses)
Returns true if the given address is contained in the given address list.
Definition: stringutil.cpp:495
QByteArray asSendableString(const KMime::Message::Ptr &originalMessage)
Returns the message contents with the headers that should not be sent stripped off.
Definition: stringutil.cpp:383
CaseInsensitiveOption
QString & replace(int position, int n, QChar after)
T & last()
QString & remove(int position, int n)
void setQuery(const QString &query, QUrl::ParsingMode mode)
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const const
QString quoteHtmlChars(const QString &str, bool removeLineBreaks)
Quotes the following characters which have a special meaning in HTML: '<' '>' '&' '"'....
Definition: stringutil.cpp:317
typedef ConstIterator
QVariant property(UserProperty which) const
QList::const_iterator constEnd() const const
QString path(QUrl::ComponentFormattingOptions options) const const
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
QString localHostName()
QString left(int n) const const
QString fromLatin1(const char *str, int size)
QString cleanFileName(const QString &name)
Cleans a filename by replacing characters not allowed or wanted on the filesystem e....
Definition: stringutil.cpp:686
KMime::Headers::Subject * subject(bool create=true)
const QChar at(int position) const const
const Identity & identityForAddress(const QString &addresses) const
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString toString(Qt::DateFormat format) const const
char toLatin1() const const
QString mid(int position, int n) const const
QuoteWhenNecessary
QVector< V > values(const QMultiHash< K, V > &c)
QString message
KCODECS_EXPORT QUrl encodeMailtoUrl(const QString &mailbox)
QUrl fromUserInput(const QString &userInput)
char * data()
bool isValid() const const
QString toString() const const
QString generateMessageId(const QString &address, const QString &suffix)
Generates the Message-Id.
Definition: stringutil.cpp:300
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 9 2023 03:55:29 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 9 2023 03:55:29 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.