KMime
content.cpp
Go to the documentation of this file.
139 if (ct->isEmpty()) { //Set default content-type as defined in https://tools.ietf.org/html/rfc2045#page-10 (5.2. Content-Type Defaults)
382 if (!codec.isValid()) { // no suitable codec found => try local settings and hope for the best ;-)
415 if (!codec.isValid()) { // no suitable codec found => try local settings and hope for the best ;-)
662 return m_decoded && cte && (cte->encoding() == Headers::CEquPr || cte->encoding() == Headers::CEbase64);
890 // 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:764
Headers::ContentType * contentType(bool create=true)
Returns the Content-Type header.
QList< Content * > attachments() const
Returns all attachments below this node, recursively.
Definition content.cpp:449
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:590
QByteArray encodedBody() const
Like encodedContent(), with the difference that only the body will be returned, i....
Definition content.cpp:260
void clearContents(bool del=true)
Removes all sub-Contents from this content.
Definition content.cpp:227
Content * takeContent(Content *content)
Removes the given sub-Content and, if that actually was a sub-content returns that.
Definition content.cpp:516
ContentIndex index() const
Returns the index of this Content based on the topLevel() object.
Definition content.cpp:785
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:757
void setEncodedBody(const QByteArray &body)
Sets the Content body raw data encoded according to the content transfer encoding.
Definition content.cpp:90
QSharedPointer< Message > bodyAsMessage() const
If this content is an encapsulated message, in which case bodyIsMessage() will return true,...
Definition content.cpp:795
Content * content(const ContentIndex &index) const
Returns the Content specified by the given index.
Definition content.cpp:700
qsizetype size() const
Returns the size of the Content body after encoding.
Definition content.cpp:623
bool isTopLevel() const
Returns true if this is the top-level node in the MIME tree.
Definition content.cpp:734
QString decodedText(bool trimText=false, bool removeTrailingNewlines=false) const
Returns the decoded text.
Definition content.cpp:372
QList< Headers::Base * > headersByType(const char *type) const
Returns all type headers in the Content.
Definition content.cpp:576
Content(Content *parent=nullptr)
Creates an empty Content object with a specified parent.
Definition content.cpp:40
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:714
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:60
Headers::Base * headerByType(const char *type) const
Returns the first header of type type, if it exists.
Definition content.cpp:563
virtual QByteArray assembleHeaders()
Reimplement this method if you need to assemble additional headers in a derived class.
Definition content.cpp:204
void setFrozen(bool frozen=true)
Freezes this Content if frozen is true; otherwise unfreezes it.
Definition content.cpp:185
qsizetype storageSize() const
Returns the size of this Content and all sub-Contents.
Definition content.cpp:639
QList< Content * > contents() const
For multipart contents, this will return a list of all multipart child contents.
Definition content.cpp:469
void setParent(Content *parent)
Sets a new parent to the Content and add to its contents list.
Definition content.cpp:739
void setBody(const QByteArray &body)
Sets the Content decoded body raw data.
Definition content.cpp:84
void changeEncoding(Headers::contentEncoding e)
Changes the encoding of this Content to e.
Definition content.cpp:532
Content * topLevel()
Returns the toplevel content object, 0 if there is no such object.
Definition content.cpp:767
void fromUnicodeString(const QString &s)
Sets the Content body to the given string using charset of the content type.
Definition content.cpp:411
QByteArray encodedContent(bool useCrLf=false) const
Returns a QByteArray containing the encoded Content, including the Content header and all sub-Content...
Definition content.cpp:237
void appendHeader(Headers::Base *h)
Appends the specified header to the headers of this Content.
Definition content.cpp:597
Represents a "Content-Transfer-Encoding" header.
Definition headers.h:872
contentEncoding encoding() const
Returns the encoding specified in this header.
Definition headers.cpp:1921
void setPartialParams(int total, int number)
Sets parameters of a partial MIME entity.
Definition headers.cpp:1759
bool isMultipart() const
Returns true if the associated MIME entity is a multipart container.
Definition headers.cpp:1695
QByteArray boundary() const
Returns the boundary (for multipart containers).
Definition headers.cpp:1716
void setBoundary(const QByteArray &s)
Sets the multipart container boundary.
Definition headers.cpp:1720
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
typedef const_iterator
bool endsWith(QByteArrayView bv) const const
bool isEmpty() const const
typedef iterator
void resize(qsizetype newSize, char c)
qsizetype size() const const
bool startsWith(QByteArrayView bv) const const
void truncate(qsizetype pos)
qsizetype count() const const
pointer data()
void push_back(parameter_type value)
void reserve(qsizetype size)
void chop(qsizetype n)
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
qsizetype length() const const
void truncate(qsizetype position)
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 Jul 26 2024 11:51:33 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:51:33 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.