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

Public Types

enum  EncodedParameterValueModes { PARAMETER_VALUE_NO_ENCODING, PARAMETER_VALUE_RFC2047_ONLY, PARAMETER_VALUE_RFC2231_ONLY, PARAMETER_VALUE_RFC2231_AND_RFC2047 }
 

Public Member Functions

 generationContext ()
 
 generationContext (const generationContext &ctx)
 
size_t getMaxLineLength () const
 
void setMaxLineLength (const size_t maxLineLength)
 
const string getPrologText () const
 
void setPrologText (const string &prologText)
 
const string getEpilogText () const
 
void setEpilogText (const string &epilogText)
 
void setEncodedParameterValueMode (const EncodedParameterValueModes mode)
 
EncodedParameterValueModes getEncodedParameterValueMode () const
 
generationContextoperator= (const generationContext &ctx)
 
void copyFrom (const generationContext &ctx)
 
- Public Member Functions inherited from context
virtual ~context ()
 
bool getInternationalizedEmailSupport () const
 
void setInternationalizedEmailSupport (const bool support)
 
const charsetConverterOptionsgetCharsetConversionOptions () const
 
void setCharsetConversionOptions (const charsetConverterOptions &opts)
 

Static Public Member Functions

static generationContextgetDefaultContext ()
 

Protected Attributes

size_t m_maxLineLength
 
string m_prologText
 
string m_epilogText
 
EncodedParameterValueModes m_paramValueMode
 
- Protected Attributes inherited from context
bool m_internationalizedEmail
 
charsetConverterOptions m_charsetConvOptions
 

Additional Inherited Members

- Protected Member Functions inherited from context
 context ()
 
 context (const context &ctx)
 
virtual contextoperator= (const context &ctx)
 
void copyFrom (const context &ctx)
 
- Protected Member Functions inherited from object
 object ()
 
 object (const object &)
 
objectoperator= (const object &)
 
virtual ~object ()
 

Detailed Description

Holds configuration parameters used for generating messages.

Member Enumeration Documentation

Modes available for generating values in parameterized header fields.

Enumerator
PARAMETER_VALUE_NO_ENCODING 

Only generate 7-bit (ASCII-only) values, even if the value contains non-ASCII chars or if folding is needed.

PARAMETER_VALUE_RFC2047_ONLY 

Only generate RFC-2047 values (do not use RFC-2231).

This is non-standard but most mail clients support it.

PARAMETER_VALUE_RFC2231_ONLY 

Only generate RFC-2231 values (do not use RFC-2047).

Some mail clients may not support it. This is the default.

PARAMETER_VALUE_RFC2231_AND_RFC2047 

Generate both RFC-2047- and RFC-2231-encoded values.

Constructor & Destructor Documentation

Member Function Documentation

generationContext & getDefaultContext ( )
static

Returns the default context used for generating messages.

Returns
a reference to the default generation context

Referenced by component::generate(), SMTPTransport::send(), and emailAddress::toString().

generationContext::EncodedParameterValueModes getEncodedParameterValueMode ( ) const

Returns the mode used for generating parameter values in a parameterized header field (see parameterizedHeaderField class).

Returns
parameter value generation mode

References generationContext::m_paramValueMode.

Referenced by parameter::generateImpl().

const string getEpilogText ( ) const

Returns the current epilog text used when generating MIME body parts.

Returns
current MIME epilog text

References generationContext::m_epilogText.

size_t getMaxLineLength ( ) const

Returns the current maximum line length used when generating messages.

Returns
current maximum line length, in bytes

References generationContext::m_maxLineLength.

Referenced by mediaType::generateImpl(), mailbox::generateImpl(), disposition::generateImpl(), parameter::generateImpl(), messageIdSequence::generateImpl(), addressList::generateImpl(), mailboxGroup::generateImpl(), and body::generateImpl().

const string getPrologText ( ) const

Returns the current prolog text used when generating MIME body parts.

Returns
current MIME prolog text

References generationContext::m_prologText.

generationContext & operator= ( const generationContext ctx)
void setEncodedParameterValueMode ( const EncodedParameterValueModes  mode)

Sets the mode used for generating parameter values in a parameterized header field (see parameterizedHeaderField class).

PARAMETER_VALUE_NO_ENCODING or PARAMETER_VALUE_RFC2047_ONLY can be used for compatibility with implementations that do not understand RFC-2231, to generate a normal parameter value. PARAMETER_VALUE_RFC2047_ONLY is non-standard (and expressly prohibited by the RFC) but most mail clients support it.

Notice: if both the normal value and the extended value are present, the latter can be ignored by mail processing systems. This may lead to annoying problems, for example, with strange names of attachments with all but 7-bit ascii characters removed, etc. Either PARAMETER_VALUE_RFC2231_ONLY or PARAMETER_VALUE_RFC2047_ONLY should be preferred over PARAMETER_VALUE_RFC2231_AND_RFC2047, not to create a normal value if the extended value is to be generated.

Parameters
modeparameter value generation mode

References generationContext::m_paramValueMode.

void setEpilogText ( const string epilogText)

Sets the epilog text used when generating MIME body parts.

This test appears after the part, and should be displayed by MUAs which do not support MIME. This should be 7-bit ASCII text only.

References generationContext::m_epilogText.

void setMaxLineLength ( const size_t  maxLineLength)

Sets the maximum line length used when generating messages.

You may use the constants lineLengthLimits::convenient, lineLengthLimits::max and lineLengthLimits::infinite.

Parameters
maxLineLengthnew maximum line length, in bytes

References generationContext::m_maxLineLength.

Referenced by component::generate(), messageIdSequence::generateImpl(), addressList::generateImpl(), mailboxGroup::generateImpl(), and emailAddress::toString().

void setPrologText ( const string prologText)

Sets the prolog text used when generating MIME body parts.

This text appears before the part, and should be displayed by MUAs which do not support MIME. This should be 7-bit ASCII text only.

Parameters
prologTextMIME prolog text

References generationContext::m_prologText.

Member Data Documentation


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