EOLNode Class Reference

Every TextLine that is created will have a EOLNode as its last child. This means that every TextLine will always have at least one child node. More...

#include <nodetext.h>

Inheritance diagram for EOLNode:

AbstractTextChar VisibleTextNode BaseTextClass NodeRenderableInk NodeRenderableBounded NodeRenderable Node CCObject SimpleCCObject List of all members.

Public Member Functions

 EOLNode ()
 Simple EOLNode constructor, it is required so that SimpleCopy will work.
 EOLNode (Node *ContextNode, AttachNodeDirection Direction)
 The main EOLNode constructor.
virtual DocRect GetBlobBoundingRect ()
 get the EOLNode's blob bounds
virtual void RenderObjectBlobs (RenderRegion *pRender)
 Renders the selection blobs for an EOLNode.
virtual void RenderTinyBlobs (RenderRegion *pRender)
 Renders the selection blobs for an EOLNode.
BOOL GetBlobPath (Path *)
 Builds a path for rendering the blobs for an EOLNode.
virtual BOOL ExportRender (RenderRegion *pRegion)
 This function is called when the render function passes through this node It outputs the Text Object start and end tokens.
virtual UINT32 GetNodeSize () const
 For finding the size of the node.
virtual void GetDebugDetails (StringBase *Str)
 For obtaining debug information about the Node. This fn can be deleted before we ship.
virtual String Describe (BOOL Plural, BOOL Verbose)
 For obtaining a desciption about the node to use in the status line.
virtual BOOL ValidateBoundingRect (FormatRegion *pFormatRegion=NULL)
 calculate the EOL bounds in the document
virtual DocRect GetBoundingRect (BOOL DontUseAttrs=FALSE, BOOL HitTest=FALSE)
 Get the EOL's bounds If the cached bounds are invalid, recalculate them.
virtual BOOL IsAnEOLNode () const
BOOL IsVirtual () const
void SetVirtual (BOOL Status)
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL WritePreChildrenWeb (BaseCamelotFilter *pFilter)
 Writes an end of line record to the new file format filter.
virtual BOOL WritePreChildrenNative (BaseCamelotFilter *pFIlter)
virtual BOOL CanWriteChildrenWeb (BaseCamelotFilter *pFilter)
 Asks if it's alright to write out the EOL's children.
virtual BOOL CanWriteChildrenNative (BaseCamelotFilter *pFilter)

Protected Member Functions

virtual 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 of Node.
void CopyNodeContents (EOLNode *NodeCopy)
 This method copies the node's contents to the node pointed to by NodeCopy.

Private Attributes

BYTE Virtual: 1

Detailed Description

Every TextLine that is created will have a EOLNode as its last child. This means that every TextLine will always have at least one child node.

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

Definition at line 474 of file nodetext.h.


Constructor & Destructor Documentation

EOLNode::EOLNode  ) 
 

Simple EOLNode constructor, it is required so that SimpleCopy will work.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/12/94

Definition at line 3140 of file nodetext.cpp.

03140                 : AbstractTextChar() // Call the base class
03141 {
03142     Virtual   = FALSE;
03143 }

EOLNode::EOLNode Node ContextNode,
AttachNodeDirection  Direction
 

The main EOLNode constructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/02/95
Parameters:
ContextNode,: Pointer to a node which this node is to be attached to. [INPUTS]
Direction:

Specifies the direction in which the node is to be attached to the ContextNode. The values this variable can take are as follows:

PREV : Attach node as a previous sibling of the context node NEXT : Attach node as a next sibling of the context node FIRSTCHILD: Attach node as the first child of the context node LASTCHILD : Attach node as a last child of the context node

Definition at line 3166 of file nodetext.cpp.

03167                                                   : AbstractTextChar(ContextNode, Direction)
03168 {
03169     Virtual   = FALSE;
03170 }


Member Function Documentation

BOOL EOLNode::CanWriteChildrenNative BaseCamelotFilter pFilter  )  [virtual]
 

Reimplemented from Node.

Definition at line 3512 of file nodetext.cpp.

03513 {
03514     return TRUE;
03515 }

BOOL EOLNode::CanWriteChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Asks if it's alright to write out the EOL's children.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/8/96
Parameters:
pFilter - new file format filter to write record to [INPUTS]
Returns:
TRUE if successful, FALSE otherwise
EOLs always say yes. EOL nodes can't be female then.

Reimplemented from Node.

Definition at line 3504 of file nodetext.cpp.

03505 {
03506     return TRUE;
03507 }

void EOLNode::CopyNodeContents EOLNode NodeCopy  )  [protected]
 

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

Definition at line 3229 of file nodetext.cpp.

03230 {
03231     // Ask the base class to do its bit
03232     AbstractTextChar::CopyNodeContents( NodeCopy );
03233 
03234     // Copy the rest of the data in here
03235     NodeCopy->Virtual   = Virtual;
03236 }

String EOLNode::Describe BOOL  Plural,
BOOL  Verbose
[virtual]
 

For obtaining a desciption about the node to use in the status line.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/03/95
Parameters:
Plural - FALSE to describe a single EOLNode [INPUTS] TRUE to describe many
Returns:
String describing what the node is

Reimplemented from AbstractTextChar.

Definition at line 3209 of file nodetext.cpp.

03210 {
03211     if (Plural)
03212         return(String(_R(IDS_EOLNODES)));  
03213     else
03214         return(String(_R(IDS_EOLNODE))); 
03215 }

BOOL EOLNode::ExportRender RenderRegion pRegion  )  [virtual]
 

This function is called when the render function passes through this node It outputs the Text Object start and end tokens.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/4/95
Parameters:
pRegion - points to the export render region [INPUTS]
Returns:
TRUE if rendered OK (FALSE=>use normal rendering)

Reimplemented from NodeRenderableInk.

Definition at line 3528 of file nodetext.cpp.

03529 {
03530 #if EXPORT_TEXT
03531 
03532     // (ChrisG - 3/11/00)
03533     if (pRegion->IsKindOf(CC_RUNTIME_CLASS(AIEPSRenderRegion)))
03534     {
03535         // if we were exporting the overflow data (i.e. we were exporting a path), then 
03536         //  finish off exporting this
03537         if (((AIEPSRenderRegion *) pRegion)->ExportingOnPath ())
03538             ((AIEPSRenderRegion *) pRegion)->OverflowTextFinish ();
03539     }
03540 
03541     return pRegion->WriteNewLine ();
03542 #else
03543     return FALSE;
03544 #endif
03545 }

DocRect EOLNode::GetBlobBoundingRect  )  [virtual]
 

get the EOLNode's blob bounds

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/95
Returns:
the EOLNode's blob bounds

Reimplemented from AbstractTextChar.

Definition at line 3360 of file nodetext.cpp.

03361 {
03362     Path RenderPath;
03363     DocRect Bounds(0,0,1,1);
03364     if (GetBlobPath(&RenderPath))
03365         Bounds = RenderPath.GetBoundingRect();
03366 
03367     return Bounds;
03368 }

BOOL EOLNode::GetBlobPath Path pPath  ) 
 

Builds a path for rendering the blobs for an EOLNode.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/95
Parameters:
Pointer to a path [INPUTS]
Returns:
TRUE/FALSE for success/failure

Definition at line 3425 of file nodetext.cpp.

03426 {
03427 #if !defined(EXCLUDE_FROM_RALPH)
03428     ERROR2IF(pPath==NULL, FALSE, "Path pointer was NULL");
03429     TextLine* pParentLine = this->FindParentLine();
03430     ERROR2IF(pParentLine==NULL, FALSE, "EOLNode didn't have a parent TextLine");
03431     const MILLIPOINT LineAscent = pParentLine->GetLineAscent();
03432     const MILLIPOINT HalfLA     = LineAscent/2;
03433     const MILLIPOINT QuarterLA  = LineAscent/4;
03434     BOOL ok = TRUE;
03435     if (ok) ok = pPath->Initialise(4,1);
03436     if (ok) ok = pPath->AddMoveTo(DocCoord(QuarterLA,0));
03437     if (ok) ok = pPath->AddLineTo(DocCoord(QuarterLA, HalfLA));
03438     if (ok) ok = pPath->AddLineTo(DocCoord(HalfLA+QuarterLA, QuarterLA));
03439     if (ok) ok = pPath->AddLineTo(DocCoord(QuarterLA,0));
03440     if (ok)
03441     {
03442         ok = pPath->CloseSubPath();
03443         pPath->IsFilled = TRUE;
03444     }
03445 
03446     // Transform the path
03447     if (ok)
03448     {
03449         Matrix matrix;
03450         if (ok) ok = GetStoryAndCharMatrix(&matrix);
03451         if (ok) matrix.transform((Coord*)(pPath->GetCoordArray()), pPath->GetNumCoords());
03452     }
03453 
03454     return ok;
03455 #else
03456     return FALSE;
03457 #endif
03458 }

DocRect EOLNode::GetBoundingRect BOOL  DontUseAttr = FALSE,
BOOL  HitTest = FALSE
[virtual]
 

Get the EOL's bounds If the cached bounds are invalid, recalculate them.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/3/95
Parameters:
DontUseAttr - not used (EOL is not rendered) [INPUTS] HitTest - TRUE if being called during HitTest
Returns:
the EOL bounds (zero size but in correct position

Reimplemented from AbstractTextChar.

Definition at line 3316 of file nodetext.cpp.

03317 {
03318     if (IsBoundingRectValid==FALSE)
03319         if (ValidateBoundingRect()==FALSE)
03320             InformError();
03321 
03322     return BoundingRectangle;
03323 }

void EOLNode::GetDebugDetails StringBase pStr  )  [virtual]
 

For obtaining debug information about the Node. This fn can be deleted before we ship.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/2/95
Parameters:
Str,: String giving debug info about the node [OUTPUTS]

Reimplemented from AbstractTextChar.

Definition at line 3287 of file nodetext.cpp.

03288 {
03289 #if DEBUG_TREE
03290     AbstractTextChar::GetDebugDetails(pStr);
03291 
03292     String_256 TempStr;
03293 
03294     switch (IsVirtual())
03295     {
03296         case TRUE:  TempStr._MakeMsg(TEXT("\r\nIs virtual"));  break;
03297         case FALSE: TempStr._MakeMsg(TEXT("\r\nIs physical")); break;
03298     }
03299     *pStr += TempStr;
03300 #endif
03301 }

UINT32 EOLNode::GetNodeSize  )  const [virtual]
 

For finding the size of the node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/12/94
Returns:
The size of the node in bytes

Reimplemented from AbstractTextChar.

Definition at line 3271 of file nodetext.cpp.

03272 {
03273     return (sizeof(EOLNode)); 
03274 }

virtual BOOL EOLNode::IsAnEOLNode  )  const [inline, virtual]
 

Reimplemented from VisibleTextNode.

Definition at line 495 of file nodetext.h.

00495 {return TRUE;};

BOOL EOLNode::IsVirtual  )  const [inline]
 

Definition at line 497 of file nodetext.h.

00497 { return Virtual; }

void EOLNode::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 AbstractTextChar.

Definition at line 3251 of file nodetext.cpp.

03252 {
03253     ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node");
03254     ENSURE(IS_A(pNodeCopy, EOLNode), "PolyCopyNodeContents given wrong dest node type");
03255 
03256     if (IS_A(pNodeCopy, EOLNode))
03257         CopyNodeContents((EOLNode*)pNodeCopy);
03258 }

void EOLNode::RenderObjectBlobs RenderRegion pRenderRegion  )  [virtual]
 

Renders the selection blobs for an EOLNode.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/95
Parameters:
pRenderRegion - region to render the blobs into [INPUTS]

Reimplemented from AbstractTextChar.

Definition at line 3380 of file nodetext.cpp.

03381 {
03382 #if !defined(EXCLUDE_FROM_RALPH)
03383     Path RenderPath;
03384     if (GetBlobPath(&RenderPath))
03385     {
03386         DocColour Trans(COLOUR_TRANS);
03387         pRenderRegion->SetLineWidth(0);
03388         pRenderRegion->SetLineColour(Trans);
03389         pRenderRegion->SetFillColour(COLOUR_UNSELECTEDBLOB);
03390         pRenderRegion->DrawPath(&RenderPath);
03391     }
03392     else
03393         InformError();
03394 #endif
03395 }

void EOLNode::RenderTinyBlobs RenderRegion pRenderRegion  )  [virtual]
 

Renders the selection blobs for an EOLNode.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/95
Parameters:
pRenderRegion - region to render the blobs into [INPUTS]

Reimplemented from AbstractTextChar.

Definition at line 3407 of file nodetext.cpp.

03408 {
03409 #if !defined(EXCLUDE_FROM_RALPH)
03410     RenderObjectBlobs(pRenderRegion);
03411 #endif
03412 }

void EOLNode::SetVirtual BOOL  Status  )  [inline]
 

Definition at line 498 of file nodetext.h.

00498 { Virtual = Status; }

Node * EOLNode::SimpleCopy void   )  [protected, 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 of Node.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/12/94
Returns:
A copy of the node, or NULL if we are out of memory

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

Reimplemented from AbstractTextChar.

Definition at line 3185 of file nodetext.cpp.

03186 {
03187     // Make a new TextChar and then copy things into it
03188     EOLNode* NodeCopy = new EOLNode();
03189 
03190     if (NodeCopy)
03191         CopyNodeContents(NodeCopy);
03192     
03193     return NodeCopy;
03194 
03195 }

BOOL EOLNode::ValidateBoundingRect FormatRegion pFormatRegion = NULL  )  [virtual]
 

calculate the EOL bounds in the document

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/3/95
Parameters:
pFormatRegion - not used [INPUTS]
Returns:
FALSE if fails

Reimplemented from VisibleTextNode.

Definition at line 3336 of file nodetext.cpp.

03337 {
03338     Matrix matrix;
03339     if (GetStoryAndCharMatrix(&matrix)==FALSE)
03340         return FALSE;
03341 
03342     // get a zero size rect at correct place in the doc for the renderable bounds of the EOL
03343     DocCoord temp(0,0);
03344     matrix.transform(&temp);
03345     BoundingRectangle   = DocRect(temp,temp);
03346     IsBoundingRectValid = TRUE;
03347     return TRUE;
03348 }

BOOL EOLNode::WritePreChildrenNative BaseCamelotFilter pFIlter  )  [virtual]
 

Reimplemented from Node.

Definition at line 3481 of file nodetext.cpp.

03482 {
03483 #ifdef DO_EXPORT
03484     return CXaraFileTxtEOL::WritePreChildrenNative(pFilter, this);
03485 #else
03486     return FALSE;
03487 #endif
03488 }

BOOL EOLNode::WritePreChildrenWeb BaseCamelotFilter pFilter  )  [virtual]
 

Writes an end of line record to the new file format filter.

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

Reimplemented from Node.

Definition at line 3472 of file nodetext.cpp.

03473 {
03474 #ifdef DO_EXPORT
03475     return CXaraFileTxtEOL::WritePreChildrenWeb(pFilter, this);
03476 #else
03477     return FALSE;
03478 #endif
03479 }


Member Data Documentation

BYTE EOLNode::Virtual [private]
 

Definition at line 513 of file nodetext.h.


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