KMime
kmime_headers.cpp
Go to the documentation of this file.
1897 maybeContentId.localPart = QString::fromLatin1(result); // FIXME: just use QByteArray instead of AddrSpec in msgIdList?
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:771
virtual const char * type() const
Returns the type of this header (e.g.
Definition kmime_headers.cpp:127
virtual QByteArray as7BitString(bool withHeaderType=true) const =0
Returns the encoded header.
virtual void from7BitString(const char *s, size_t len)
Parses the given string.
Definition kmime_headers.cpp:108
void setRFC2047Charset(const QByteArray &cs)
Sets the charset for RFC2047-encoding.
Definition kmime_headers.cpp:122
QByteArray rfc2047Charset() const
Returns the charset that is used for RFC2047-encoding.
Definition kmime_headers.cpp:113
QByteArray typeIntro() const
Helper method, returns the header prefix including ":".
Definition kmime_headers.cpp:142
Represents a "Content-Description" header.
Definition kmime_headers.h:1226
Represents a "Content-Disposition" header.
Definition kmime_headers.h:1128
void setDisposition(contentDisposition disp)
Sets the content disposition.
Definition kmime_headers.cpp:2044
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:2057
bool isEmpty() const override
Checks if this header contains any data.
Definition kmime_headers.cpp:2030
contentDisposition disposition() const
Returns the content disposition.
Definition kmime_headers.cpp:2040
QString filename() const
Returns the suggested filename for the associated MIME part.
Definition kmime_headers.cpp:2049
void setFilename(const QString &filename)
Sets the suggested filename for the associated MIME part.
Definition kmime_headers.cpp:2053
Represents a "Content-Location" header.
Definition kmime_headers.h:1235
Represents a "Content-Transfer-Encoding" header.
Definition kmime_headers.h:838
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:1972
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:1977
void setDecoded(bool isDecoded=true)
Set whether the Content containing this header is already decoded.
Definition kmime_headers.cpp:1967
bool isDecoded() const
Returns whether the Content containing this header is already decoded.
Definition kmime_headers.cpp:1963
contentEncoding encoding() const
Returns the encoding specified in this header.
Definition kmime_headers.cpp:1947
QByteArray mediaType() const
Returns the media type (first part of the mimetype).
Definition kmime_headers.cpp:1656
void setName(const QString &s, const QByteArray &cs)
Sets the name to s using charset cs.
Definition kmime_headers.cpp:1754
bool isImage() const
Returns true if the associated MIME entity is an image.
Definition kmime_headers.cpp:1717
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:1791
bool isMediatype(const char *mediatype) const
Tests if the media type equals mediatype.
Definition kmime_headers.cpp:1681
int partialCount() const
Returns the total number of parts in a multi-part set.
Definition kmime_headers.cpp:1777
bool isSubtype(const char *subtype) const
Tests if the mime sub-type equals subtype.
Definition kmime_headers.cpp:1688
QByteArray charset() const
Returns the charset for the associated MIME entity.
Definition kmime_headers.cpp:1729
QByteArray subType() const
Returns the mime sub-type (second part of the mimetype).
Definition kmime_headers.cpp:1666
bool isPlainText() const
Returns true if the associated MIME entity is a plain text.
Definition kmime_headers.cpp:1709
int partialNumber() const
Returns the position of this part in a multi-part set.
Definition kmime_headers.cpp:1768
bool isText() const
Returns true if the associated MIME entity is a text.
Definition kmime_headers.cpp:1705
bool isHTMLText() const
Returns true if the associated MIME entity is a HTML file.
Definition kmime_headers.cpp:1713
QString name() const
Returns the name of the associated MIME entity.
Definition kmime_headers.cpp:1750
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition kmime_headers.cpp:1633
void setPartialParams(int total, int number)
Sets parameters of a partial MIME entity.
Definition kmime_headers.cpp:1786
bool isEmpty() const override
Checks if this header contains any data.
Definition kmime_headers.cpp:1623
bool isMultipart() const
Returns true if the associated MIME entity is a multipart container.
Definition kmime_headers.cpp:1721
QByteArray id() const
Returns the identifier of the associated MIME entity.
Definition kmime_headers.cpp:1760
bool isPartial() const
Returns true if the associated MIME entity contains partial data.
Definition kmime_headers.cpp:1725
bool isMimeType(const char *mimeType) const
Tests if the mime type is mimeType.
Definition kmime_headers.cpp:1699
QByteArray boundary() const
Returns the boundary (for multipart containers).
Definition kmime_headers.cpp:1742
void setBoundary(const QByteArray &s)
Sets the multipart container boundary.
Definition kmime_headers.cpp:1746
void setCancel(const QByteArray &msgid)
Changes this header into a cancel control message for the given message-id.
Definition kmime_headers.cpp:1289
bool isCancel() const
Returns true if this is a cancel control message.
Definition kmime_headers.cpp:1284
bool isEmpty() const override
Checks if this header contains any data.
Definition kmime_headers.cpp:1269
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:1296
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:1465
QDateTime dateTime() const
Returns the date contained in this header.
Definition kmime_headers.cpp:1451
bool isEmpty() const override
Checks if this header contains any data.
Definition kmime_headers.cpp:1447
Represents an arbitrary header, that can contain any header-field.
Definition kmime_headers.h:1184
bool isEmpty() const override
Checks if this header contains any data.
Definition kmime_headers.cpp:1197
const char * type() const override
Returns the type of this header (e.g.
Definition kmime_headers.cpp:1202
Base class for headers that deal with (possibly multiple) addresses, allowing groups.
Definition kmime_headers.h:424
QStringList displayNames() const
Returns a list of all display names associated with the addresses in this header.
Definition kmime_headers.cpp:550
Base class for all address related headers.
Definition kmime_headers.h:313
Base class for headers containing a dot atom.
Definition kmime_headers.h:625
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition kmime_headers.cpp:779
bool isEmpty() const override
Checks if this header contains any data.
Definition kmime_headers.cpp:790
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
Base class for headers which deal with a list of msg-id's.
Definition kmime_headers.h:489
QList< QByteArray > identifiers() const
Returns the list of identifiers contained in this header.
Definition kmime_headers.cpp:990
void fromIdent(const Ident *ident)
Initialize this identifier Copy the data from.
Definition kmime_headers.cpp:1004
bool isEmpty() const override
Checks if this header contains any data.
Definition kmime_headers.cpp:941
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:946
void appendIdentifier(const QByteArray &id)
Appends a new identifier to this header.
Definition kmime_headers.cpp:1011
Base class for headers that deal with (possibly multiple) addresses, but don't allow groups.
Definition kmime_headers.h:334
QStringList displayNames() const
Returns a list of all display names associated with the addresses in this header.
Definition kmime_headers.cpp:368
Base class for headers containing a parameter list such as "Content-Type".
Definition kmime_headers.h:648
bool isEmpty() const override
Checks if this header contains any data.
Definition kmime_headers.cpp:874
QString parameter(const QString &key) const
Returns the value of the specified parameter.
Definition kmime_headers.cpp:858
void setParameter(const QString &key, const QString &value)
Sets the parameter key to value.
Definition kmime_headers.cpp:868
bool hasParameter(const QString &key) const
Definition kmime_headers.cpp:863
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:885
Base class for headers containing a list of phrases.
Definition kmime_headers.h:597
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition kmime_headers.cpp:698
bool isEmpty() const override
Checks if this header contains any data.
Definition kmime_headers.cpp:709
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
QStringList phrases() const
Returns the list of phrases contained in this header.
Definition kmime_headers.cpp:714
Base class for headers which deal with a single msg-id.
Definition kmime_headers.h:533
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:1066
Base class for headers that deal with exactly one mailbox (e.g.
Definition kmime_headers.h:400
Base class for structured header fields.
Definition kmime_headers.h:277
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition kmime_headers.cpp:251
void from7BitString(const char *s, size_t len) override
Parses the given string.
Definition kmime_headers.cpp:228
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.
void fromUnicodeString(const QString &s, const QByteArray &b) override
Parses the given string and set the charset.
Definition kmime_headers.cpp:256
Base class for headers which deal with a single atom.
Definition kmime_headers.h:564
bool isEmpty() const override
Checks if this header contains any data.
Definition kmime_headers.cpp:625
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
Abstract base class for unstructured header fields (e.g.
Definition kmime_headers.h:221
bool isEmpty() const override
Checks if this header contains any data.
Definition kmime_headers.cpp:1591
int numberOfLines() const
Returns the number of lines, undefined if isEmpty() returns true.
Definition kmime_headers.cpp:1595
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition kmime_headers.cpp:1579
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:1604
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:1392
bool neverCopy() const
Returns true if a mail copy was explicitly denied.
Definition kmime_headers.cpp:1380
bool alwaysCopy() const
Returns true if a mail copy was explicitly requested.
Definition kmime_headers.cpp:1368
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition kmime_headers.cpp:1341
bool isEmpty() const override
Checks if this header contains any data.
Definition kmime_headers.cpp:1363
void setGroups(const QList< QByteArray > &groups)
Sets the newsgroup list.
Definition kmime_headers.cpp:1526
void fromUnicodeString(const QString &s, const QByteArray &b) override
Parses the given string and set the charset.
Definition kmime_headers.cpp:1504
bool isEmpty() const override
Checks if this header contains any data.
Definition kmime_headers.cpp:1520
bool isCrossposted() const
Returns true if this message has been cross-posted, i.e.
Definition kmime_headers.cpp:1531
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition kmime_headers.cpp:1511
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition kmime_headers.cpp:1484
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:1535
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:1119
bool isEmpty() const override
Checks if this header contains any data.
Definition kmime_headers.cpp:1113
Represents an (email address, display name) pair according RFC 2822, section 3.4.
Definition kmime_types.h:38
QByteArray as7BitString(const QByteArray &encCharset) const
Returns a 7bit transport encoded representation of this mailbox.
Definition kmime_types.cpp:182
QString prettyAddress(Quoting quoting=QuoteNever) const
Overloaded method that gives more control over the quoting of the display name.
Definition kmime_types.cpp:154
QByteArray address() const
Returns a string representation of the email address, without the angle brackets.
Definition kmime_types.cpp:93
static QString listToUnicodeString(const QList< Mailbox > &mailboxes)
Returns a unicode string representing the given list of mailboxes.
Definition kmime_types.cpp:220
Q_SCRIPTABLE Q_NOREPLY void start()
This file is part of the API for handling MIME data and defines the Content class.
This file is part of the API for handling MIME data and defines the various header classes:
contentEncoding
Various possible values for the "Content-Transfer-Encoding" header.
Definition kmime_headers.h:52
contentDisposition
Various possible values for the "Content-Disposition" header.
Definition kmime_headers.h:64
KCODECS_EXPORT QByteArray encodeRFC2047String(QStringView src, const QByteArray &charset)
KCODECS_EXPORT QString decodeRFC2047String(QByteArrayView src, QByteArray *usedCS, const QByteArray &defaultCS=QByteArray(), CharsetOption option=NoOption)
QByteArray & append(QByteArrayView data)
const char * constData() const const
bool endsWith(QByteArrayView bv) const const
QByteArray fromRawData(const char *data, qsizetype size)
bool isEmpty() const const
qsizetype length() const const
QByteArray & prepend(QByteArrayView ba)
void resize(qsizetype newSize, char c)
QByteArray & setNum(double n, char format, int precision)
bool startsWith(QByteArrayView bv) const const
int toInt(bool *ok, int base) const const
QByteArray toLower() const const
QDate currentDate()
qint64 daysTo(QDate d) const const
QDate date() const const
void append(QList< T > &&value)
void clear()
qsizetype count() const const
bool isEmpty() const const
void reserve(qsizetype size)
qsizetype size() const const
QLocale c()
QString toString(QDate date, FormatType format) const const
const_iterator constBegin() const const
QString & append(QChar ch)
QString fromLatin1(QByteArrayView str)
QString fromUtf8(QByteArrayView str)
bool isEmpty() const const
QString number(double n, char format, int precision)
QByteArray toLatin1() const const
QString toLower() const const
QByteArray toUtf8() const const
QString join(QChar separator) const const
RFC2822Date
QTextStream & endl(QTextStream &stream)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Apr 27 2024 22:14:42 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Apr 27 2024 22:14:42 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.