AttrTxtJustification Class Reference

AttrTxtJustification specifies how text is justified. More...

#include <txtattr.h>

Inheritance diagram for AttrTxtJustification:

AttrTxtBase NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrTxtJustification ()
 Default constructor for AttrTxtJustification class.
 AttrTxtJustification (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 Creates a AttrTxtJustification Attribute.
void Render (RenderRegion *pRender)
 'Renders' a Line Width attribute.
NodeSimpleCopy ()
 This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes.
virtual INT32 operator== (const NodeAttribute &NodeAttrib)
 A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
virtual UINT32 GetAttrNameID (void)
 Returns back a string resource ID describing the attribute.
void GetDebugDetails (StringBase *Str)
 Used for debugging purposes during developement. Override in your own class and output suitable debugging details.
virtual UINT32 GetNodeSize () const
 For finding the size of the node.
virtual AttributeValueGetAttributeValue ()
virtual AttrIndex GetAttributeIndex ()
virtual BOOL IsALineLevelAttrib ()
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Saves the text justification attribute to the new file format filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)

Public Attributes

TxtJustificationAttribute Value

Private Member Functions

void CopyNodeContents (AttrTxtJustification *NodeCopy)
 This method copies the node's contents to the node pointed to by NodeCopy.

Detailed Description

AttrTxtJustification specifies how text is justified.

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

Definition at line 1128 of file txtattr.h.


Constructor & Destructor Documentation

AttrTxtJustification::AttrTxtJustification  ) 
 

Default constructor for AttrTxtJustification class.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 5583 of file txtattr.cpp.

05584 {
05585 }

AttrTxtJustification::AttrTxtJustification Node ContextNode,
AttachNodeDirection  Direction,
BOOL  Locked = FALSE,
BOOL  Mangled = FALSE,
BOOL  Marked = FALSE,
BOOL  Selected = FALSE
 

Creates a AttrTxtJustification Attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 5558 of file txtattr.cpp.

05564              : AttrTxtBase(ContextNode, Direction, Locked, Mangled, Marked, Selected)  
05565 {                         
05566 } 


Member Function Documentation

void AttrTxtJustification::CopyNodeContents AttrTxtJustification NodeCopy  )  [private]
 

This method copies the node's contents to the node pointed to by NodeCopy.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/4/93
Parameters:
[INPUTS] 
A copy of this node [OUTPUTS]
Returns:
-

Errors: An assertion failure will occur if NodeCopy is NULL

Scope: protected

Definition at line 5705 of file txtattr.cpp.

05706 {
05707     // Let the base class do its bit
05708     AttrTxtBase::CopyNodeContents( NodeCopy );
05709     
05710     //Copy contents specific to derived class here
05711     NodeCopy->Value.justification = Value.justification;
05712 } 

virtual AttrIndex AttrTxtJustification::GetAttributeIndex  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 1158 of file txtattr.h.

01158 { return ATTR_TXTJUSTIFICATION; }

virtual AttributeValue* AttrTxtJustification::GetAttributeValue  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 1157 of file txtattr.h.

01157 { return &Value; }

UINT32 AttrTxtJustification::GetAttrNameID void   )  [virtual]
 

Returns back a string resource ID describing the attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/2/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Attribute description ID

Errors: -

See also:
-

Reimplemented from NodeAttribute.

Definition at line 5681 of file txtattr.cpp.

05682 {
05683     return (_R(IDS_JUSTIFICATION)); 
05684 }  

void AttrTxtJustification::GetDebugDetails StringBase Str  )  [virtual]
 

Used for debugging purposes during developement. Override in your own class and output suitable debugging details.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/04/94
Parameters:
- [INPUTS]

Reimplemented from NodeRenderable.

Definition at line 5771 of file txtattr.cpp.

05772 {
05773     NodeAttribute::GetDebugDetails( Str );
05774 
05775     String_256 TempStr;
05776     char* p;
05777 
05778     switch (Value.justification)
05779     {
05780         case JLEFT:
05781             p="Left";
05782             break;
05783         case JRIGHT:
05784             p="Right";
05785             break;
05786         case JCENTRE:
05787             p="Centre";
05788             break;
05789         case JFULL:
05790             p="Fully";
05791             break;
05792         default:
05793             p="(Unknown)";
05794             break;
05795     }
05796 
05797     TempStr._MakeMsg(TEXT("\r\nJustification=#1%s"), p);
05798     (*Str) += TempStr;
05799     TempStr._MakeMsg(TEXT(" justified\r\n"));
05800     (*Str) += TempStr;
05801 }

UINT32 AttrTxtJustification::GetNodeSize  )  const [virtual]
 

For finding the size of the node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The size of the node in bytes
See also:
Node::GetSubtreeSize

Reimplemented from Node.

Definition at line 5753 of file txtattr.cpp.

05754 {     
05755     return (sizeof(AttrTxtJustification)); 
05756 }

virtual BOOL AttrTxtJustification::IsALineLevelAttrib  )  [inline, virtual]
 

Reimplemented from NodeAttribute.

Definition at line 1160 of file txtattr.h.

01160 {return TRUE;};

INT32 AttrTxtJustification::operator== const NodeAttribute Attrib  )  [virtual]
 

A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
Atrib,: The attribute to compare, which must be an AttrLineWidth [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: An ENSURE failure will occur if Attrib does not have a AttrTxtJustification runtime class.

See also:
NodeAttribute::operator==

Reimplemented from NodeAttribute.

Definition at line 5656 of file txtattr.cpp.

05657 {
05658     ENSURE(Attrib.IsKindOf(CC_RUNTIME_CLASS(AttrTxtJustification)), 
05659         "Trying to compare two objects with different types"); 
05660     AttrTxtJustification* Attr = (AttrTxtJustification*) &Attrib;
05661     return (Attr->Value.justification == Value.justification); 
05662 } 

void AttrTxtJustification::PolyCopyNodeContents NodeRenderable pNodeCopy  )  [virtual]
 

Polymorphically copies the contents of this node to another.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/12/2003
Parameters:
- [OUTPUTS]
Returns:
Errors: An assertion failure will occur if NodeCopy is NULL Scope: protected

Reimplemented from NodeRenderable.

Definition at line 5727 of file txtattr.cpp.

05728 {
05729     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
05730     ENSURE(IS_A(pNodeCopy, AttrTxtJustification), "PolyCopyNodeContents given wrong dest node type");
05731 
05732     if (IS_A(pNodeCopy, AttrTxtJustification))
05733         CopyNodeContents((AttrTxtJustification*)pNodeCopy);
05734 }

void AttrTxtJustification::Render RenderRegion pRegion  )  [virtual]
 

'Renders' a Line Width attribute.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from NodeAttribute.

Definition at line 5603 of file txtattr.cpp.

05604 {
05605     pRegion->SetTxtJustification(&Value, FALSE);
05606 }

Node * AttrTxtJustification::SimpleCopy void   )  [virtual]
 

This method returns a shallow copy of the node with all Node pointers NULL. The function is virtual, and must be defined for all derived classes.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
- [INPUTS]
[OUTPUTS] 
Returns:
A copy of the node, or NULL if memory runs out

Errors: If memory runs out when trying to copy, then ERROR is called with an out of memory error and the function returns NULL.

Scope: protected

Reimplemented from NodeAttribute.

Definition at line 5629 of file txtattr.cpp.

05630 {
05631     AttrTxtJustification* NodeCopy = new AttrTxtJustification();
05632     ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 
05633     CopyNodeContents(NodeCopy);
05634     return NodeCopy;
05635 } 

BOOL AttrTxtJustification::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 5827 of file txtattr.cpp.

05828 {
05829 #ifdef DO_EXPORT
05830     ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
05831 
05832     return CXaraFileTxtJustification::WritePreChildrenNative(pFilter, this);
05833 #else
05834     return FALSE;
05835 #endif
05836 }

BOOL AttrTxtJustification::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Saves the text justification attribute to the new file format filter.

Author:
Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/07/96
Parameters:
pFilter - new camelot filter to save to [INPUTS]
Returns:
TRUE if successful, FALSE otherwise

Reimplemented from Node.

Definition at line 5816 of file txtattr.cpp.

05817 {
05818 #ifdef DO_EXPORT
05819     ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
05820 
05821     return CXaraFileTxtJustification::WritePreChildrenWeb(pFilter, this);
05822 #else
05823     return FALSE;
05824 #endif
05825 }


Member Data Documentation

TxtJustificationAttribute AttrTxtJustification::Value
 

Definition at line 1173 of file txtattr.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:50:41 2007 for Camelot by  doxygen 1.4.4