KMime
headers.h
Go to the documentation of this file.
668 [[deprecated("use QByteArrayView as argument")]] [[nodiscard]] inline QString parameter(const QString &key) const
672 [[deprecated("use QByteArrayView as argument")]] [[nodiscard]] inline QString parameter(QLatin1StringView key) const
689 [[deprecated("use QByteArrayView as argument")]] [[nodiscard]] inline bool hasParameter(const QString &key) const
693 [[deprecated("use QByteArrayView as argument")]] [[nodiscard]] inline bool hasParameter(QLatin1StringView key) const
709 [[deprecated("use a QByteArray[Literal] key")]] inline void setParameter(const QString &key, const QString &value)
virtual QByteArray as7BitString(bool withHeaderType=true) const =0
Returns the encoded header.
virtual void from7BitString(QByteArrayView s)=0
Parses the given string.
virtual void fromUnicodeString(const QString &s)=0
Parses the given Unicode representation of the header content.
virtual QString asUnicodeString() const =0
Returns the decoded content of the header without the header-type.
virtual bool isEmpty() const =0
Checks if this header contains any data.
void setRFC2047Charset(const QByteArray &cs)
Sets the charset for RFC2047-encoding.
Definition headers.cpp:114
QByteArray rfc2047Charset() const
Returns the charset that is used for RFC2047-encoding.
Definition headers.cpp:105
QByteArray typeIntro() const
Helper method, returns the header prefix including ":".
Definition headers.cpp:129
Represents a "Content-Description" header.
Definition headers.h:1240
Represents a "Content-Disposition" header.
Definition headers.h:1145
void setDisposition(contentDisposition disp)
Sets the content disposition.
Definition headers.cpp:1995
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 headers.cpp:2008
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:1962
QString filename() const
Returns the suggested filename for the associated MIME part.
Definition headers.cpp:2000
void setFilename(const QString &filename)
Sets the suggested filename for the associated MIME part.
Definition headers.cpp:2004
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 headers.cpp:1806
Represents a "Content-Transfer-Encoding" header.
Definition headers.h:868
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 headers.cpp:1926
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:1899
contentEncoding encoding() const
Returns the encoding specified in this header.
Definition headers.cpp:1914
QByteArray mediaType() const
Returns the media type (first part of the mimetype).
Definition headers.cpp:1611
bool isImage() const
Returns true if the associated MIME entity is an image.
Definition headers.cpp:1672
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 headers.cpp:1745
bool isMediatype(const char *mediatype) const
Tests if the media type equals mediatype.
Definition headers.cpp:1636
int partialCount() const
Returns the total number of parts in a multi-part set.
Definition headers.cpp:1731
bool isSubtype(const char *subtype) const
Tests if the mime sub-type equals subtype.
Definition headers.cpp:1643
QByteArray charset() const
Returns the charset for the associated MIME entity.
Definition headers.cpp:1684
QByteArray subType() const
Returns the mime sub-type (second part of the mimetype).
Definition headers.cpp:1621
bool isPlainText() const
Returns true if the associated MIME entity is a plain text.
Definition headers.cpp:1664
int partialNumber() const
Returns the position of this part in a multi-part set.
Definition headers.cpp:1722
bool isHTMLText() const
Returns true if the associated MIME entity is a HTML file.
Definition headers.cpp:1668
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:1588
void setPartialParams(int total, int number)
Sets parameters of a partial MIME entity.
Definition headers.cpp:1740
bool isMultipart() const
Returns true if the associated MIME entity is a multipart container.
Definition headers.cpp:1676
QByteArray id() const
Returns the identifier of the associated MIME entity.
Definition headers.cpp:1714
bool isPartial() const
Returns true if the associated MIME entity contains partial data.
Definition headers.cpp:1680
bool isMimeType(const char *mimeType) const
Tests if the mime type is mimeType.
Definition headers.cpp:1654
QByteArray boundary() const
Returns the boundary (for multipart containers).
Definition headers.cpp:1697
void setBoundary(const QByteArray &s)
Sets the multipart container boundary.
Definition headers.cpp:1701
void setCancel(const QByteArray &msgid)
Changes this header into a cancel control message for the given message-id.
Definition headers.cpp:1274
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:1235
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 headers.cpp:1281
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 headers.cpp:1437
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:1406
Base class for headers that deal with (possibly multiple) addresses, allowing groups.
Definition headers.h:424
void setAddressList(const Types::AddressList &addresses)
Sets the list of addresses listed in this header, replacing the existing content.
Definition headers.cpp:577
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 headers.cpp:583
void fromUnicodeString(const QString &s) override
Parses the given Unicode representation of the header content.
Definition headers.cpp:484
QStringList displayNames() const
Returns a list of all display names associated with the addresses in this header.
Definition headers.cpp:541
void addAddress(const Types::Mailbox &mbox)
Adds an address to this header.
Definition headers.cpp:509
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition headers.cpp:490
Types::Mailbox::List mailboxes() const
Returns a list of mailboxes listed in this header.
Definition headers.cpp:564
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:462
QString displayString() const
Returns a single string for user-facing display of this address list.
Definition headers.cpp:558
QList< QByteArray > addresses() const
Returns a list of all addresses in this header, regardless of groups.
Definition headers.cpp:529
Base class for headers containing a dot atom.
Definition headers.h:631
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition headers.cpp:764
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:749
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 headers.cpp:774
Base class for headers which deal with a list of msg-id's.
Definition headers.h:495
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:881
QList< QByteArray > identifiers() const
Returns the list of identifiers contained in this header.
Definition headers.cpp:956
void fromIdent(const Ident *ident)
Initialize this identifier Copy the data from.
Definition headers.cpp:970
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 headers.cpp:913
void appendIdentifier(const QByteArray &id)
Appends a new identifier to this header.
Definition headers.cpp:976
Base class for headers that deal with (possibly multiple) addresses, but don't allow groups.
Definition headers.h:308
void setMailboxes(const Types::Mailbox::List &mailboxes)
Sets the mailboxes listed in this header, replacing the current content.
Definition headers.cpp:349
QString displayString() const
Returns a single string for user-facing display of this mailbox list.
Definition headers.cpp:330
QList< QByteArray > addresses() const
Returns a list of all addresses in this header, regardless of groups.
Definition headers.cpp:305
Types::Mailbox::List mailboxes() const
Returns a list of mailboxes listed in this header.
Definition headers.cpp:344
void addAddress(const Types::Mailbox &mbox)
Adds an address to this header.
Definition headers.cpp:289
void fromUnicodeString(const QString &s) override
Parses the given Unicode representation of the header content.
Definition headers.cpp:272
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:253
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 headers.cpp:355
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition headers.cpp:278
QStringList displayNames() const
Returns a list of all display names associated with the addresses in this header.
Definition headers.cpp:315
Base class for headers containing a parameter list such as "Content-Type".
Definition headers.h:653
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:803
bool hasParameter(QByteArrayView key) const
Definition headers.cpp:843
QString parameter(QByteArrayView key) const
Returns the value of the specified parameter.
Definition headers.cpp:836
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 headers.cpp:859
void setParameter(const QByteArray &key, const QString &value)
Sets the parameter key to value.
Definition headers.cpp:848
Base class for headers containing a list of phrases.
Definition headers.h:604
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition headers.cpp:689
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 headers.cpp:704
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:666
QStringList phrases() const
Returns the list of phrases contained in this header.
Definition headers.cpp:699
Base class for headers which deal with a single msg-id.
Definition headers.h:538
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:1004
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 headers.cpp:1068
QByteArray identifier() const
Returns the identifier contained in this header.
Definition headers.cpp:1030
Base class for headers that deal with exactly one mailbox (e.g.
Definition headers.h:380
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition headers.cpp:414
void fromUnicodeString(const QString &s) override
Parses the given Unicode representation of the header content.
Definition headers.cpp:408
void setMailbox(const Types::Mailbox &mailbox)
Sets the mailboxes in this header, replacing the current content.
Definition headers.cpp:432
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 headers.cpp:438
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:393
Base class for structured header fields.
Definition headers.h:269
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition headers.cpp:218
void fromUnicodeString(const QString &s) override
Parses the given Unicode representation of the header content.
Definition headers.cpp:223
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.
Base class for headers which deal with a single atom.
Definition headers.h:572
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 headers.cpp:632
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:605
Abstract base class for unstructured header fields (e.g.
Definition headers.h:215
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:162
void fromUnicodeString(const QString &s) override
Parses the given Unicode representation of the header content.
Definition headers.cpp:174
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition headers.cpp:180
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:1531
int numberOfLines() const
Returns the number of lines, undefined if isEmpty() returns true.
Definition headers.cpp:1556
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition headers.cpp:1545
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 headers.cpp:1565
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 headers.cpp:1372
bool alwaysCopy() const
Returns true if a mail copy was explicitly requested.
Definition headers.cpp:1346
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition headers.cpp:1327
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:1309
void fromUnicodeString(const QString &s) override
Parses the given Unicode representation of the header content.
Definition headers.cpp:1476
void setGroups(const QList< QByteArray > &groups)
Sets the newsgroup list.
Definition headers.cpp:1492
bool isCrossposted() const
Returns true if this message has been cross-posted, i.e.
Definition headers.cpp:1497
QString asUnicodeString() const override
Returns the decoded content of the header without the header-type.
Definition headers.cpp:1482
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:1456
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 headers.cpp:1501
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 headers.cpp:1119
QByteArray as7BitString(bool withHeaderType=true) const override
Returns the encoded header.
Definition headers.cpp:1099
Represents an (email address, display name) pair according RFC 2822, section 3.4.
Definition types.h:38
contentEncoding
Various possible values for the "Content-Transfer-Encoding" header.
Definition headers.h:52
contentDisposition
Various possible values for the "Content-Disposition" header.
Definition headers.h:64
QByteArray toUtf8() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:47:20 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:47:20 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.