libmsn 4.2.1

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Types | Public Member Functions
MSN::Message Class Reference

`#include <message.h>`

List of all members.

## Classes
class | Headers
## Public Types
enum | FontEffects { BOLD_FONT = 1, ITALIC_FONT = 2, UNDERLINE_FONT = 4, STRIKETHROUGH_FONT = 8 }
enum | CharacterSet { ANSI_CHARSET = 0x00, DEFAULT_CHARSET = 0x01, SYMBOL_CHARSET = 0x02, MAC_CHARSET = 0x4d, SHIFTJIS_CHARSET = 0x80, HANGEUL_CHARSET = 0x81, JOHAB_CHARSET = 0x82, GB2312_CHARSET = 0x86, CHINESEBIG5_CHARSET = 0x88, GREEK_CHARSET = 0xa1, TURKISH_CHARSET = 0xa2, VIETNAMESE_CHARSET = 0xa3, HEBREW_CHARSET = 0xb1, ARABIC_CHARSET = 0xb2, BALTIC_CHARSET = 0xba, RUSSIAN_CHARSET_DEFAULT = 0xcc, THAI_CHARSET = 0xde, EASTEUROPE_CHARSET = 0xee, OEM_DEFAULT = 0xff }
enum | FontFamily { FF_DONTCARE = 0, FF_ROMAN = 1, FF_SWISS = 2, FF_MODERN = 3, FF_SCRIPT = 4, FF_DECORATIVE = 5 }
enum | FontPitch { DEFAULT_PITCH = 0, FIXED_PITCH = 1, VARIABLE_PITCH = 2 }
## Public Member Functions
| Message (std::string body, std::string mimeHeader="MIME-Version: 1.0\r\nContent-Type: text/plain; charset=UTF-8\r\n\r\n")
std::string | asString () const
std::string | operator[] (const std::string header) const
void | setHeader (const std::string name, const std::string value)
std::string | getBody () const
std::string | getFontName () const
void | setFontName (const std::string &fontName)
std::vector< int > | getColor () const
std::string | getColorAsHTMLString () const
void | setColor (std::vector< int > color)
void | setColor (std::string color)
void | setColor (int red, int green, int blue)
int | getFontEffects () const
void | setFontEffects (int fontEffects)
CharacterSet | getFontCharacterSet () const
void | setFontCharacterSet (CharacterSet cs)
FontFamily | getFontFamily () const
FontPitch | getFontPitch () const
void | setFontFamilyAndPitch (Message::FontFamily fontFamily, Message::FontPitch fontPitch)
bool | isRightAligned () const

## Detailed Description

This class represents an MSN message

It may or may not represent an instant message.

Todo:
  Complete read/write support for formatting messages.

## Constructor & Destructor Documentation

MSN::Message::Message | ( | std::string | body,
|  | std::string | mimeHeader = `"MIME-Version: 1.0\r\nContent-Type: text/plain; charset=UTF-8\r\n\r\n"`
| ) |  |

Create a message with the specified body and mimeHeader.

## Member Function Documentation

std::string MSN::Message::asString | ( |  | ) | const

Convert the Message into a string.

This returns a string containing the MIME headers separated from the message body by a blank line.

std::string MSN::Message::getBody | ( |  | ) | const`[inline]`

Return the body portion of this Message.

std::vector< int > MSN::Message::getColor | ( |  | ) | const

Get the color used in this Message.

Message::CharacterSet MSN::Message::getFontCharacterSet | ( |  | ) | const

Return the character set that the font uses in this Message.

int MSN::Message::getFontEffects | ( |  | ) | const

Return the font effects used in this Message.

Returns:
  An integer that is a bitwise-or of Message::FontEffects members.

Message::FontFamily MSN::Message::getFontFamily | ( |  | ) | const

Return the font family used in this Message.

std::string MSN::Message::getFontName | ( |  | ) | const

Return the font name used in this Message.

Returns:
  The font name used for this Message, or "" if none specified.

Message::FontPitch MSN::Message::getFontPitch | ( |  | ) | const

Return the font pitch used in this Message.

bool MSN::Message::isRightAligned | ( |  | ) | const

Is the Message to be right-aligned?

std::string MSN::Message::operator[] | ( | const std::string | header | ) | const

Return the value of the MIME header named header.

Returns:
  The value of the MIME header if present, or "" if not found.

void MSN::Message::setColor | ( | std::vector< int > | color | ) |

Set the color used in this Message.

void MSN::Message::setFontCharacterSet | ( | CharacterSet | cs | ) |

Set the character set that the font should use for this Message.

void MSN::Message::setFontEffects | ( | int | fontEffects | ) |

Set the font effects for use in this Message.

Parameters:

  fontEffects | Bitwise-or of Message::FontEffects members.

void MSN::Message::setFontFamilyAndPitch | ( | Message::FontFamily | fontFamily,
|  | Message::FontPitch | fontPitch
| ) |  |

Set the font family and pitch to be used for this Message.

void MSN::Message::setFontName | ( | const std::string & | fontName | ) |

Set font name for use in this Message.

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

- /home/salem/libmsn/tags/libmsn-4.2/msn/message.h
- /home/salem/libmsn/tags/libmsn-4.2/msn/message.cpp

All Classes Namespaces Functions Variables Enumerations Enumerator