TxtLineSpaceAttribute Class Reference

This text attribute specifies the aspect ratio of characters. More...

#include <txtattr.h>

Inheritance diagram for TxtLineSpaceAttribute:

TxtBaseClassAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 TxtLineSpaceAttribute ()
 Default Constuctor for TxtLineSpaceAttribute The function sets the Value to 19.2pt - 120% of 16pt.
 TxtLineSpaceAttribute (MILLIPOINT Value)
 TxtLineSpaceAttribute constructor.
 TxtLineSpaceAttribute (FIXED16 Ratio)
 TxtLineSpaceAttribute constructor.
virtual void Restore (RenderRegion *, BOOL)
 Restores the TxtLineSpaceAttribute attribute for the given render region.
virtual void Render (RenderRegion *pRegion, BOOL Temp=FALSE)
 Sets the TxtLineSpaceAttribute attribute for the given render region.
virtual void SimpleCopy (AttributeValue *)
 See AttributeValue::SimpleCopy.
virtual NodeAttributeMakeNode ()
 Make a AttrTxtTracking node, see base class.
BOOL IsDifferent (AttributeValue *pAttr)
 See base class version.
virtual TxtLineSpaceAttributeoperator= (TxtLineSpaceAttribute &Attrib)
 Make the Attribute the same as the other.
INT32 operator== (const TxtLineSpaceAttribute &Attrib)
 Comparison operator. See NodeAttribute::operator== for a description of why it's required.
BOOL IsARatio () const
 TxtLineSpaceAttribute constructor.

Static Public Member Functions

static BOOL Init ()
 Registers default attribute.

Public Attributes

BOOL IsRatio:1
MILLIPOINT Value
FIXED16 Ratio

Detailed Description

This text attribute specifies the aspect ratio of characters.

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

Definition at line 553 of file txtattr.h.


Constructor & Destructor Documentation

TxtLineSpaceAttribute::TxtLineSpaceAttribute  ) 
 

Default Constuctor for TxtLineSpaceAttribute The function sets the Value to 19.2pt - 120% of 16pt.

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

Definition at line 3521 of file txtattr.cpp.

03522 {
03523     IsRatio = TRUE;
03524     Value = 0;
03525     Ratio = FIXED16(1.0);
03526 } 

TxtLineSpaceAttribute::TxtLineSpaceAttribute MILLIPOINT  value  ) 
 

TxtLineSpaceAttribute constructor.

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

Errors: -

See also:
-

Definition at line 3544 of file txtattr.cpp.

03545 { 
03546     IsRatio = FALSE;
03547     Value = value;
03548     Ratio = FIXED16(0);
03549 }

TxtLineSpaceAttribute::TxtLineSpaceAttribute FIXED16  ratio  ) 
 

TxtLineSpaceAttribute constructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/3/95
Parameters:
Ratio,: The line space ratio [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 3566 of file txtattr.cpp.

03567 { 
03568     IsRatio = TRUE;
03569     Ratio = ratio;
03570     Value = 0;
03571 }


Member Function Documentation

BOOL TxtLineSpaceAttribute::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 3737 of file txtattr.cpp.

03738 {
03739     TxtLineSpaceAttribute *pAttr = new TxtLineSpaceAttribute;
03740     if (pAttr==NULL)
03741         // error message has already been set by new
03742         return FALSE;
03743 
03744     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(BaseTextClass), 
03745                                                          pAttr);
03746 
03747     ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising TxtLineSpaceAttribute");
03748 
03749     return TRUE;
03750 }

BOOL TxtLineSpaceAttribute::IsARatio  )  const
 

TxtLineSpaceAttribute constructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/3/95
Parameters:
Ratio,: The line space ratio [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the line space is a ratio value

Errors: -

See also:
-

Definition at line 3588 of file txtattr.cpp.

03589 { 
03590     return (IsRatio);
03591 }

BOOL TxtLineSpaceAttribute::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 3714 of file txtattr.cpp.

03715 {
03716     // This must be at least a FillGeometryAttribute...
03717     ERROR3IF(!pAttr->IsKindOf(CC_RUNTIME_CLASS(TxtLineSpaceAttribute)), 
03718                 "Different attribute types in TxtLineSpaceAttribute::IsDifferent()");
03719 
03720     // Check they are NOT the same.
03721     return ( !(*((TxtLineSpaceAttribute *)pAttr) == *this) ); 
03722 }

NodeAttribute * TxtLineSpaceAttribute::MakeNode  )  [virtual]
 

Make a AttrTxtTracking 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 3765 of file txtattr.cpp.

03766 {
03767     // Create new attribute node
03768     AttrTxtLineSpace*  pAttr = new AttrTxtLineSpace();
03769     if (pAttr==NULL)      
03770         // error message has already been set by new
03771         return NULL;
03772 
03773     // Copy attribute value into the new node.
03774     pAttr->Value.SimpleCopy(this);
03775 
03776     // Return the new node
03777     return pAttr;
03778 }

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

03645 {   
03646     Value = Attrib.Value;
03647     Ratio = Attrib.Ratio;
03648     IsRatio = Attrib.IsARatio();
03649     return *this;
03650 }

INT32 TxtLineSpaceAttribute::operator== const TxtLineSpaceAttribute 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 3666 of file txtattr.cpp.

03667 {
03668     if (Attrib.IsARatio() == IsARatio())
03669     {
03670         if (IsRatio)
03671         {
03672             return (Attrib.Ratio == Ratio);
03673         }
03674         else
03675         {
03676             return (Attrib.Value == Value);
03677         }
03678     }
03679     else return FALSE;  
03680 }

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

Sets the TxtLineSpaceAttribute 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 3607 of file txtattr.cpp.

03608 {
03609     pRegion->SetTxtLineSpace(this, Temp);
03610 }

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

Restores the TxtLineSpaceAttribute 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 3626 of file txtattr.cpp.

03627 {
03628     pRegion->RestoreTxtLineSpace(this, Temp);
03629 }

void TxtLineSpaceAttribute::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 3693 of file txtattr.cpp.

03694 {
03695     ERROR3IF(!IS_A(pValue, TxtLineSpaceAttribute), 
03696         "Invalid Attribute value passed to TxtLineSpaceAttribute::SimpleCopy");
03697     // We may as well just use our assignment operator.
03698     *this = *((TxtLineSpaceAttribute*)pValue);
03699 }


Member Data Documentation

BOOL TxtLineSpaceAttribute::IsRatio
 

Definition at line 578 of file txtattr.h.

FIXED16 TxtLineSpaceAttribute::Ratio
 

Definition at line 581 of file txtattr.h.

MILLIPOINT TxtLineSpaceAttribute::Value
 

Definition at line 580 of file txtattr.h.


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