KMime
kmime_headers.cpp
Go to the documentation of this file.
387 if (d->mailboxList.size() == 1) { // fast-path to avoid temporary QStringList in the common case of just one From address
1443 //QT5 fix port to QDateTime Qt::RFC2822Date is not enough we need to fix it. We need to use QLocale("C") + add "ddd, ";
1926 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:1629
bool isImage() const
Returns true if the associated MIME entity is an image.
Definition: kmime_headers.cpp:1730
int partialNumber() const
Returns the position of this part in a multi-part set.
Definition: kmime_headers.cpp:1781
bool isPlainText() const
Returns true if the associated MIME entity is a plain text.
Definition: kmime_headers.cpp:1722
QByteArray parameter() const
Returns the control message parameter.
Definition: kmime_headers.cpp:1288
QVector< QByteArray > identifiers() const
Returns the list of identifiers contained in this header.
Definition: kmime_headers.cpp:998
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:1601
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:1013
QString filename() const
Returns the suggested filename for the associated MIME part.
Definition: kmime_headers.cpp:2078
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:1597
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:1610
Base class for headers that deal with (possibly multiple) addresses, allowing groups.
Definition: kmime_headers.h:429
Represents a "Content-Transfer-Encoding" header.
Definition: kmime_headers.h:843
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition: kmime_headers.cpp:1350
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:711
QByteArray fromRawData(const char *data, int size)
void appendIdentifier(const QByteArray &id)
Appends a new identifier to this header.
Definition: kmime_headers.cpp:1020
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:797
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:1541
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition: kmime_headers.cpp:1488
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:403
Base class for headers containing a dot atom.
Definition: kmime_headers.h:630
void append(const T &value)
Q_SCRIPTABLE Q_NOREPLY void start()
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:1122
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:575
bool neverCopy() const
Returns true if a mail copy was explicitly denied.
Definition: kmime_headers.cpp:1389
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:1456
QString displayString() const
Returns a single string for user-facing display of this address list.
Definition: kmime_headers.cpp:569
Base class for all address related headers.
Definition: kmime_headers.h:318
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:2006
bool hasParameter(const QString &key) const
Definition: kmime_headers.cpp:871
Base class for headers that deal with (possibly multiple) addresses, but don't allow groups.
Definition: kmime_headers.h:339
QByteArray boundary() const
Returns the boundary (for multipart containers).
Definition: kmime_headers.cpp:1755
const KIMAP_EXPORT QString encodeRFC2231String(const QString &str)
QByteArray & prepend(char ch)
Represents an arbitrary header, that can contain any header-field.
Definition: kmime_headers.h:1194
QByteArray mediaType() const
Returns the media type (first part of the mimetype).
Definition: kmime_headers.cpp:1663
QString name() const
Returns the name of the associated MIME entity.
Definition: kmime_headers.cpp:1763
QString parameter(const QString &key) const
Returns the value of the specified parameter.
Definition: kmime_headers.cpp:866
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:1712
QDateTime dateTime() const
Returns the date contained in this header.
Definition: kmime_headers.cpp:1460
bool isSubtype(const char *subtype) const
Tests if the mime sub-type equals subtype.
Definition: kmime_headers.cpp:1701
Base class for headers containing a parameter list such as "Content-Type".
Definition: kmime_headers.h:653
void addAddress(const Types::Mailbox &mbox)
Adds an address to this header.
Definition: kmime_headers.cpp:342
void reserve(int alloc)
QVector< QByteArray > addresses() const
Returns a list of all addresses in this header, regardless of groups.
Definition: kmime_headers.cpp:539
int size() const const
void addAddress(const Types::Mailbox &mbox)
Adds an address to this header.
Definition: kmime_headers.cpp:519
Base class for headers which deal with a list of msg-id's.
Definition: kmime_headers.h:494
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:588
void fromUnicodeString(const QString &s, const QByteArray &b) override
Parses the given string and set the charset.
Definition: kmime_headers.cpp:487
void clear()
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:1508
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition: kmime_headers.cpp:1585
QLocale c()
Types::Mailbox::List mailboxes() const
Returns a list of mailboxes listed in this header.
Definition: kmime_headers.cpp:398
bool isMediatype(const char *mediatype) const
Tests if the media type equals mediatype.
Definition: kmime_headers.cpp:1694
contentDisposition disposition() const
Returns the content disposition.
Definition: kmime_headers.cpp:2069
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:949
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:643
const char * type() const override
Returns the type of this header (e.g.
Definition: kmime_headers.cpp:1211
QByteArray toUtf8() const const
void setName(const QString &s, const QByteArray &cs)
Sets the name to s using charset cs.
Definition: kmime_headers.cpp:1767
Represents a "Content-Description" header.
Definition: kmime_headers.h:1236
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:1377
QStringList displayNames() const
Returns a list of all display names associated with the addresses in this header.
Definition: kmime_headers.cpp:369
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:1128
bool startsWith(const QByteArray &ba) const const
void setGroups(const QVector< QByteArray > &groups)
Sets the newsgroup list.
Definition: kmime_headers.cpp:1532
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:781
Base class for headers which deal with a single atom.
Definition: kmime_headers.h:569
QByteArray subType() const
Returns the mime sub-type (second part of the mimetype).
Definition: kmime_headers.cpp:1673
QString displayString() const
Returns a single string for user-facing display of this mailbox list.
Definition: kmime_headers.cpp:384
QDate currentDate()
void setCancel(const QByteArray &msgid)
Changes this header into a cancel control message for the given message-id.
Definition: kmime_headers.cpp:1298
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:2086
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:1524
Base class for headers containing a list of phrases.
Definition: kmime_headers.h:602
void setParameter(const QString &key, const QString &value)
Sets the parameter key to value.
Definition: kmime_headers.cpp:876
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:755
void reserve(int size)
bool isPartial() const
Returns true if the associated MIME entity contains partial data.
Definition: kmime_headers.cpp:1738
bool isText() const
Returns true if the associated MIME entity is a text.
Definition: kmime_headers.cpp:1718
bool isCancel() const
Returns true if this is a cancel control message.
Definition: kmime_headers.cpp:1293
contentEncoding encoding() const
Returns the encoding specified in this header.
Definition: kmime_headers.cpp:1976
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:2059
void setDisposition(contentDisposition disp)
Sets the content disposition.
Definition: kmime_headers.cpp:2073
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:792
Abstract base class for unstructured header fields (e.g.
Definition: kmime_headers.h:226
QString toLower() const const
Definition: kmime_header_parsing.h:20
Base class for structured header fields.
Definition: kmime_headers.h:282
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:552
QByteArray charset() const
Returns the charset for the associated MIME entity.
Definition: kmime_headers.cpp:1742
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition: kmime_headers.cpp:1640
Base class for headers that deal with exactly one mailbox (e.g.
Definition: kmime_headers.h:405
bool isEmpty() const const
void setNumberOfLines(int lines)
Sets the number of lines to lines.
Definition: kmime_headers.cpp:1605
void resize(int size)
QVector< QByteArray > groups() const
Returns the list of newsgroups.
Definition: kmime_headers.cpp:1528
bool isDecoded() const
Returns whether the Content containing this header is already decoded.
Definition: kmime_headers.cpp:1992
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:1808
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:1075
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:1305
bool isCrossposted() const
Returns true if this message has been cross-posted, i.e.
Definition: kmime_headers.cpp:1537
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:514
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:1401
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:1474
QByteArray as7BitString(const QByteArray &encCharset) const
Returns a 7bit transport encoded representation of this mailbox.
Definition: kmime_types.cpp:181
int count(const T &value) const const
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:1790
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:1515
Base class for headers which deal with a single msg-id.
Definition: kmime_headers.h:538
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:954
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:1813
int length() const const
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:1372
bool isMultipart() const
Returns true if the associated MIME entity is a multipart container.
Definition: kmime_headers.cpp:1734
const KIMAP_EXPORT QByteArray encodeRFC2047String(const QByteArray &str)
Represents a "Content-Disposition" header.
Definition: kmime_headers.h:1138
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition: kmime_headers.cpp:700
void setFilename(const QString &filename)
Sets the suggested filename for the associated MIME part.
Definition: kmime_headers.cpp:2082
void setDecoded(bool isDecoded=true)
Set whether the Content containing this header is already decoded.
Definition: kmime_headers.cpp:1996
QByteArray id() const
Returns the identifier of the associated MIME entity.
Definition: kmime_headers.cpp:1773
Represents a "Content-Location" header.
Definition: kmime_headers.h:1245
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:627
QByteArray encodeRFC2047String(const QString &src, const QByteArray &charset)
QVector< QByteArray > addresses() const
Returns a list of all addresses in this header, regardless of groups.
Definition: kmime_headers.cpp:358
bool isHTMLText() const
Returns true if the associated MIME entity is a HTML file.
Definition: kmime_headers.cpp:1726
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:1278
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:2001
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:893
RFC2822Date
QStringList phrases() const
Returns the list of phrases contained in this header.
Definition: kmime_headers.cpp:716
bool isEmpty() const override
Checks if this header contains any data.
Definition: kmime_headers.cpp:882
Q_D(Todo)
void setBoundary(const QByteArray &s)
Sets the multipart container boundary.
Definition: kmime_headers.cpp:1759
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:721
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition: kmime_headers.cpp:494
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:1206
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 03:58:49 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 03:58:49 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.