KMIME Library
kmime_content.cpp
Go to the documentation of this file.
436 if ( !ok || codec == NULL ) { // no suitable codec found => try local settings and hope the best ;-)
1066 c->contentType()->setName( QLatin1String( uup.filenames().at( i ) ), QByteArray( /*charset*/ ) );
1120 c->contentType()->setName( QLatin1String( yenc.filenames().at( i ) ), QByteArray( /*charset*/ ) );
This file is part of the API for handling MIME data and defines the Codec class.
void addContent(Content *content, bool prepend=false)
Adds a new sub-Content.
Definition: kmime_content.cpp:531
virtual QByteArray as7BitString(bool withHeaderType=true) const =0
Returns the encoded header.
contentEncoding encoding() const
Returns the encoding specified in this header.
Definition: kmime_headers.cpp:2088
QByteArray encodedBody()
Like encodedContent(), with the difference that only the body will be returned, i.e.
Definition: kmime_content.cpp:316
virtual QByteArray assembleHeaders()
Reimplement this method if you need to assemble additional headers in a derived class.
Definition: kmime_content.cpp:267
bool isMultipart() const
Returns true if the associated MIME entity is a mulitpart container.
Definition: kmime_headers.cpp:1824
This file is part of the API for handling MIME data and defines the Content class.
List contents() const
For multipart contents, this will return a list of all multipart child contents.
Definition: kmime_content.cpp:526
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:858
bool isText() const
Returns true if the associated MIME entity is a text.
Definition: kmime_headers.cpp:1804
Helper-class: tries to extract the data from a possibly uuencoded message.
Definition: kmime_parsers.h:97
void setMimeType(const QByteArray &mimeType)
Sets the mimetype and clears already existing parameters.
Definition: kmime_headers.cpp:1771
void setEpilogue(const QByteArray &epilogue)
Sets the MIME preamble.
Definition: kmime_content.cpp:179
virtual void setForceDefaultCharset(bool b)
Enables/disables the force mode, housekeeping.
Definition: kmime_content.cpp:881
virtual void setHeader(Headers::Base *h)
Sets the specified header to this Content.
Definition: kmime_content.cpp:725
virtual int maxDecodedSizeFor(int insize, bool withCRLF=false) const =0
Computes the maximum size, in characters, needed for the deccoding.
void setFrozen(bool frozen=true)
Freezes this Content if frozen is true; otherwise unfreezes it.
Definition: kmime_content.cpp:249
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:818
bool isValid() const
Returns true if this index is non-empty (valid).
Definition: kmime_contentindex.cpp:76
KMIME_DEPRECATED Headers::Generic * nextHeader(QByteArray &head)
Extracts and removes the next header from head.
Definition: kmime_content.cpp:675
void setHead(const QByteArray &head)
Sets the Content header raw data.
Definition: kmime_content.cpp:145
ContentIndex index() const
Returns the index of this Content based on the topLevel() object.
Definition: kmime_content.cpp:968
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
Headers::ContentDisposition * contentDisposition(bool create=true)
Returns the Content-Disposition header.
bool isSubtype(const char *subtype) const
Tests if the mime sub-type equals subtype.
Definition: kmime_headers.cpp:1792
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 setName(const QString &s, const QByteArray &cs)
Sets the name to s using charset cs.
Definition: kmime_headers.cpp:1864
QString decodedText(bool trimText=false, bool removeTrailingNewlines=false)
Returns the decoded text.
Definition: kmime_content.cpp:427
void setDisposition(contentDisposition disp)
Sets the content disposition.
Definition: kmime_headers.cpp:2195
virtual int maxEncodedSizeFor(int insize, bool withCRLF=false) const =0
Computes the maximum size, in characters, needed for the encoding.
bool hasContent() const
Returns true if this Content object is not empty.
Definition: kmime_content.cpp:100
void setDecoded(bool decoded=true)
Set whether the Content containing this header is already decoded.
Definition: kmime_headers.cpp:2111
Represents an arbitrary header, that can contain any header-field.
Definition: kmime_headers.h:1239
Content * content(const ContentIndex &index) const
Returns the Content specified by the given index.
Definition: kmime_content.cpp:894
KMIME_DEPRECATED QByteArray rawHeader(const char *name) const
Returns the raw string representing the header of type name.
Definition: kmime_content.cpp:813
An abstract base class of codecs for common mail transfer encodings.
Definition: kmime_codecs.h:83
void fromUnicodeString(const QString &s)
Sets the Content body to the given string using charset of the content type.
Definition: kmime_content.cpp:468
bool decoded() const
Returns whether the Content containing this header is already decoded.
Definition: kmime_headers.cpp:2106
static Codec * codecForName(const char *name)
Returns a codec associated with the specified name.
Definition: kmime_codecs.cpp:82
void setPreamble(const QByteArray &preamble)
Sets the MIME preamble.
Definition: kmime_content.cpp:168
void setBody(const QByteArray &body)
Sets the Content body raw data.
Definition: kmime_content.cpp:158
void setParent(KMime::Content *parent)
Sets the parent for this header to parent.
Definition: kmime_headers.cpp:173
Helper-class: splits a multipart-message into single parts as described in RFC 2046.
Definition: kmime_parsers.h:37
virtual Decoder * makeDecoder(bool withCRLF=false) const =0
Creates the decoder for the codec.
virtual void from7BitString(const QByteArray &s)
Parses the given string.
Definition: kmime_headers.cpp:255
void setPartialParams(int total, int number)
Sets parameters of a partial MIME entity.
Definition: kmime_headers.cpp:1912
boost::shared_ptr< Message > Ptr
A shared pointer to a message object.
Definition: kmime_message.h:92
Headers::ContentTransferEncoding * contentTransferEncoding(bool create=true)
Returns the Content-Transfer-Encoding header.
void setBoundary(const QByteArray &s)
Sets the mulitpart container boundary.
Definition: kmime_headers.cpp:1854
virtual bool isTopLevel() const
Returns true if this is the top-level node in the MIME tree.
Definition: kmime_content.cpp:928
virtual bool isEmpty() const =0
Checks if this header contains any data.
Headers::ContentType * contentType(bool create=true)
Returns the Content-Type header.
bool forceDefaultCharset() const
Use the default charset even if a different charset is declared in the article.
Definition: kmime_content.cpp:876
void changeEncoding(Headers::contentEncoding e)
Changes the encoding of this Content to e.
Definition: kmime_content.cpp:627
void toStream(QTextStream &ts, bool scrambleFromLines=false)
Saves the encoded Content to the given textstream.
Definition: kmime_content.cpp:657
int storageSize() const
Returns the size of this Content and all sub-Contents.
Definition: kmime_content.cpp:778
Content * topLevel() const
Returns the toplevel content object, 0 if there is no such object.
Definition: kmime_content.cpp:956
KMIME_DEPRECATED Headers::Generic * getNextHeader(QByteArray &head)
Extracts and removes the next header from head.
Definition: kmime_content.cpp:670
void removeContent(Content *content, bool del=false)
Removes the given sub-Content.
Definition: kmime_content.cpp:589
QByteArray boundary() const
Returns the boundary (for mulitpart containers).
Definition: kmime_headers.cpp:1849
void setDefaultCharset(const QByteArray &cs)
Sets the default charset.
Definition: kmime_content.cpp:863
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.
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
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:744
void setParent(Content *parent)
Sets a new parent to the Content and add to its contents list.
Definition: kmime_content.cpp:933
boost::shared_ptr< Message > bodyAsMessage() const
If this content is an encapsulated message, in which case bodyIsMessage() will return true...
Definition: kmime_content.cpp:978
virtual void clear()
Clears the content, deleting all headers and sub-Contents.
Definition: kmime_content.cpp:279
List attachments(bool incAlternatives=false)
Returns a list of attachments.
Definition: kmime_content.cpp:501
Content * textContent()
Returns the first Content with mimetype text/.
Definition: kmime_content.cpp:484
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:908
Helper-class: tries to extract the data from a possibly yenc encoded message.
Definition: kmime_parsers.h:112
void prependHeader(Headers::Base *h)
Prepends the specified header to the headers of this Content.
Definition: kmime_content.cpp:738
void appendHeader(Headers::Base *h)
Appends the specified header to the headers of this Content.
Definition: kmime_content.cpp:732
Content * parent() const
Returns the parent content object, or 0 if the content doesn't have a parent.
Definition: kmime_content.cpp:951
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:692
virtual QList< Headers::Base * > headersByType(const char *type)
Returns all type headers in the Content.
Definition: kmime_content.cpp:710
Represents a "Content-Transfer-Encoding" header.
Definition: kmime_headers.h:890
void clearContents(bool del=true)
Removes all sub-Contents from this content.
Definition: kmime_content.cpp:289
virtual const char * type() const
Returns the type of this header (e.g.
Definition: kmime_headers.cpp:202
int lineCount() const
Line count of this Content and all sub-Contents.
Definition: kmime_content.cpp:797
void setFilename(const QString &filename)
Sets the suggested filename for the associated MIME part.
Definition: kmime_headers.cpp:2206
A class to uniquely identify message parts (Content) in a hierarchy.
Definition: kmime_contentindex.h:54
virtual Headers::Base * headerByType(const char *type)
Returns the first header of type type, if it exists.
Definition: kmime_content.cpp:697
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.