VMime
htmlTextPart Class Reference
Inheritance diagram for htmlTextPart:
Collaboration diagram for htmlTextPart:

Classes

class  embeddedObject
 

Public Member Functions

 htmlTextPart ()
 
 ~htmlTextPart ()
 
const mediaType getType () const
 
const charsetgetCharset () const
 
void setCharset (const charset &ch)
 
shared_ptr< const contentHandlergetPlainText () const
 
void setPlainText (shared_ptr< contentHandler > plainText)
 
const shared_ptr< const contentHandlergetText () const
 
void setText (shared_ptr< contentHandler > text)
 
bool hasObject (const string &id) const
 
shared_ptr< const embeddedObjectfindObject (const string &id) const
 
size_t getObjectCount () const
 
shared_ptr< const embeddedObjectgetObjectAt (const size_t pos) const
 
shared_ptr< const embeddedObjectaddObject (const string &data, const mediaType &type)
 
shared_ptr< const embeddedObjectaddObject (shared_ptr< contentHandler > data, const mediaType &type)
 
shared_ptr< const embeddedObjectaddObject (shared_ptr< contentHandler > data, const encoding &enc, const mediaType &type)
 
size_t getPartCount () const
 
void generateIn (shared_ptr< bodyPart > message, shared_ptr< bodyPart > parent) const
 
void parse (shared_ptr< const bodyPart > message, shared_ptr< const bodyPart > parent, shared_ptr< const bodyPart > textPart)
 
- Public Member Functions inherited from textPart
virtual ~textPart ()
 

Additional Inherited Members

- Protected Member Functions inherited from object
 object ()
 
 object (const object &)
 
objectoperator= (const object &)
 
virtual ~object ()
 

Detailed Description

Text part of type 'text/html'.

Constructor & Destructor Documentation

◆ htmlTextPart()

◆ ~htmlTextPart()

Member Function Documentation

◆ addObject() [1/3]

shared_ptr< const htmlTextPart::embeddedObject > addObject ( const string data,
const mediaType type 
)

Embed an object and returns a string which identifies it.

The returned identifier is suitable for use in the 'src' attribute of an <img> tag.

Deprecated:
Use the addObject() methods which take a 'contentHandler' parameter type instead.
Parameters
dataobject data
typedata type
Returns
an unique object identifier used to identify the new object among all other embedded objects

References encoding::decide().

◆ addObject() [2/3]

shared_ptr< const htmlTextPart::embeddedObject > addObject ( shared_ptr< contentHandler data,
const encoding enc,
const mediaType type 
)

Embed an object and returns a string which identifies it.

The returned identifier is suitable for use in the 'src' attribute of an <img> tag.

Parameters
dataobject data
encdata encoding
typedata type
Returns
an unique object identifier used to identify the new object among all other embedded objects

References messageId::generateId(), and messageId::getId().

◆ addObject() [3/3]

shared_ptr< const htmlTextPart::embeddedObject > addObject ( shared_ptr< contentHandler data,
const mediaType type 
)

Embed an object and returns a string which identifies it.

The returned identifier is suitable for use in the 'src' attribute of an <img> tag.

Parameters
dataobject data
typedata type
Returns
an unique object identifier used to identify the new object among all other embedded objects

References encoding::decide().

◆ findObject()

shared_ptr< const htmlTextPart::embeddedObject > findObject ( const string id) const

Return the embedded object with the specified identifier.

Parameters
idobject identifier
Returns
embedded object with the specified identifier, or NULL if no object has been found

◆ generateIn()

void generateIn ( shared_ptr< bodyPart message,
shared_ptr< bodyPart parent 
) const
virtual

Generate the text part(s) into the specified message.

Parameters
messagethe message
parentbody part into which generate this part

Implements textPart.

References encoding::decide(), vmime::contentDispositionTypes::INLINE, vmime::mediaTypes::MULTIPART, vmime::mediaTypes::MULTIPART_RELATED, vmime::mediaTypes::TEXT, vmime::mediaTypes::TEXT_HTML, vmime::mediaTypes::TEXT_PLAIN, and encoding::USAGE_TEXT.

◆ getCharset()

const charset & getCharset ( ) const
virtual

Return the charset used to encode text in the text part.

Returns
text charset

Implements textPart.

◆ getObjectAt()

shared_ptr< const htmlTextPart::embeddedObject > getObjectAt ( const size_t  pos) const

Return the embedded object at the specified position.

Parameters
posposition of the embedded object
Returns
embedded object at position 'pos'

◆ getObjectCount()

size_t getObjectCount ( ) const

Return the number of embedded objects.

Returns
number of embedded objects

◆ getPartCount()

size_t getPartCount ( ) const
virtual

Return the actual body parts this text part is composed of.

For example, HTML parts are composed of two parts: one "text/html" part, and the plain text part "text/plain".

Returns
number of body parts

Implements textPart.

◆ getPlainText()

shared_ptr< const contentHandler > getPlainText ( ) const

◆ getText()

const shared_ptr< const contentHandler > getText ( ) const
virtual

Return the text contained in the part.

Returns
text of the part

Implements textPart.

◆ getType()

const mediaType getType ( ) const
virtual

Return the type of text part (eg: "text/html").

Returns
type of text part

Implements textPart.

References vmime::mediaTypes::TEXT, and vmime::mediaTypes::TEXT_HTML.

◆ hasObject()

bool hasObject ( const string id) const

Test the existence of an embedded object given its identifier.

Parameters
idobject identifier
Returns
true if an object with this identifier exists, false otherwise

◆ parse()

void parse ( shared_ptr< const bodyPart message,
shared_ptr< const bodyPart parent,
shared_ptr< const bodyPart textPart 
)
virtual

Parse the text part(s) from the specified message.

Parameters
messagemessage containing the text part
parentpart containing the text part
textPartactual text part

Implements textPart.

References vmime::fields::CONTENT_ID, vmime::fields::CONTENT_LOCATION, vmime::fields::CONTENT_TYPE, messageId::getId(), text::getWholeBuffer(), vmime::npos, htmlTextPart::embeddedObject::REFERENCED_BY_ID, and htmlTextPart::embeddedObject::REFERENCED_BY_LOCATION.

◆ setCharset()

void setCharset ( const charset ch)
virtual

Set the charset used to encode text in the text part.

Parameters
chtext charset

Implements textPart.

◆ setPlainText()

void setPlainText ( shared_ptr< contentHandler plainText)

◆ setText()

void setText ( shared_ptr< contentHandler text)
virtual

Set the text contained in the part.

Parameters
texttext of the part

Implements textPart.

References text::clone().


The documentation for this class was generated from the following files: