TxtJustificationAttribute Class Reference

This text attribute specifies the current text justification. More...

#include <txtattr.h>

Inheritance diagram for TxtJustificationAttribute:

TxtBaseClassAttribute AttributeValue CCObject SimpleCCObject List of all members.

Public Member Functions

 TxtJustificationAttribute ()
 Default Constuctor for TxtJustificationAttribute It defaults to LEFT justify.
 TxtJustificationAttribute (Justification Value)
 TxtJustificationAttribute constructor.
virtual void Restore (RenderRegion *, BOOL)
 Restores the TxtJustificationAttribute attribute for the given render region.
virtual void Render (RenderRegion *pRegion, BOOL Temp=FALSE)
 Sets the TxtJustificationAttribute attribute for the given render region.
virtual void SimpleCopy (AttributeValue *)
 See AttributeValue::SimpleCopy.
virtual NodeAttributeMakeNode ()
 Make a AttrTxtJustification node, see base class.
BOOL IsDifferent (AttributeValue *pAttr)
 See base class version.
virtual TxtJustificationAttributeoperator= (TxtJustificationAttribute &Attrib)
 Make the Attribute the same as the other.
INT32 operator== (const TxtJustificationAttribute &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

Justification justification

Detailed Description

This text attribute specifies the current text justification.

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

Definition at line 368 of file txtattr.h.


Constructor & Destructor Documentation

TxtJustificationAttribute::TxtJustificationAttribute  ) 
 

Default Constuctor for TxtJustificationAttribute It defaults to LEFT justify.

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

Definition at line 1534 of file txtattr.cpp.

01535 {
01536     justification = JLEFT;
01537 } 

TxtJustificationAttribute::TxtJustificationAttribute Justification  Justify  ) 
 

TxtJustificationAttribute constructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/3/95
Parameters:
Justify:The type of justification (JLEFT, JRIGHT, JCENTRE, or JFULL) [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1555 of file txtattr.cpp.

01556 { 
01557     justification = Justify; 
01558 }


Member Function Documentation

BOOL TxtJustificationAttribute::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 1691 of file txtattr.cpp.

01692 {
01693     TxtJustificationAttribute *pAttr = new TxtJustificationAttribute;
01694     if (pAttr==NULL)
01695         // error message has already been set by new
01696         return FALSE;
01697 
01698     UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(BaseTextClass), 
01699                                                          pAttr);
01700 
01701     ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising TxtJustificationAttribute");
01702 
01703     return TRUE;
01704 }

BOOL TxtJustificationAttribute::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 1668 of file txtattr.cpp.

01669 {
01670     // This must be at least a FillGeometryAttribute...
01671     ERROR3IF(!pAttr->IsKindOf(CC_RUNTIME_CLASS(TxtJustificationAttribute)), 
01672                 "Different attribute types in TxtJustificationAttribute::IsDifferent()");
01673 
01674     // Check they are NOT the same.
01675     return ( !(*((TxtJustificationAttribute *)pAttr) == *this) ); 
01676 }

NodeAttribute * TxtJustificationAttribute::MakeNode  )  [virtual]
 

Make a AttrTxtJustification 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 1719 of file txtattr.cpp.

01720 {
01721     // Create new attribute node
01722     AttrTxtJustification*  pAttr = new AttrTxtJustification();
01723     if (pAttr==NULL)      
01724         // error message has already been set by new
01725         return NULL;
01726 
01727     // Copy attribute value into the new node.
01728     pAttr->Value.SimpleCopy(this);
01729 
01730     // Return the new node
01731     return pAttr;
01732 }

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

01612 {    
01613     justification = Attrib.justification;
01614     return *this;
01615 }

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

01632 {
01633     return (Attrib.justification == justification); 
01634 }

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

Sets the TxtJustificationAttribute 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 1574 of file txtattr.cpp.

01575 {
01576     pRegion->SetTxtJustification(this, Temp);
01577 }

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

Restores the TxtJustificationAttribute 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 1593 of file txtattr.cpp.

01594 {
01595     pRegion->RestoreTxtJustification(this, Temp);
01596 }

void TxtJustificationAttribute::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 1647 of file txtattr.cpp.

01648 {
01649     ERROR3IF(!IS_A(pValue, TxtJustificationAttribute), 
01650         "Invalid Attribute value passed to TxtJustificationAttribute::SimpleCopy");
01651     // We may as well just use our assignment operator.
01652     *this = *((TxtJustificationAttribute*)pValue);
01653 }


Member Data Documentation

Justification TxtJustificationAttribute::justification
 

Definition at line 389 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