KMIME Library
kmime_content.cpp
Go to the documentation of this file.
1089 c->contentType()->setName( QLatin1String( uup.filenames().at( i ) ), QByteArray( /*charset*/ ) );
1143 c->contentType()->setName( QLatin1String( yenc.filenames().at( i ) ), QByteArray( /*charset*/ ) );
An abstract base class of codecs for common mail transfer encodings.
Definition kmime_codecs.h:84
static Codec * codecForName(const char *name)
Returns a codec associated with the specified name.
Definition kmime_codecs.cpp:82
virtual int maxEncodedSizeFor(int insize, bool withCRLF=false) const =0
Computes the maximum size, in characters, needed for the encoding.
virtual int maxDecodedSizeFor(int insize, bool withCRLF=false) const =0
Computes the maximum size, in characters, needed for the deccoding.
virtual Decoder * makeDecoder(bool withCRLF=false) const =0
Creates the decoder for the codec.
A class to uniquely identify message parts (Content) in a hierarchy.
Definition kmime_contentindex.h:55
bool isValid() const
Returns true if this index is non-empty (valid).
Definition kmime_contentindex.cpp:76
bool hasContent() const
Returns true if this Content object is not empty.
Definition kmime_content.cpp:100
Headers::ContentType * contentType(bool create=true)
Returns the Content-Type header.
QString decodedText(bool trimText=false, bool removeTrailingNewlines=false)
Returns the decoded text.
Definition kmime_content.cpp:433
virtual void setHeader(Headers::Base *h)
Sets the specified header to this Content.
Definition kmime_content.cpp:748
QByteArray encodedBody()
Like encodedContent(), with the difference that only the body will be returned, i....
Definition kmime_content.cpp:322
Content * topLevel() const
Returns the toplevel content object, 0 if there is no such object.
Definition kmime_content.cpp:979
virtual Headers::Base * headerByType(const char *type)
Returns the first header of type type, if it exists.
Definition kmime_content.cpp:720
KMIME_DEPRECATED QByteArray rawHeader(const char *name) const
Returns the raw string representing the header of type name.
Definition kmime_content.cpp:836
void clearContents(bool del=true)
Removes all sub-Contents from this content.
Definition kmime_content.cpp:289
int storageSize() const
Returns the size of this Content and all sub-Contents.
Definition kmime_content.cpp:801
virtual KMIME_DEPRECATED Headers::Base * getHeaderByType(const char *type)
Tries to find a type header in the Content and returns it.
Definition kmime_content.cpp:715
KMIME_DEPRECATED Headers::Generic * getNextHeader(QByteArray &head)
Extracts and removes the next header from head.
Definition kmime_content.cpp:693
ContentIndex index() const
Returns the index of this Content based on the topLevel() object.
Definition kmime_content.cpp:991
virtual QList< Headers::Base * > headersByType(const char *type)
Returns all type headers in the Content.
Definition kmime_content.cpp:733
void removeContent(Content *content, bool del=false)
Removes the given sub-Content.
Definition kmime_content.cpp:611
Headers::ContentTransferEncoding * contentTransferEncoding(bool create=true)
Returns the Content-Transfer-Encoding header.
List attachments(bool incAlternatives=false)
Returns a list of attachments.
Definition kmime_content.cpp:507
Content * parent() const
Returns the parent content object, or 0 if the content doesn't have a parent.
Definition kmime_content.cpp:974
void setDefaultCharset(const QByteArray &cs)
Sets the default charset.
Definition kmime_content.cpp:886
boost::shared_ptr< Message > bodyAsMessage() const
If this content is an encapsulated message, in which case bodyIsMessage() will return true,...
Definition kmime_content.cpp:1001
KMIME_DEPRECATED Headers::Generic * nextHeader(QByteArray &head)
Extracts and removes the next header from head.
Definition kmime_content.cpp:698
Headers::ContentDisposition * contentDisposition(bool create=true)
Returns the Content-Disposition header.
void setContent(const QList< QByteArray > &l)
Sets the Content to the given raw data, containing the Content head and body separated by two linefee...
Definition kmime_content.cpp:105
void addContent(Content *content, bool prepend=false)
Adds a new sub-Content.
Definition kmime_content.cpp:537
Content * textContent()
Returns the first Content with mimetype text/.
Definition kmime_content.cpp:490
Content * content(const ContentIndex &index) const
Returns the Content specified by the given index.
Definition kmime_content.cpp:917
virtual bool removeHeader(const char *type)
Searches for the first header of type type, and deletes it, removing it from this Content.
Definition kmime_content.cpp:767
void prependHeader(Headers::Base *h)
Prepends the specified header to the headers of this Content.
Definition kmime_content.cpp:761
virtual bool isTopLevel() const
Returns true if this is the top-level node in the MIME tree.
Definition kmime_content.cpp:951
QByteArray encodedContent(bool useCrLf=false)
Returns a QByteArray containing the encoded Content, including the Content header and all sub-Content...
Definition kmime_content.cpp:299
void toStream(QTextStream &ts, bool scrambleFromLines=false)
Saves the encoded Content to the given textstream.
Definition kmime_content.cpp:680
int lineCount() const
Line count of this Content and all sub-Contents.
Definition kmime_content.cpp:820
T * header(bool create=false)
Returns the first header of type T, if it exists.
Definition kmime_content.h:836
QByteArray defaultCharset() const
Returns the charset that is used to decode RFC2047 strings in all headers and to decode the body if t...
Definition kmime_content.cpp:881
KMIME_DEPRECATED QList< QByteArray > rawHeaders(const char *name) const
Returns a list of raw strings representing all header of type name.
Definition kmime_content.cpp:841
ContentIndex indexForContent(Content *content) const
Returns the ContentIndex for the given Content, or an invalid index if the Content is not found withi...
Definition kmime_content.cpp:931
virtual void setForceDefaultCharset(bool b)
Enables/disables the force mode, housekeeping.
Definition kmime_content.cpp:904
virtual QByteArray assembleHeaders()
Reimplement this method if you need to assemble additional headers in a derived class.
Definition kmime_content.cpp:267
void setFrozen(bool frozen=true)
Freezes this Content if frozen is true; otherwise unfreezes it.
Definition kmime_content.cpp:249
virtual void clear()
Clears the content, deleting all headers and sub-Contents.
Definition kmime_content.cpp:279
List contents() const
For multipart contents, this will return a list of all multipart child contents.
Definition kmime_content.cpp:532
bool forceDefaultCharset() const
Use the default charset even if a different charset is declared in the article.
Definition kmime_content.cpp:899
void setParent(Content *parent)
Sets a new parent to the Content and add to its contents list.
Definition kmime_content.cpp:956
void changeEncoding(Headers::contentEncoding e)
Changes the encoding of this Content to e.
Definition kmime_content.cpp:650
void fromUnicodeString(const QString &s)
Sets the Content body to the given string using charset of the content type.
Definition kmime_content.cpp:474
void setHead(const QByteArray &head)
Sets the Content header raw data.
Definition kmime_content.cpp:145
void appendHeader(Headers::Base *h)
Appends the specified header to the headers of this Content.
Definition kmime_content.cpp:755
virtual bool decode(const char *&scursor, const char *const send, char *&dcursor, const char *const dend)=0
Decodes a chunk of data, maintaining state information between calls.
virtual const char * type() const
Returns the type of this header (e.g.
Definition kmime_headers.cpp:202
virtual QByteArray as7BitString(bool withHeaderType=true) const =0
Returns the encoded header.
virtual bool isEmpty() const =0
Checks if this header contains any data.
void setParent(KMime::Content *parent)
Sets the parent for this header to parent.
Definition kmime_headers.cpp:173
void setDisposition(contentDisposition disp)
Sets the content disposition.
Definition kmime_headers.cpp:2195
void setFilename(const QString &filename)
Sets the suggested filename for the associated MIME part.
Definition kmime_headers.cpp:2206
Represents a "Content-Transfer-Encoding" header.
Definition kmime_headers.h:891
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:2117
void setDecoded(bool decoded=true)
Set whether the Content containing this header is already decoded.
Definition kmime_headers.cpp:2111
bool decoded() const
Returns whether the Content containing this header is already decoded.
Definition kmime_headers.cpp:2106
contentEncoding encoding() const
Returns the encoding specified in this header.
Definition kmime_headers.cpp:2088
void setName(const QString &s, const QByteArray &cs)
Sets the name to s using charset cs.
Definition kmime_headers.cpp:1864
bool isSubtype(const char *subtype) const
Tests if the mime sub-type equals subtype.
Definition kmime_headers.cpp:1792
bool isText() const
Returns true if the associated MIME entity is a text.
Definition kmime_headers.cpp:1804
void setPartialParams(int total, int number)
Sets parameters of a partial MIME entity.
Definition kmime_headers.cpp:1912
bool isMultipart() const
Returns true if the associated MIME entity is a mulitpart container.
Definition kmime_headers.cpp:1824
void setMimeType(const QByteArray &mimeType)
Sets the mimetype and clears already existing parameters.
Definition kmime_headers.cpp:1771
QByteArray boundary() const
Returns the boundary (for mulitpart containers).
Definition kmime_headers.cpp:1849
void setBoundary(const QByteArray &s)
Sets the mulitpart container boundary.
Definition kmime_headers.cpp:1854
Represents an arbitrary header, that can contain any header-field.
Definition kmime_headers.h:1240
virtual void from7BitString(const QByteArray &s)
Parses the given string.
Definition kmime_headers.cpp:255
Helper-class: splits a multipart-message into single parts as described in RFC 2046.
Definition kmime_parsers.h:38
Helper-class: tries to extract the data from a possibly uuencoded message.
Definition kmime_parsers.h:98
Helper-class: tries to extract the data from a possibly yenc encoded message.
Definition kmime_parsers.h:113
This file is part of the API for handling MIME data and defines the Codec class.
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 kmime_headers.h:74
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.