Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MSN::Message Class Reference

#include <message.h>

List of all members.


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.


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")
 Create a message with the specified body and mimeHeader.
std::string asString () const
 Convert the Message into a string.
std::string operator[] (const std::string header) const
 Return the value of the MIME header named header.
void setHeader (const std::string name, const std::string value)
const std::string & getBody () const
 Return the body portion of this Message.
const std::string getFontName () const
 Return the font name used in this Message.
void setFontName (const std::string &fontName)
 Set font name for use in this Message.
const std::vector< int > getColor () const
 Get the color used in this Message.
const std::string getColorAsHTMLString () const
void setColor (std::vector< int > color)
 Set the color used in this Message.
void setColor (std::string color)
void setColor (int red, int green, int blue)
const int getFontEffects () const
 Return the font effects used in this Message.
void setFontEffects (int fontEffects)
 Set the font effects for use in this Message.
const CharacterSet getFontCharacterSet () const
 Return the character set that the font uses in this Message.
void setFontCharacterSet (CharacterSet cs)
 Set the character set that the font should use for this Message.
const FontFamily getFontFamily () const
 Return the font family used in this Message.
const FontPitch getFontPitch () const
 Return the font pitch used in this Message.
void setFontFamilyAndPitch (Message::FontFamily fontFamily, Message::FontPitch fontPitch)
 Set the font family and pitch to be used for this Message.
const bool isRightAligned () const
 Is the Message to be right-aligned?

Classes

class  Headers


Member Enumeration Documentation

enum MSN::Message::CharacterSet
 

Enumeration values:
ANSI_CHARSET 
DEFAULT_CHARSET 
SYMBOL_CHARSET 
MAC_CHARSET 
SHIFTJIS_CHARSET 
HANGEUL_CHARSET 
JOHAB_CHARSET 
GB2312_CHARSET 
CHINESEBIG5_CHARSET 
GREEK_CHARSET 
TURKISH_CHARSET 
VIETNAMESE_CHARSET 
HEBREW_CHARSET 
ARABIC_CHARSET 
BALTIC_CHARSET 
RUSSIAN_CHARSET_DEFAULT 
THAI_CHARSET 
EASTEUROPE_CHARSET 
OEM_DEFAULT 

enum MSN::Message::FontEffects
 

Enumeration values:
BOLD_FONT 
ITALIC_FONT 
UNDERLINE_FONT 
STRIKETHROUGH_FONT 

enum MSN::Message::FontFamily
 

Enumeration values:
FF_DONTCARE 
FF_ROMAN 
FF_SWISS 
FF_MODERN 
FF_SCRIPT 
FF_DECORATIVE 

enum MSN::Message::FontPitch
 

Enumeration values:
DEFAULT_PITCH 
FIXED_PITCH 
VARIABLE_PITCH 


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.

const std::string& MSN::Message::getBody  )  const [inline]
 

Return the body portion of this Message.

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

Get the color used in this Message.

const std::string MSN::Message::getColorAsHTMLString  )  const
 

const Message::CharacterSet MSN::Message::getFontCharacterSet  )  const
 

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

const 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.

const Message::FontFamily MSN::Message::getFontFamily  )  const
 

Return the font family used in this Message.

const 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.

const Message::FontPitch MSN::Message::getFontPitch  )  const
 

Return the font pitch used in this Message.

const 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 int  red,
int  green,
int  blue
 

void MSN::Message::setColor std::string  color  ) 
 

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.

void MSN::Message::setHeader const std::string  name,
const std::string  value
[inline]
 


The documentation for this class was generated from the following files:
Generated on Sun Feb 6 19:59:40 2005 for libmsn by  doxygen 1.4.1