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

CP_ATSUI_TextBlock Class Reference

A class to draw a text block using MacOS ATSUI functions.

List of all members.

Public Member Functions

Constructor / Destructor
 CP_ATSUI_TextBlock ()
 Constructor.
 CP_ATSUI_TextBlock (const CP_String &inText, const CP_Rect &inBounds, const CP_FontSpec &inFontSpec)
virtual ~CP_ATSUI_TextBlock () throw ()
 Destructor.
Drawing
void DrawString (CPLAT::CP_Canvas &inDestCanvas, const CP_String &inText, const CP_Rect &inBounds, const CP_FontSpec &inFontSpec)
void DrawText ()
void DrawText (const CP_String &inText, const CP_Rect &inBounds, const CP_FontSpec &inFontSpec)

Protected Member Functions

Getters
OSStatus ATSUI_GetOneAttribute (ATSUStyle iStyle, ATSUAttributeTag iTag, ByteCount iExpectedValueSize, ATSUAttributeValuePtr oValue)
OSStatus ATSUI_GetOneLayoutControl (ATSUTextLayout iLayout, ATSUAttributeTag iTag, ByteCount iExpectedValueSize, ATSUAttributeValuePtr oValue)
Fract ATSUI_FlushFactorFromTEAlignment (SInt16 alignment)
ATSUFontID GetFontIDFromMacFontName (Str255 fontName)
Setters
OSStatus ATSUI_SetBooleanAttribute (ATSUStyle iStyle, Boolean iSetting, ATSUAttributeTag iTag)
OSStatus ATSUI_SetFixedAttribute (ATSUStyle iStyle, Fixed iValue, ATSUAttributeTag iTag)
OSStatus ATSUI_SetFractAttribute (ATSUStyle iStyle, Fract iValue, ATSUAttributeTag iTag)
OSStatus ATSUI_SetIntAttribute (ATSUStyle iStyle, SInt32 iValue, ATSUAttributeTag iTag)
OSStatus ATSUI_SetShortAttribute (ATSUStyle iStyle, SInt16 iValue, ATSUAttributeTag iTag)
OSStatus ATSUI_SetPtrAttribute (ATSUStyle iStyle, void *iValue, ATSUAttributeTag iTag)
OSStatus ATSUI_SetBooleanLayoutControl (ATSUTextLayout iLayout, Boolean iValue, ATSUAttributeTag iTag)
OSStatus ATSUI_SetFixedLayoutControl (ATSUTextLayout iLayout, Fixed iValue, ATSUAttributeTag iTag)
OSStatus ATSUI_SetFractLayoutControl (ATSUTextLayout iLayout, Fract iValue, ATSUAttributeTag iTag)
OSStatus ATSUI_SetShortLayoutControl (ATSUTextLayout iLayout, SInt16 iValue, ATSUAttributeTag iTag)
OSStatus ATSUI_SetPtrLayoutControl (ATSUTextLayout iLayout, void *iValue, ATSUAttributeTag iTag)

Private Member Functions

void Init ()
void InitATSUIStyle ()
void SetFont (ATSUStyle theStyle, Str255 fontName)
void BreakTextInLines ()

Private Attributes

CP_String fText
CP_Rect fBounds
CP_FontSpec fFontSpec
UniCharArrayPtr fUnicodeText
UniCharCount fTextLength
ATSUTextMeasurement fHorLocation
ATSUTextMeasurement fVerLocation
ATSUTextMeasurement fMaxAscent
ATSUTextMeasurement fMaxDescent
ATSUTextMeasurement fLineHeight
ItemCount fNumberOfLines
UniCharArrayOffset * fEndOfLines
ItemCount fNumberOfRuns
UniCharCount * fRunLengths
ATSUStyle * fStyles
ATSUTextLayout fTextLayout


Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_ATSUI_TextBlock::CP_ATSUI_TextBlock  ) 
 

Constructor.

Exceptions:
none 

CP_ATSUI_TextBlock::CP_ATSUI_TextBlock const CP_String inText,
const CP_Rect inBounds,
const CP_FontSpec inFontSpec
 

Constructor.

Parameters:
inText The text to be displayed.
inBounds The bounds to draw the text info.
Exceptions:
none 

CP_ATSUI_TextBlock::~CP_ATSUI_TextBlock  )  throw () [virtual]
 

Desstructor.

Exceptions:
none 


Member Function Documentation

void CP_ATSUI_TextBlock::DrawString CPLAT::CP_Canvas &  inDestCanvas,
const CP_String inText,
const CP_Rect inBounds,
const CP_FontSpec inFontSpec
 

Draws the passed in string into the specified bounds.

Parameters:
inDestCanvas The CP_Canvas object to draw the text into.
inText The text block to display.
inBounds Bounds to draw the text into.
inFontSpec Describes the appearance of the text.
Exceptions:
none 
Returns:
void

void CP_ATSUI_TextBlock::DrawText  ) 
 

Draws the previously set text

Exceptions:
none 
Returns:
void

void CP_ATSUI_TextBlock::DrawText const CP_String inText,
const CP_Rect inBounds,
const CP_FontSpec inFontSpec
 

Draws the passed in string into the specified bounds, using the previously specified canvas.

Parameters:
inText The text block to display.
inBounds Bounds to draw the text into.
inFontSpec Describes the appearance of the text.
Exceptions:
none 
Returns:
void

OSStatus CP_ATSUI_TextBlock::ATSUI_GetOneAttribute ATSUStyle  iStyle,
ATSUAttributeTag  iTag,
ByteCount  iExpectedValueSize,
ATSUAttributeValuePtr  oValue
[protected]
 

Returns an ATSUI attribute.

Parameters:
iStyle The ATSUStyle.
iTag The ATSUAttributeTag.
iExpectedValueSize The expected size of the value.
oValue Location to return the value in.
Exceptions:
none 
Returns:
OSStatus The result of the operation.

OSStatus CP_ATSUI_TextBlock::ATSUI_GetOneLayoutControl ATSUTextLayout  iLayout,
ATSUAttributeTag  iTag,
ByteCount  iExpectedValueSize,
ATSUAttributeValuePtr  oValue
[protected]
 

Returns an ATSUI layout control.

Parameters:
iStyle The ATSUStyle.
iTag The ATSUAttributeTag.
iExpectedValueSize The expected size of the value.
oValue Location to return the value in.
Exceptions:
none 
Returns:
OSStatus The result of the operation.

Fract CP_ATSUI_TextBlock::ATSUI_FlushFactorFromTEAlignment SInt16  alignment  )  [protected]
 

Returns the ATSUI flush factor from the passed in CPLAT text alignment.

Parameters:
alignment The alignment to return the value for.
Exceptions:
none 
Returns:
Fract The result.

ATSUFontID CP_ATSUI_TextBlock::GetFontIDFromMacFontName Str255  fontName  )  [protected]
 

Returns the ATSUI font ID from the passed in Mac font name.

Parameters:
fontName The name of the font.
Exceptions:
none 
Returns:
ATSUFontID The resulting ATSUFontID.

OSStatus CP_ATSUI_TextBlock::ATSUI_SetBooleanAttribute ATSUStyle  iStyle,
Boolean  iSetting,
ATSUAttributeTag  iTag
[protected]
 

Sets a bool attribute

Parameters:
iStyle The ATSUIStyle to be set.
iSetting The value to set.
iTag The ATSUAttributeTag being set.
Exceptions:
none 
Returns:
OSStatus The result of the operation.

OSStatus CP_ATSUI_TextBlock::ATSUI_SetFixedAttribute ATSUStyle  iStyle,
Fixed  iValue,
ATSUAttributeTag  iTag
[protected]
 

Sets a fixed attribute

Parameters:
iStyle The ATSUIStyle to be set.
iValue The Fixed value to set.
iTag The ATSUAttributeTag being set.
Exceptions:
none 
Returns:
OSStatus The result of the operation.

OSStatus CP_ATSUI_TextBlock::ATSUI_SetFractAttribute ATSUStyle  iStyle,
Fract  iValue,
ATSUAttributeTag  iTag
[protected]
 

Sets a fract attribute

Parameters:
iStyle The ATSUIStyle to be set.
iValue The Fract value to set.
iTag The ATSUAttributeTag being set.
Exceptions:
none 
Returns:
OSStatus The result of the operation.

OSStatus CP_ATSUI_TextBlock::ATSUI_SetIntAttribute ATSUStyle  iStyle,
SInt32  iValue,
ATSUAttributeTag  iTag
[protected]
 

Sets an SInt32 attribute

Parameters:
iStyle The ATSUIStyle to be set.
iValue The SInt32 value to set.
iTag The ATSUAttributeTag being set.
Exceptions:
none 
Returns:
OSStatus The result of the operation.

OSStatus CP_ATSUI_TextBlock::ATSUI_SetShortAttribute ATSUStyle  iStyle,
SInt16  iValue,
ATSUAttributeTag  iTag
[protected]
 

Sets a Sint16 attribute

Parameters:
iStyle The ATSUIStyle to be set.
iValue The SInt16 value to set.
iTag The ATSUAttributeTag being set.
Exceptions:
none 
Returns:
OSStatus The result of the operation.

OSStatus CP_ATSUI_TextBlock::ATSUI_SetPtrAttribute ATSUStyle  iStyle,
void *  iValue,
ATSUAttributeTag  iTag
[protected]
 

Sets a void * attribute

Parameters:
iStyle The ATSUIStyle to be set.
iValue The void * value to set.
iTag The ATSUAttributeTag being set.
Exceptions:
none 
Returns:
OSStatus The result of the operation.

OSStatus CP_ATSUI_TextBlock::ATSUI_SetBooleanLayoutControl ATSUTextLayout  iLayout,
Boolean  iValue,
ATSUAttributeTag  iTag
[protected]
 

Sets a boolean layout control.

Parameters:
iStyle The ATSUIStyle to be set.
iValue The Boolean value to set.
iTag The ATSUAttributeTag being set.
Exceptions:
none 
Returns:
OSStatus The result of the operation.

OSStatus CP_ATSUI_TextBlock::ATSUI_SetFixedLayoutControl ATSUTextLayout  iLayout,
Fixed  iValue,
ATSUAttributeTag  iTag
[protected]
 

Sets a Fixed layout control.

Parameters:
iStyle The ATSUIStyle to be set.
iValue The Fixed value to set.
iTag The ATSUAttributeTag being set.
Exceptions:
none 
Returns:
OSStatus The result of the operation.

OSStatus CP_ATSUI_TextBlock::ATSUI_SetFractLayoutControl ATSUTextLayout  iLayout,
Fract  iValue,
ATSUAttributeTag  iTag
[protected]
 

Sets a Fract layout control.

Parameters:
iStyle The ATSUIStyle to be set.
iValue The Fixed value to set.
iTag The ATSUAttributeTag being set.
Exceptions:
none 
Returns:
OSStatus The result of the operation.

OSStatus CP_ATSUI_TextBlock::ATSUI_SetShortLayoutControl ATSUTextLayout  iLayout,
SInt16  iValue,
ATSUAttributeTag  iTag
[protected]
 

Sets a short layout control.

Parameters:
iStyle The ATSUIStyle to be set.
iValue The SInt16 value to set.
iTag The ATSUAttributeTag being set.
Exceptions:
none 
Returns:
OSStatus The result of the operation.

OSStatus CP_ATSUI_TextBlock::ATSUI_SetPtrLayoutControl ATSUTextLayout  iLayout,
void *  iValue,
ATSUAttributeTag  iTag
[protected]
 

Sets a void * layout control.

Parameters:
iStyle The ATSUIStyle to be set.
iValue The void * value to set.
iTag The ATSUAttributeTag being set.
Exceptions:
none 
Returns:
OSStatus The result of the operation.

void CP_ATSUI_TextBlock::Init  )  [private]
 

Initialize this object by setting its data members to default values.

Exceptions:
none 
Returns:
void

void CP_ATSUI_TextBlock::InitATSUIStyle  )  [private]
 

Initialize the ATSUI style based on previously set information.

Exceptions:
none 
Returns:
void

void CP_ATSUI_TextBlock::SetFont ATSUStyle  theStyle,
Str255  fontName
[private]
 

Sets the font.

Parameters:
theStyle The ATSUStyle of the font to be set.
fontName The name of the font.
Exceptions:
none 
Returns:
ATSUFontID The resulting ATSUFontID.

void CP_ATSUI_TextBlock::BreakTextInLines  )  [private]
 

Breaks up the text to be displayed into lines based on previously set information.

Exceptions:
none 
Returns:
void


Member Data Documentation

CP_String CP_ATSUI_TextBlock::fText [private]
 

CP_Rect CP_ATSUI_TextBlock::fBounds [private]
 

CP_FontSpec CP_ATSUI_TextBlock::fFontSpec [private]
 

UniCharArrayPtr CP_ATSUI_TextBlock::fUnicodeText [private]
 

UniCharCount CP_ATSUI_TextBlock::fTextLength [private]
 

ATSUTextMeasurement CP_ATSUI_TextBlock::fHorLocation [private]
 

ATSUTextMeasurement CP_ATSUI_TextBlock::fVerLocation [private]
 

ATSUTextMeasurement CP_ATSUI_TextBlock::fMaxAscent [private]
 

ATSUTextMeasurement CP_ATSUI_TextBlock::fMaxDescent [private]
 

ATSUTextMeasurement CP_ATSUI_TextBlock::fLineHeight [private]
 

ItemCount CP_ATSUI_TextBlock::fNumberOfLines [private]
 

UniCharArrayOffset* CP_ATSUI_TextBlock::fEndOfLines [private]
 

ItemCount CP_ATSUI_TextBlock::fNumberOfRuns [private]
 

UniCharCount* CP_ATSUI_TextBlock::fRunLengths [private]
 

ATSUStyle* CP_ATSUI_TextBlock::fStyles [private]
 

ATSUTextLayout CP_ATSUI_TextBlock::fTextLayout [private]
 


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:22 2005 for CPLAT by  doxygen 1.4.0