TextStyle Class Reference

#include <TextStyle.hpp>

Collaboration diagram for TextStyle:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class defines a style of text.

Attributes include the following:

Examples:

example11.cpp, and example13.cpp.

Definition at line 50 of file TextStyle.hpp.

Public Types

enum  Font { MONOSPACE, SANSSERIF, SERIF }
 This enumeration contains the simple choices of font. More...

Public Member Functions

 TextStyle (void)
 Constructor.
 TextStyle (double ips, short istyle=0)
 Constructor.
 TextStyle (double ips, short istyle, const Color &icolor, Font ifont=MONOSPACE)
 Constructor.
 TextStyle (double ips, const Color &icolor, Font ifont=MONOSPACE)
 Constructor.
void setStyle (short istyle)
 Modifier.
void setColor (const Color &c)
 Set color.
void setPointSize (double s)
 Set point size.
Color getColor (void) const
 Color accessor.
double getPointSize (void) const
 Point Size accessor.
bool isBold (void) const
 Style accessor.
bool isItalic (void) const
 Style accessor.
bool isUnderline (void) const
 Style accessor.
bool isStrike (void) const
 Style accessor.
bool isMonospace (void) const
 Font checker.
bool isSansSerif (void) const
 Font checker.
bool isSerif (void) const
 Font checker.
short getStyle (void) const
 Style accessor.
Font getFont (void) const
 Font accessor.
bool equals (const TextStyle &other) const
 Equals.
bool operator== (const TextStyle &rhs) const
 Operator ==.
bool operator!= (const TextStyle &rhs) const
 Operator !=.

Static Public Member Functions

short style (const char *str)
 This method does a static conversion from a string to a short for use with the TextStyle class constructors and methods.

Static Public Attributes

const short NORMAL = 0
 Constant style defining a normal font.
const short BOLD = 1
 Constant style defining bold.
const short ITALIC = 2
 Constant style defining italic.
const short UNDERLINE = 4
 Constant style defining underline.
const short STRIKE = 8
 Constant style defining strike.


Member Enumeration Documentation

enum Font
 

This enumeration contains the simple choices of font.

Enumeration values:
MONOSPACE 
SANSSERIF 
SERIF 

Definition at line 75 of file TextStyle.hpp.


Constructor & Destructor Documentation

TextStyle void   ) 
 

Constructor.

Defines a text style.

Definition at line 36 of file TextStyle.cpp.

References setStyle().

TextStyle double  ips,
short  istyle = 0
 

Constructor.

Defines a text style.

Parameters:
ips Font size in points
istyle Binary representation of text attributes (bold, italics, underline, strike)
See also:
setStyle

Definition at line 43 of file TextStyle.cpp.

References setStyle().

TextStyle double  ips,
short  istyle,
const Color icolor,
Font  ifont = MONOSPACE
 

Constructor.

Defines a text style.

Parameters:
ips Font size in points
istyle Binary representation of text attributes (bold, italics, underline, strike)
icolor Color of the text
ifont Font desired
See also:
setStyle

Definition at line 49 of file TextStyle.cpp.

References setStyle().

TextStyle double  ips,
const Color icolor,
Font  ifont = MONOSPACE
 

Constructor.

Defines a text style.

Parameters:
ips Font size in points
icolor Color of the text
ifont Font desired
See also:
setStyle

Definition at line 55 of file TextStyle.cpp.


Member Function Documentation

bool equals const TextStyle other  )  const [inline]
 

Equals.

Definition at line 181 of file TextStyle.hpp.

References getFont(), getPointSize(), and getStyle().

Color getColor void   )  const [inline]
 

Color accessor.

Definition at line 147 of file TextStyle.hpp.

Referenced by SVGImage::text(), and PSImageBase::text().

Font getFont void   )  const [inline]
 

Font accessor.

Definition at line 178 of file TextStyle.hpp.

Referenced by equals().

double getPointSize void   )  const [inline]
 

Point Size accessor.

Definition at line 150 of file TextStyle.hpp.

Referenced by equals(), and SVGImage::text().

short getStyle void   )  const [inline]
 

Style accessor.

Definition at line 174 of file TextStyle.hpp.

Referenced by equals().

bool isBold void   )  const [inline]
 

Style accessor.

Definition at line 153 of file TextStyle.hpp.

Referenced by SVGImage::text().

bool isItalic void   )  const [inline]
 

Style accessor.

Definition at line 156 of file TextStyle.hpp.

Referenced by SVGImage::text().

bool isMonospace void   )  const [inline]
 

Font checker.

Definition at line 165 of file TextStyle.hpp.

Referenced by SVGImage::text().

bool isSansSerif void   )  const [inline]
 

Font checker.

Definition at line 168 of file TextStyle.hpp.

Referenced by SVGImage::text().

bool isSerif void   )  const [inline]
 

Font checker.

Definition at line 171 of file TextStyle.hpp.

Referenced by SVGImage::text().

bool isStrike void   )  const [inline]
 

Style accessor.

Definition at line 162 of file TextStyle.hpp.

Referenced by SVGImage::text().

bool isUnderline void   )  const [inline]
 

Style accessor.

Definition at line 159 of file TextStyle.hpp.

Referenced by SVGImage::text().

bool operator!= const TextStyle rhs  )  const [inline]
 

Operator !=.

Definition at line 192 of file TextStyle.hpp.

bool operator== const TextStyle rhs  )  const [inline]
 

Operator ==.

Definition at line 189 of file TextStyle.hpp.

void setColor const Color c  )  [inline]
 

Set color.

Definition at line 137 of file TextStyle.hpp.

void setPointSize double  s  )  [inline]
 

Set point size.

Definition at line 140 of file TextStyle.hpp.

void setStyle short  istyle  ) 
 

Modifier.

Modifies text attributes vina binary representation in an integer. This is created using the defined BOLD, ITALIC, UNDERLINE, and STRIKE variables and using a binary OR to put them together. For example: Bold and Italic -> int bandi = (TextStyle::BOLD | TextStyle::ITALIC)

Parameters:
istyle Binary representation of text attributes (bold, italics, underline, strike)

Definition at line 100 of file TextStyle.cpp.

Referenced by TextStyle().

short style const char *  str  )  [static]
 

This method does a static conversion from a string to a short for use with the TextStyle class constructors and methods.

This string is created using the characters "b" for bold "i" for italics "u" for underline and "s" for strike. Neither order nor case matters, other characters are ignored. For example: Bold and Italic = "bi" or "Ib" or "BI" or "iB" ...

Parameters:
str Character representation of text attributes (bold, italics, underline, strike)

Definition at line 64 of file TextStyle.cpp.


Member Data Documentation

const short BOLD = 1 [static]
 

Constant style defining bold.

Definition at line 63 of file TextStyle.hpp.

const short ITALIC = 2 [static]
 

Constant style defining italic.

Definition at line 66 of file TextStyle.hpp.

const short NORMAL = 0 [static]
 

Constant style defining a normal font.

If you really don't want to type "0"

Definition at line 60 of file TextStyle.hpp.

const short STRIKE = 8 [static]
 

Constant style defining strike.

Definition at line 72 of file TextStyle.hpp.

const short UNDERLINE = 4 [static]
 

Constant style defining underline.

Definition at line 69 of file TextStyle.hpp.


The documentation for this class was generated from the following files:
Generated on Wed Sep 8 03:31:29 2010 for GPS ToolKit Software Library by  doxygen 1.3.9.1