AttrTxtLineSpace Class Reference

AttrTxtLineSpace: specifies the size of a font (height). More...

#include <txtattr.h>

Inheritance diagram for AttrTxtLineSpace:

AttrTxtBase NodeAttribute NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 AttrTxtLineSpace ()
 Default constructor for AttrTxtLineSpace class.
 AttrTxtLineSpace (MILLIPOINT Value)
 Default constructor for AttrTxtLineSpace class.
 AttrTxtLineSpace (FIXED16 Ratio)
 Default constructor for AttrTxtLineSpace class.
 AttrTxtLineSpace (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
 Creates a AttrTxtLineSpace 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.
virtual AttrIndex GetAttributeIndex ()
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 BOOL IsALineLevelAttrib ()
BOOL IsARatio ()
virtual void BaseLineRelativeTransform (FIXED16 Scale, FIXED16 Aspect)
 Transform the attribute using the baseline relative scale and aspect.
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Saves the text line spacing attribute to the new file format filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFilter)

Public Attributes

TxtLineSpaceAttribute Value

Private Member Functions

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

Detailed Description

AttrTxtLineSpace: specifies the size of a font (height).

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

Definition at line 1643 of file txtattr.h.


Constructor & Destructor Documentation

AttrTxtLineSpace::AttrTxtLineSpace  ) 
 

Default constructor for AttrTxtLineSpace class.

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

Errors: -

See also:
-

Definition at line 7865 of file txtattr.cpp.

07866 {
07867 }

AttrTxtLineSpace::AttrTxtLineSpace MILLIPOINT  value  ) 
 

Default constructor for AttrTxtLineSpace class.

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

Errors: -

See also:
-

Definition at line 7885 of file txtattr.cpp.

07886 {
07887     Value.Value = value;
07888     Value.Ratio = 0;
07889     Value.IsRatio = FALSE;
07890 }

AttrTxtLineSpace::AttrTxtLineSpace FIXED16  ratio  ) 
 

Default constructor for AttrTxtLineSpace class.

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

Errors: -

See also:
-

Definition at line 7908 of file txtattr.cpp.

07909 {
07910     Value.Ratio = ratio;
07911     Value.Value = 0;
07912     Value.IsRatio = TRUE;
07913 
07914 }

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

Creates a AttrTxtLineSpace Attribute.

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

Errors: -

See also:
-

Definition at line 7840 of file txtattr.cpp.

07846              : AttrTxtBase(ContextNode, Direction, Locked, Mangled, Marked, Selected)  
07847 {                         
07848 } 


Member Function Documentation

void AttrTxtLineSpace::BaseLineRelativeTransform FIXED16  Scale,
FIXED16  Aspect
[virtual]
 

Transform the attribute using the baseline relative scale and aspect.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/6/95
Parameters:
Scale - [INPUTS] Aspect -

Reimplemented from AttrTxtBase.

Definition at line 8121 of file txtattr.cpp.

08122 {
08123     // absolute line spacing only - which is 0 if line spacing is relative so has no effect in that case
08124     TxtLineSpaceAttribute* pLineSpaceAttrVal=(TxtLineSpaceAttribute*)GetAttributeValue();
08125     pLineSpaceAttrVal->Value = XLONG(pLineSpaceAttrVal->Value) * Scale;
08126 }

void AttrTxtLineSpace::CopyNodeContents AttrTxtLineSpace 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 8034 of file txtattr.cpp.

08035 {
08036     // Let the base class do its bit
08037     NodeAttribute::CopyNodeContents( NodeCopy );
08038     NodeCopy->Value = Value;
08039 
08040 } 

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

Reimplemented from NodeAttribute.

Definition at line 1668 of file txtattr.h.

01668 { return ATTR_TXTLINESPACE; }

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

Reimplemented from NodeAttribute.

Definition at line 1676 of file txtattr.h.

01676 { return &Value; }

UINT32 AttrTxtLineSpace::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 8010 of file txtattr.cpp.

08011 {
08012     return (_R(IDS_LINESPACE)); 
08013 }  

void AttrTxtLineSpace::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 8099 of file txtattr.cpp.

08100 {
08101     NodeAttribute::GetDebugDetails( Str );
08102 
08103     
08104     TCHAR               buf[64];
08105     camSnprintf( buf, 64, _T("\r\nLineSpace = %ld\r\nRatio = %.2f"), Value.Value, Value.Ratio.MakeDouble() );
08106     //TempStr._MakeMsg( TEXT("\r\nLine space=#1%ld\r\n Ratio=#2%f\r\n"), Value.Value,Value.Ratio.MakeDouble());
08107     (*Str) += buf;
08108 }

UINT32 AttrTxtLineSpace::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 8081 of file txtattr.cpp.

08082 {     
08083     return (sizeof(AttrTxtLineSpace)); 
08084 }

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

Reimplemented from NodeAttribute.

Definition at line 1678 of file txtattr.h.

01678 {return TRUE;};

BOOL AttrTxtLineSpace::IsARatio  )  [inline]
 

Definition at line 1680 of file txtattr.h.

01680 { return Value.IsARatio(); }

INT32 AttrTxtLineSpace::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 AttrTxtLineSpace runtime class.

See also:
NodeAttribute::operator==

Reimplemented from NodeAttribute.

Definition at line 7985 of file txtattr.cpp.

07986 {
07987     ENSURE(Attrib.IsKindOf(CC_RUNTIME_CLASS(AttrTxtLineSpace)), 
07988         "Trying to compare two objects with different types"); 
07989     AttrTxtLineSpace* Attr = (AttrTxtLineSpace*) &Attrib;
07990     return (Attr->Value == Value); 
07991 } 

void AttrTxtLineSpace::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 8055 of file txtattr.cpp.

08056 {
08057     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
08058     ENSURE(IS_A(pNodeCopy, AttrTxtLineSpace), "PolyCopyNodeContents given wrong dest node type");
08059 
08060     if (IS_A(pNodeCopy, AttrTxtLineSpace))
08061         CopyNodeContents((AttrTxtLineSpace*)pNodeCopy);
08062 }

void AttrTxtLineSpace::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 7932 of file txtattr.cpp.

07933 {
07934     pRegion->SetTxtLineSpace(&Value, FALSE);
07935 }

Node * AttrTxtLineSpace::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 7958 of file txtattr.cpp.

07959 {
07960     AttrTxtLineSpace* NodeCopy = new AttrTxtLineSpace();
07961     ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 
07962     CopyNodeContents(NodeCopy);
07963     return NodeCopy;
07964 } 

BOOL AttrTxtLineSpace::WritePreChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 8152 of file txtattr.cpp.

08153 {
08154 #ifdef DO_EXPORT
08155     ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
08156 
08157     return CXaraFileTxtLineSpace::WritePreChildrenNative(pFilter, this);
08158 #else
08159     return FALSE;
08160 #endif
08161 }

BOOL AttrTxtLineSpace::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Saves the text line spacing 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 8141 of file txtattr.cpp.

08142 {
08143 #ifdef DO_EXPORT
08144     ERROR2IF(pFilter==NULL, FALSE, "Parameter pFilter == NULL.");
08145 
08146     return CXaraFileTxtLineSpace::WritePreChildrenWeb(pFilter, this);
08147 #else
08148     return FALSE;
08149 #endif
08150 }


Member Data Documentation

TxtLineSpaceAttribute AttrTxtLineSpace::Value
 

Definition at line 1695 of file txtattr.h.


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