TxtFontTypefaceAttribute Class Reference

Specifies a FontTypeface. Note that only a handle to the Typeface is stored in the attribute, not the full string description. More...

#include <txtattr.h>

Inheritance diagram for TxtFontTypefaceAttribute:

TxtBaseClassAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 TxtFontTypefaceAttribute ()
 Default Constuctor for TxtFontTypefaceAttribute The default typeface handle is 0 which represents the default font.
 TxtFontTypefaceAttribute (UINT32 TypefaceHandle)
 TextFontTypefaceAttribute constructor.
virtual void Restore (RenderRegion *, BOOL)
 Restores the TxtFontTypefaceAttribute attribute for the given render region.
virtual void Render (RenderRegion *pRegion, BOOL Temp=FALSE)
 Sets the TxtFontTypeface attribute for the given render region.
virtual void SimpleCopy (AttributeValue *)
 See AttributeValue::SimpleCopy.
virtual NodeAttributeMakeNode ()
 Make a AttrTextFontTypeface node, see base class.
BOOL IsDifferent (AttributeValue *pAttr)
 See base class version.
virtual TxtFontTypefaceAttributeoperator= (TxtFontTypefaceAttribute &Attrib)
 Make the Attribute the same as the other.
INT32 operator== (const TxtFontTypefaceAttribute &Attrib)
 Comparison operator. See NodeAttribute::operator== for a description of why it's required.

Static Public Member Functions

static BOOL Init ()
 Registers default attribute.

Public Attributes

WORD HTypeface
BOOL IsBold
BOOL IsItalic

Detailed Description

Specifies a FontTypeface. Note that only a handle to the Typeface is stored in the attribute, not the full string description.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/03/95
See also:
AttrTxtFontTypeface

Definition at line 180 of file txtattr.h.


Constructor & Destructor Documentation

TxtFontTypefaceAttribute::TxtFontTypefaceAttribute  ) 
 

Default Constuctor for TxtFontTypefaceAttribute The default typeface handle is 0 which represents the default font.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
See also:

Definition at line 223 of file txtattr.cpp.

00224 {
00225     HTypeface = 0; // Default font
00226     IsBold = FALSE;
00227     IsItalic = FALSE;
00228 } 

TxtFontTypefaceAttribute::TxtFontTypefaceAttribute UINT32  TypefaceHandle  ) 
 

TextFontTypefaceAttribute constructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/3/95
Parameters:
TypeFaceHandle,: A typeface handle value [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 246 of file txtattr.cpp.

00247 { 
00248     HTypeface = (WORD)TypefaceHandle;
00249     IsBold = FALSE;
00250     IsItalic = FALSE;
00251 }


Member Function Documentation

BOOL TxtFontTypefaceAttribute::Init void   )  [static]
 

Registers default attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Returns:
TRUE - initialised ok; FALSE if not.

Errors: Out of memory.

See also:
AttributeManager

Reimplemented from SimpleCCObject.

Definition at line 389 of file txtattr.cpp.

00390 {
00391     TxtFontTypefaceAttribute *pAttr = new TxtFontTypefaceAttribute;
00392     if (pAttr==NULL)
00393         // error message has already been set by new
00394         return FALSE;
00395 
00396     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(BaseTextClass), 
00397                                                          pAttr);
00398 
00399     ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising TxtFontTypefaceAttribute");
00400 
00401     return TRUE;
00402 }

BOOL TxtFontTypefaceAttribute::IsDifferent AttributeValue pAttr  )  [virtual]
 

See base class version.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Returns:
Errors: The two attributes are not of the same type.
See also:
AttributeValue::IsDifferent

Reimplemented from AttributeValue.

Definition at line 366 of file txtattr.cpp.

00367 {
00368     // This must be at least a FillGeometryAttribute...
00369     ERROR3IF(!pAttr->IsKindOf(CC_RUNTIME_CLASS(TxtFontTypefaceAttribute)), 
00370                 "Different attribute types in TxtFontTypefaceAttribute::IsDifferent()");
00371 
00372     // Check they are NOT the same.
00373     return ( !(*((TxtFontTypefaceAttribute *)pAttr) == *this) ); 
00374 }

NodeAttribute * TxtFontTypefaceAttribute::MakeNode  )  [virtual]
 

Make a AttrTextFontTypeface node, see base class.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Returns:
Pointer to the new node, or NULL if out of memory.

Errors: Out of memory

See also:
AttributeValue::MakeNode

Reimplemented from AttributeValue.

Definition at line 417 of file txtattr.cpp.

00418 {
00419     // Create new attribute node
00420     AttrTxtFontTypeface*  pAttr = new AttrTxtFontTypeface();
00421     if (pAttr==NULL)      
00422         // error message has already been set by new
00423         return NULL;
00424 
00425     // Copy attribute value into the new node.
00426     pAttr->Value.SimpleCopy(this);
00427 
00428     // Return the new node
00429     return pAttr;
00430 }

TxtFontTypefaceAttribute & TxtFontTypefaceAttribute::operator= TxtFontTypefaceAttribute Attrib  )  [virtual]
 

Make the Attribute the same as the other.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
Attrib - the attribute to copy [INPUTS]
Returns:
Usual semantics for equality.

Definition at line 304 of file txtattr.cpp.

00305 {    
00306     HTypeface = Attrib.HTypeface;
00307     IsBold = Attrib.IsBold;
00308     IsItalic = Attrib.IsItalic;
00309 
00310     return *this;
00311 }

INT32 TxtFontTypefaceAttribute::operator== const TxtFontTypefaceAttribute Attrib  ) 
 

Comparison operator. See NodeAttribute::operator== for a description of why it's required.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
Attrib - the attribute to compare this attribute with [INPUTS]
Returns:
Usual semantics for equality.
See also:
NodeAttribute::operator==

Definition at line 327 of file txtattr.cpp.

00328 {
00329     return (Attrib.HTypeface == HTypeface &&
00330             Attrib.IsBold == IsBold   &&
00331             Attrib.IsItalic == IsItalic); 
00332 }

void TxtFontTypefaceAttribute::Render RenderRegion pRegion,
BOOL  Temp = FALSE
[virtual]
 

Sets the TxtFontTypeface attribute for the given render region.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pRegion - the render region to render this attribute into. [INPUTS]
See also:
-

Implements AttributeValue.

Definition at line 267 of file txtattr.cpp.

00268 {
00269     pRegion->SetTxtFontTypeface(this, Temp);
00270 }

void TxtFontTypefaceAttribute::Restore RenderRegion pRegion,
BOOL  Temp
[virtual]
 

Restores the TxtFontTypefaceAttribute attribute for the given render region.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pRegion - the render region to restore the attribute into. [INPUTS] Temp - TRUE if this is a temporary attribute, FALSE if it is permanent (e.g. it's in a document tree).
See also:
-

Implements TxtBaseClassAttribute.

Definition at line 286 of file txtattr.cpp.

00287 {
00288     pRegion->RestoreTxtFontTypeface(this, Temp);
00289 }

void TxtFontTypefaceAttribute::SimpleCopy AttributeValue pValue  )  [virtual]
 

See AttributeValue::SimpleCopy.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - pointer to the AttributeValue to copy. [INPUTS]

Implements AttributeValue.

Definition at line 345 of file txtattr.cpp.

00346 {
00347     ERROR3IF(!IS_A(pValue, TxtFontTypefaceAttribute), 
00348         "Invalid Attribute value passed to TxtFontTypefaceAttribute::SimpleCopy");
00349     // We may as well just use our assignment operator.
00350     *this = *((TxtFontTypefaceAttribute*)pValue);
00351 }


Member Data Documentation

WORD TxtFontTypefaceAttribute::HTypeface
 

Definition at line 201 of file txtattr.h.

BOOL TxtFontTypefaceAttribute::IsBold
 

Definition at line 202 of file txtattr.h.

BOOL TxtFontTypefaceAttribute::IsItalic
 

Definition at line 203 of file txtattr.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:02:31 2007 for Camelot by  doxygen 1.4.4