KMime
kmime_headers.cpp
Go to the documentation of this file.
386 if (d->mailboxList.size() == 1) { // fast-path to avoid temporary QStringList in the common case of just one From address
1440 //QT5 fix port to QDateTime Qt::RFC2822Date is not enough we need to fix it. We need to use QLocale("C") + add "ddd, ";
1921 maybeContentId.localPart = QString::fromLatin1(result); // FIXME: just use QByteArray instead of AddrSpec in msgIdList?
void append(const T &value)
QMap::const_iterator constBegin() const const
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:1624
bool isImage() const
Returns true if the associated MIME entity is an image.
Definition: kmime_headers.cpp:1725
int partialNumber() const
Returns the position of this part in a multi-part set.
Definition: kmime_headers.cpp:1776
bool isPlainText() const
Returns true if the associated MIME entity is a plain text.
Definition: kmime_headers.cpp:1717
QByteArray parameter() const
Returns the control message parameter.
Definition: kmime_headers.cpp:1285
Represents an (email address, display name) pair according RFC 2822, section 3.4.
Definition: kmime_types.h:37
int numberOfLines() const
Returns the number of lines, undefined if isEmpty() returns true.
Definition: kmime_headers.cpp:1596
virtual bool parse(const char *&scursor, const char *const send, bool isCRLF=false)=0
This method parses the raw header and needs to be implemented in every sub-class.
QByteArray toLower() const const
void fromIdent(const Ident *ident)
Initialize this identifier Copy the data from.
Definition: kmime_headers.cpp:1010
QString filename() const
Returns the suggested filename for the associated MIME part.
Definition: kmime_headers.cpp:2073
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:1592
QTextStream & endl(QTextStream &stream)
QString number(int n, int base)
QString fromUtf8(const char *str, int size)
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:1605
Base class for headers that deal with (possibly multiple) addresses, allowing groups.
Definition: kmime_headers.h:430
Represents a "Content-Transfer-Encoding" header.
Definition: kmime_headers.h:844
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition: kmime_headers.cpp:1347
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:709
QByteArray fromRawData(const char *data, int size)
void appendIdentifier(const QByteArray &id)
Appends a new identifier to this header.
Definition: kmime_headers.cpp:1017
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:795
QByteArray & append(char ch)
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:1536
QList< QByteArray > addresses() const
Returns a list of all addresses in this header, regardless of groups.
Definition: kmime_headers.cpp:538
int count(const T &value) const const
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition: kmime_headers.cpp:1485
void from7BitString(const char *s, size_t len) override
Parses the given string.
Definition: kmime_headers.cpp:228
QByteArray rfc2047Charset() const
Returns the charset that is used for RFC2047-encoding.
Definition: kmime_headers.cpp:113
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:402
Base class for headers containing a dot atom.
Definition: kmime_headers.h:631
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:1119
contentEncoding
Various possible values for the "Content-Transfer-Encoding" header.
Definition: kmime_headers.h:59
QByteArray & setNum(short n, int base)
void setRFC2047Charset(const QByteArray &cs)
Sets the charset for RFC2047-encoding.
Definition: kmime_headers.cpp:122
Types::Mailbox::List mailboxes() const
Returns a list of mailboxes listed in this header.
Definition: kmime_headers.cpp:573
bool neverCopy() const
Returns true if a mail copy was explicitly denied.
Definition: kmime_headers.cpp:1386
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:1453
QString displayString() const
Returns a single string for user-facing display of this address list.
Definition: kmime_headers.cpp:567
Base class for all address related headers.
Definition: kmime_headers.h:319
QByteArray toLatin1() const const
void fromUnicodeString(const QString &s, const QByteArray &b) override
Parses the given string and set the charset.
Definition: kmime_headers.cpp:318
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:2001
bool hasParameter(const QString &key) const
Definition: kmime_headers.cpp:869
Base class for headers that deal with (possibly multiple) addresses, but don't allow groups.
Definition: kmime_headers.h:340
const KIMAP2_EXPORT QByteArray encodeRFC2047String(const QByteArray &str)
QByteArray boundary() const
Returns the boundary (for multipart containers).
Definition: kmime_headers.cpp:1750
QByteArray & prepend(char ch)
Represents an arbitrary header, that can contain any header-field.
Definition: kmime_headers.h:1195
QByteArray mediaType() const
Returns the media type (first part of the mimetype).
Definition: kmime_headers.cpp:1658
void setGroups(const QList< QByteArray > &groups)
Sets the newsgroup list.
Definition: kmime_headers.cpp:1527
QString name() const
Returns the name of the associated MIME entity.
Definition: kmime_headers.cpp:1758
QString parameter(const QString &key) const
Returns the value of the specified parameter.
Definition: kmime_headers.cpp:864
QByteArray address() const
Returns a string representation of the email address, without the angle brackets.
Definition: kmime_types.cpp:93
bool isMimeType(const char *mimeType) const
Tests if the mime type is mimeType.
Definition: kmime_headers.cpp:1707
QDateTime dateTime() const
Returns the date contained in this header.
Definition: kmime_headers.cpp:1457
bool isSubtype(const char *subtype) const
Tests if the mime sub-type equals subtype.
Definition: kmime_headers.cpp:1696
Base class for headers containing a parameter list such as "Content-Type".
Definition: kmime_headers.h:654
void addAddress(const Types::Mailbox &mbox)
Adds an address to this header.
Definition: kmime_headers.cpp:342
QList< QByteArray > addresses() const
Returns a list of all addresses in this header, regardless of groups.
Definition: kmime_headers.cpp:358
void reserve(int alloc)
int size() const const
void addAddress(const Types::Mailbox &mbox)
Adds an address to this header.
Definition: kmime_headers.cpp:518
Base class for headers which deal with a list of msg-id's.
Definition: kmime_headers.h:495
Q_SCRIPTABLE Q_NOREPLY void start()
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:586
void fromUnicodeString(const QString &s, const QByteArray &b) override
Parses the given string and set the charset.
Definition: kmime_headers.cpp:486
KCODECS_EXPORT QString decodeRFC2047String(const QByteArray &src, QByteArray *usedCS, const QByteArray &defaultCS=QByteArray(), CharsetOption option=NoOption)
QByteArray typeIntro() const
Helper method, returns the header prefix including ":".
Definition: kmime_headers.cpp:142
void fromUnicodeString(const QString &s, const QByteArray &b) override
Parses the given string and set the charset.
Definition: kmime_headers.cpp:1505
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition: kmime_headers.cpp:1580
QLocale c()
Types::Mailbox::List mailboxes() const
Returns a list of mailboxes listed in this header.
Definition: kmime_headers.cpp:397
bool isMediatype(const char *mediatype) const
Tests if the media type equals mediatype.
Definition: kmime_headers.cpp:1689
contentDisposition disposition() const
Returns the content disposition.
Definition: kmime_headers.cpp:2064
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:947
bool isEmpty() const const
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:641
const char * type() const override
Returns the type of this header (e.g.
Definition: kmime_headers.cpp:1208
QByteArray toUtf8() const const
void setName(const QString &s, const QByteArray &cs)
Sets the name to s using charset cs.
Definition: kmime_headers.cpp:1762
Represents a "Content-Description" header.
Definition: kmime_headers.h:1237
Defines the Content class.
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:337
QString toString(qlonglong i) const const
bool alwaysCopy() const
Returns true if a mail copy was explicitly requested.
Definition: kmime_headers.cpp:1374
QStringList displayNames() const
Returns a list of all display names associated with the addresses in this header.
Definition: kmime_headers.cpp:368
virtual void from7BitString(const char *s, size_t len)
Parses the given string.
Definition: kmime_headers.cpp:108
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:1125
bool startsWith(const QByteArray &ba) const const
void fromUnicodeString(const QString &s, const QByteArray &b) override
Parses the given string and set the charset.
Definition: kmime_headers.cpp:256
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition: kmime_headers.cpp:779
Base class for headers which deal with a single atom.
Definition: kmime_headers.h:570
QByteArray subType() const
Returns the mime sub-type (second part of the mimetype).
Definition: kmime_headers.cpp:1668
QString displayString() const
Returns a single string for user-facing display of this mailbox list.
Definition: kmime_headers.cpp:383
QDate currentDate()
void setCancel(const QByteArray &msgid)
Changes this header into a cancel control message for the given message-id.
Definition: kmime_headers.cpp:1295
QString join(const QString &separator) const const
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:2081
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:1521
QList< QByteArray > identifiers() const
Returns the list of identifiers contained in this header.
Definition: kmime_headers.cpp:996
Base class for headers containing a list of phrases.
Definition: kmime_headers.h:603
void setParameter(const QString &key, const QString &value)
Sets the parameter key to value.
Definition: kmime_headers.cpp:874
static QByteArray defaultCharset()
Returns the charset that is used to decode RFC2047 strings in all headers and to decode the body if t...
Definition: kmime_content.cpp:748
bool isPartial() const
Returns true if the associated MIME entity contains partial data.
Definition: kmime_headers.cpp:1733
bool isText() const
Returns true if the associated MIME entity is a text.
Definition: kmime_headers.cpp:1713
bool isCancel() const
Returns true if this is a cancel control message.
Definition: kmime_headers.cpp:1290
contentEncoding encoding() const
Returns the encoding specified in this header.
Definition: kmime_headers.cpp:1971
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:2054
void setDisposition(contentDisposition disp)
Sets the content disposition.
Definition: kmime_headers.cpp:2068
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:790
Abstract base class for unstructured header fields (e.g.
Definition: kmime_headers.h:227
QString toLower() const const
Definition: kmime_header_parsing.h:20
Base class for structured header fields.
Definition: kmime_headers.h:283
int toInt(bool *ok, int base) const const
QStringList displayNames() const
Returns a list of all display names associated with the addresses in this header.
Definition: kmime_headers.cpp:550
QByteArray charset() const
Returns the charset for the associated MIME entity.
Definition: kmime_headers.cpp:1737
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition: kmime_headers.cpp:1635
Base class for headers that deal with exactly one mailbox (e.g.
Definition: kmime_headers.h:406
bool isEmpty() const const
void setNumberOfLines(int lines)
Sets the number of lines to lines.
Definition: kmime_headers.cpp:1600
void resize(int size)
bool isDecoded() const
Returns whether the Content containing this header is already decoded.
Definition: kmime_headers.cpp:1987
const char * constData() const const
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition: kmime_headers.cpp:325
QString fromLatin1(const char *str, int size)
contentDisposition
Various possible values for the "Content-Disposition" header.
Definition: kmime_headers.h:71
void setPartialParams(int total, int number)
Sets parameters of a partial MIME entity.
Definition: kmime_headers.cpp:1803
virtual QByteArray as7BitString(bool withHeaderType=true) const =0
Returns the encoded header.
QDate date() const const
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:1072
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:1302
bool isCrossposted() const
Returns true if this message has been cross-posted, i.e.
Definition: kmime_headers.cpp:1532
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:513
void clear()
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:1398
bool endsWith(const QByteArray &ba) const const
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:1471
QByteArray as7BitString(const QByteArray &encCharset) const
Returns a 7bit transport encoded representation of this mailbox.
Definition: kmime_types.cpp:181
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition: kmime_headers.cpp:251
int partialCount() const
Returns the total number of parts in a multi-part set.
Definition: kmime_headers.cpp:1785
QString prettyAddress(Quoting quoting=QuoteNever) const
Overloaded method that gives more control over the quoting of the display name.
Definition: kmime_types.cpp:154
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition: kmime_headers.cpp:1512
Base class for headers which deal with a single msg-id.
Definition: kmime_headers.h:539
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:952
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:1808
int length() const const
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:1369
bool isMultipart() const
Returns true if the associated MIME entity is a multipart container.
Definition: kmime_headers.cpp:1729
Represents a "Content-Disposition" header.
Definition: kmime_headers.h:1139
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition: kmime_headers.cpp:698
void setFilename(const QString &filename)
Sets the suggested filename for the associated MIME part.
Definition: kmime_headers.cpp:2077
void setDecoded(bool isDecoded=true)
Set whether the Content containing this header is already decoded.
Definition: kmime_headers.cpp:1991
QByteArray id() const
Returns the identifier of the associated MIME entity.
Definition: kmime_headers.cpp:1768
Represents a "Content-Location" header.
Definition: kmime_headers.h:1246
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:625
QByteArray encodeRFC2047String(const QString &src, const QByteArray &charset)
bool isHTMLText() const
Returns true if the associated MIME entity is a HTML file.
Definition: kmime_headers.cpp:1721
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:1275
qint64 daysTo(const QDate &d) const const
QString & append(QChar ch)
bool needToEncode() const
Returns whether the Content containing this header needs to be encoded (i.e., if decoded() is true an...
Definition: kmime_headers.cpp:1996
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:891
const KIMAP2_EXPORT QString encodeRFC2231String(const QString &str)
RFC2822Date
QStringList phrases() const
Returns the list of phrases contained in this header.
Definition: kmime_headers.cpp:714
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:880
Q_D(Todo)
void setBoundary(const QByteArray &s)
Sets the multipart container boundary.
Definition: kmime_headers.cpp:1754
bool parse(const char *&scursor, const char *const send, bool isCRLF=false) override
This method parses the raw header and needs to be implemented in every sub-class.
Definition: kmime_headers.cpp:719
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition: kmime_headers.cpp:493
virtual const char * type() const
Returns the type of this header (e.g.
Definition: kmime_headers.cpp:127
Defines the various headers classes.
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:1203
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 22 2023 03:52:43 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 22 2023 03:52:43 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.