KMime
content.cpp
Go to the documentation of this file.
138 if (ct->isEmpty()) { //Set default content-type as defined in https://tools.ietf.org/html/rfc2045#page-10 (5.2. Content-Type Defaults)
381 if (!codec.isValid()) { // no suitable codec found => try local settings and hope for the best ;-)
414 if (!codec.isValid()) { // no suitable codec found => try local settings and hope for the best ;-)
664 return m_decoded && cte && (cte->encoding() == Headers::CEquPr || cte->encoding() == Headers::CEbase64);
891 // uup.binaryParts().at(i) does no longer have the uuencode header, which makes KCodecs fail since 5c66308c4786ef7fbf77b0e306e73f7d4ac3431b
virtual qsizetype maxEncodedSizeFor(qsizetype insize, NewlineType newline=NewlineLF) const=0
static Codec * codecForName(QByteArrayView name)
virtual Decoder * makeDecoder(NewlineType newline=NewlineLF) const=0
virtual qsizetype maxDecodedSizeFor(qsizetype insize, NewlineType newline=NewlineLF) const=0
A class to uniquely identify message parts (Content) in a hierarchy.
Definition contentindex.h:41
bool removeHeader()
Searches for the first header of type T, and deletes it, removing it from this Content.
Definition content.h:817
Headers::ContentType * contentType(bool create=true)
Returns the Content-Type header.
const Headers::ContentType * contentType() const
Returns the Content-Type header.
void setHeader(Headers::Base *h)
Sets the specified header to this Content.
Definition content.cpp:592
QByteArray encodedBody() const
Like encodedContent(), with the difference that only the body will be returned, i....
Definition content.cpp:259
void clearContents(bool del=true)
Removes all sub-Contents from this content.
Definition content.cpp:226
Content * takeContent(Content *content)
Removes the given sub-Content and, if that actually was a sub-content returns that.
Definition content.cpp:518
ContentIndex index() const
Returns the index of this Content based on the topLevel() object.
Definition content.cpp:787
Headers::Base * headerByType(QByteArrayView type) const
Returns the first header of type type, if it exists.
Definition content.cpp:568
Headers::ContentTransferEncoding * contentTransferEncoding(bool create=true)
Returns the Content-Transfer-Encoding header.
Content * parent()
Returns the parent content object, or 0 if the content doesn't have a parent.
Definition content.cpp:759
void setEncodedBody(const QByteArray &body)
Sets the Content body raw data encoded according to the content transfer encoding.
Definition content.cpp:89
bool removeHeader(QByteArrayView type)
Searches for the first header of type type, and deletes it, removing it from this Content.
Definition content.cpp:605
QList< Headers::Base * > headersByType(QByteArrayView type) const
Returns all type headers in the Content.
Definition content.cpp:579
QSharedPointer< Message > bodyAsMessage()
If this content is an encapsulated message, in which case bodyIsMessage() will return true,...
Definition content.cpp:797
Content * content(const ContentIndex &index) const
Returns the Content specified by the given index.
Definition content.cpp:702
qsizetype size() const
Returns the size of the Content body after encoding.
Definition content.cpp:625
bool isTopLevel() const
Returns true if this is the top-level node in the MIME tree.
Definition content.cpp:736
Content(Content *parent=nullptr)
Creates an empty Content object with a specified parent.
Definition content.cpp:39
const Headers::ContentTransferEncoding * contentTransferEncoding() const
Returns the Content-Transfer-Encoding header.
ContentIndex indexForContent(Content *content) const
Returns the ContentIndex for the given Content, or an invalid index if the Content is not found withi...
Definition content.cpp:716
void setContent(const QByteArray &s)
Sets the Content to the given raw data, containing the Content head and body separated by two linefee...
Definition content.cpp:59
virtual QByteArray assembleHeaders()
Reimplement this method if you need to assemble additional headers in a derived class.
Definition content.cpp:203
void setFrozen(bool frozen=true)
Freezes this Content if frozen is true; otherwise unfreezes it.
Definition content.cpp:184
QString decodedText(DecodedTextTrimOption trimOption=NoTrim) const
Returns the decoded text.
Definition content.cpp:371
qsizetype storageSize() const
Returns the size of this Content and all sub-Contents.
Definition content.cpp:641
void setParent(Content *parent)
Sets a new parent to the Content and add to its contents list.
Definition content.cpp:741
QList< Content * > attachments()
Returns all attachments below this node, recursively.
Definition content.cpp:448
void setBody(const QByteArray &body)
Sets the Content decoded body raw data.
Definition content.cpp:83
void changeEncoding(Headers::contentEncoding e)
Changes the encoding of this Content to e.
Definition content.cpp:534
Content * topLevel()
Returns the toplevel content object, 0 if there is no such object.
Definition content.cpp:769
void fromUnicodeString(const QString &s)
Sets the Content body to the given string using charset of the content type.
Definition content.cpp:410
QByteArray encodedContent(bool useCrLf=false) const
Returns a QByteArray containing the encoded Content, including the Content header and all sub-Content...
Definition content.cpp:236
QList< Content * > contents()
For multipart contents, this will return a list of all multipart child contents.
Definition content.cpp:468
void appendHeader(Headers::Base *h)
Appends the specified header to the headers of this Content.
Definition content.cpp:599
Represents a "Content-Transfer-Encoding" header.
Definition headers.h:861
contentEncoding encoding() const
Returns the encoding specified in this header.
Definition headers.cpp:1881
bool isMultipart() const
Returns true if the associated MIME entity is a multipart container.
Definition headers.cpp:1643
QByteArray boundary() const
Returns the boundary (for multipart containers).
Definition headers.cpp:1664
This file is part of the API for handling MIME data and defines the Content class.
contentEncoding
Various possible values for the "Content-Transfer-Encoding" header.
Definition headers.h:52
KCODECS_EXPORT QByteArray uudecode(QByteArrayView in)
KCODECS_EXPORT QByteArray base64Encode(QByteArrayView in)
KCODECS_EXPORT QByteArray quotedPrintableDecode(QByteArrayView in)
KCODECS_EXPORT QByteArray base64Decode(QByteArrayView in)
KCODECS_EXPORT QByteArray quotedPrintableEncode(QByteArrayView in, bool useCRLF=true)
iterator begin()
const_iterator constEnd() const const
const_iterator
bool endsWith(QByteArrayView bv) const const
bool isEmpty() const const
iterator
void resize(qsizetype newSize, char c)
qsizetype size() const const
bool startsWith(QByteArrayView bv) const const
void truncate(qsizetype pos)
pointer data()
void push_back(parameter_type value)
void reserve(qsizetype size)
System
bool isValid() const const
const char * name() const const
EncodedData< QByteArrayView > decode(QByteArrayView ba)
DecodedData< QStringView > encode(QStringView in)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:47:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:47:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.