TxtFontSizeAttribute Class Reference

Specifies the size of a font. More...

#include <txtattr.h>

Inheritance diagram for TxtFontSizeAttribute:

TxtBaseClassAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 TxtFontSizeAttribute ()
 Default Constuctor for TxtFontSizeAttribute The default FontSize attribute value is 16000mp (16pt).
 TxtFontSizeAttribute (MILLIPOINT FontSize)
 TextFontTypefaceAttribute constructor.
virtual void Restore (RenderRegion *, BOOL)
 Restores the TxtFontSizeAttribute attribute for the given render region.
virtual void Render (RenderRegion *pRegion, BOOL Temp=FALSE)
 Sets the TxtFontSizeAttribute 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 TxtFontSizeAttributeoperator= (TxtFontSizeAttribute &Attrib)
 Make the Attribute the same as the other.
INT32 operator== (const TxtFontSizeAttribute &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

MILLIPOINT FontSize

Detailed Description

Specifies the size of a font.

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

Definition at line 219 of file txtattr.h.


Constructor & Destructor Documentation

TxtFontSizeAttribute::TxtFontSizeAttribute  ) 
 

Default Constuctor for TxtFontSizeAttribute The default FontSize attribute value is 16000mp (16pt).

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

Definition at line 449 of file txtattr.cpp.

00450 {
00451     FontSize = 16000; // Default font
00452 } 

TxtFontSizeAttribute::TxtFontSizeAttribute MILLIPOINT  fontSize  ) 
 

TextFontTypefaceAttribute constructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/3/95
Parameters:
FontSize,: The font size in mp [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 470 of file txtattr.cpp.

00471 { 
00472     FontSize = fontSize; 
00473 }


Member Function Documentation

BOOL TxtFontSizeAttribute::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 606 of file txtattr.cpp.

00607 {
00608     TxtFontSizeAttribute *pAttr = new TxtFontSizeAttribute;
00609     if (pAttr==NULL)
00610         // error message has already been set by new
00611         return FALSE;
00612 
00613     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(BaseTextClass), 
00614                                                          pAttr);
00615 
00616     ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising TxtFontSizeAttribute");
00617 
00618     return TRUE;
00619 }

BOOL TxtFontSizeAttribute::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 583 of file txtattr.cpp.

00584 {
00585     // This must be at least a FillGeometryAttribute...
00586     ERROR3IF(!pAttr->IsKindOf(CC_RUNTIME_CLASS(TxtFontSizeAttribute)), 
00587                 "Different attribute types in TxtFontSizeAttribute::IsDifferent()");
00588 
00589     // Check they are NOT the same.
00590     return ( !(*((TxtFontSizeAttribute *)pAttr) == *this) ); 
00591 }

NodeAttribute * TxtFontSizeAttribute::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 634 of file txtattr.cpp.

00635 {
00636     // Create new attribute node
00637     AttrTxtFontSize*  pAttr = new AttrTxtFontSize();
00638     if (pAttr==NULL)      
00639         // error message has already been set by new
00640         return NULL;
00641 
00642     // Copy attribute value into the new node.
00643     pAttr->Value.SimpleCopy(this);
00644 
00645     // Return the new node
00646     return pAttr;
00647 }

TxtFontSizeAttribute & TxtFontSizeAttribute::operator= TxtFontSizeAttribute 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 526 of file txtattr.cpp.

00527 {    
00528     FontSize = Attrib.FontSize;
00529     return *this;
00530 }

INT32 TxtFontSizeAttribute::operator== const TxtFontSizeAttribute Attrib  ) 
 

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

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

Definition at line 546 of file txtattr.cpp.

00547 {
00548     return (Attrib.FontSize == FontSize); 
00549 }

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

Sets the TxtFontSizeAttribute 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 489 of file txtattr.cpp.

00490 {
00491     pRegion->SetTxtFontSize(this, Temp);
00492 }

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

Restores the TxtFontSizeAttribute 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 508 of file txtattr.cpp.

00509 {
00510     pRegion->RestoreTxtFontSize(this, Temp);
00511 }

void TxtFontSizeAttribute::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 562 of file txtattr.cpp.

00563 {
00564     ERROR3IF(!IS_A(pValue, TxtFontSizeAttribute), 
00565         "Invalid Attribute value passed to TxtFontSizeAttribute::SimpleCopy");
00566     // We may as well just use our assignment operator.
00567     *this = *((TxtFontSizeAttribute*)pValue);
00568 }


Member Data Documentation

MILLIPOINT TxtFontSizeAttribute::FontSize
 

Definition at line 239 of file txtattr.h.


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