#include <nodedoc.h>
Inheritance diagram for NodeDocument:
Public Member Functions | |
NodeDocument () | |
This constructor creates a NodeDocument linked to no other nodes, with all status flags false, and NULL bounding and pasteboard rectangles. | |
NodeDocument (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE) | |
This constructor initialises the node and links it to ContextNode in the direction specified by Direction. All neccesary tree links are updated. | |
~NodeDocument () | |
NodeDocument destructor. | |
void | SetParentDoc (BaseDocument *pNewDoc) |
Specify which Document object a NodeDocument object is attached to. This cannot be done again, unless this function is first called with NULL as the document to attachto. | |
BaseDocument * | GetParentDoc () |
virtual BOOL | IsNodeDocument () const |
Find out which Document object a NodeDocument object is attached to. Tell the caller that this is a NodeDocument. | |
DocCoord | LoExtent () const |
For finding the low extent of the document. | |
DocCoord | HiExtent () const |
For finding the high extent of the document. | |
void | DescribeExtents (DocCoord *LoExtent, DocCoord *HiExtent) const |
For finding the extents of the document. | |
void | SetExtents () |
For setting the document's extents in the NodeDocument, and then updating the extents in the current document. The NodeDocument finds its extents by looking at its first and last chapter's pasteboard rectangles. | |
virtual UINT32 | GetNodeSize () const |
For finding the size of the node. | |
virtual void | GetDebugDetails (StringBase *Str) |
For obtaining debug information about the Node. | |
virtual void | PolyCopyNodeContents (NodeRenderable *pNodeCopy) |
Polymorphically copies the contents of this node to another. | |
Protected Member Functions | |
virtual Node * | SimpleCopy () |
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. | |
void | CopyNodeContents (NodeDocument *NodeCopy) |
This method copies the node's contents to the node pointed to by NodeCopy. | |
Protected Attributes | |
DocCoord | LowExtent |
DocCoord | HighExtent |
BaseDocument * | pParentDoc |
Definition at line 123 of file nodedoc.h.
|
This constructor creates a NodeDocument linked to no other nodes, with all status flags false, and NULL bounding and pasteboard rectangles.
Definition at line 133 of file nodedoc.cpp. 00133 : NodeRenderablePaper() 00134 { 00135 pParentDoc = NULL; 00136 }
|
|
This constructor initialises the node and links it to ContextNode in the direction specified by Direction. All neccesary tree links are updated.
Specifies the direction in which this 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 The remaining inputs specify the status of the node: Locked: Is node locked ? Mangled: Is node mangled ? Marked: Is node marked ? Selected: Is node selected ?
Definition at line 184 of file nodedoc.cpp. 00189 :NodeRenderablePaper(ContextNode, Direction, Locked, 00190 Mangled,Marked, Selected) 00191 { 00192 pParentDoc = NULL; 00193 }
|
|
NodeDocument destructor.
Definition at line 214 of file nodedoc.cpp.
|
|
This method copies the node's contents to the node pointed to by NodeCopy.
Definition at line 326 of file nodedoc.cpp. 00327 { 00328 ENSURE(NodeCopy != NULL, "Trying to copy a node's contents to a NULL node"); 00329 NodeRenderablePaper::CopyNodeContents(NodeCopy); 00330 NodeCopy->LowExtent = LowExtent; 00331 NodeCopy->HighExtent = HighExtent; 00332 }
|
|
For finding the extents of the document.
Definition at line 419 of file nodedoc.cpp. 00420 { 00421 *LoExtent = LowExtent; 00422 *HiExtent = HighExtent; 00423 }
|
|
For obtaining debug information about the Node.
Reimplemented from NodeRenderablePaper. Definition at line 514 of file nodedoc.cpp. 00515 { 00516 #ifdef _DEBUG 00517 NodeRenderablePaper::GetDebugDetails(Str); 00518 String_256 TempStr; 00519 TempStr._MakeMsg(TEXT("\r\nLowExtent = (#1%ld, #2%ld)\r\nHighExtent = (#3%ld, #4%ld)\r\n"), 00520 LowExtent.x, LowExtent.y, HighExtent.x, HighExtent.y); 00521 (*Str)+=TempStr; 00522 #endif 00523 }
|
|
For finding the size of the node.
Reimplemented from Node. Definition at line 540 of file nodedoc.cpp. 00541 { 00542 return (sizeof(NodeDocument)); 00543 }
|
|
Definition at line 141 of file nodedoc.h. 00141 { return pParentDoc; };
|
|
For finding the high extent of the document.
Definition at line 397 of file nodedoc.cpp. 00398 { 00399 return (HighExtent); 00400 }
|
|
Find out which Document object a NodeDocument object is attached to. Tell the caller that this is a NodeDocument.
Reimplemented from Node. Definition at line 271 of file nodedoc.cpp. 00272 { 00273 // Yes, it's a NodeDocument 00274 return TRUE; 00275 }
|
|
For finding the low extent of the document.
Definition at line 375 of file nodedoc.cpp. 00376 { 00377 return (LowExtent); 00378 }
|
|
Polymorphically copies the contents of this node to another.
Reimplemented from NodeRenderablePaper. Definition at line 347 of file nodedoc.cpp. 00348 { 00349 ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node"); 00350 ENSURE(IS_A(pNodeCopy, NodeDocument), "PolyCopyNodeContents given wrong dest node type"); 00351 00352 if (IS_A(pNodeCopy, NodeDocument)) 00353 CopyNodeContents((NodeDocument*)pNodeCopy); 00354 }
|
|
For setting the document's extents in the NodeDocument, and then updating the extents in the current document. The NodeDocument finds its extents by looking at its first and last chapter's pasteboard rectangles.
Definition at line 450 of file nodedoc.cpp. 00451 { 00452 BOOL FoundChapter = FALSE; // Flag indicating if we have found a chapter beneath the doc 00453 00454 Node* CurrentNode = FindFirstChild(); 00455 00456 // Find the first chapter of a document 00457 while ((CurrentNode != NULL) && (!FoundChapter)) 00458 { 00459 if (CurrentNode->IsKindOf(CC_RUNTIME_CLASS(Chapter))) 00460 { 00461 FoundChapter = TRUE; 00462 HighExtent = ((NodeRenderablePaper*)CurrentNode)->GetPasteboardRect(FALSE).HighCorner(); 00463 // Low extent will change if we find another chapter 00464 LowExtent = ((NodeRenderablePaper*)CurrentNode)->GetPasteboardRect(FALSE).LowCorner(); 00465 } 00466 CurrentNode = CurrentNode->FindNext(); 00467 } 00468 00469 // A document should have at least one chapter when setting the extents 00470 ENSURE(FoundChapter,"Trying to set the extents of a document with no chapters"); 00471 00472 // Find the last chapter which may be the first 00473 while(CurrentNode != NULL) 00474 { 00475 if (CurrentNode->IsKindOf(CC_RUNTIME_CLASS(Chapter))) 00476 { 00477 LowExtent = ((NodeRenderablePaper*)CurrentNode)->GetPasteboardRect().LowCorner(); 00478 } 00479 CurrentNode = CurrentNode->FindNext(); 00480 } 00481 00482 // Inform the document that its extents have changed (only do it for 'real' documents, 00483 // and not e.g. the clipboard. 00484 if (IS_A(pParentDoc, Document)) 00485 ((Document *) pParentDoc)->UpdateExtents(LowExtent, HighExtent); 00486 }
|
|
Specify which Document object a NodeDocument object is attached to. This cannot be done again, unless this function is first called with NULL as the document to attachto.
Definition at line 234 of file nodedoc.cpp. 00235 { 00236 if (pParentDoc != NULL) 00237 { 00238 // Error 00239 ERROR2RAW("NodeDocument is already attached to a Document!"); 00240 } 00241 else 00242 { 00243 // Attach document. 00244 pParentDoc = pNewDoc; 00245 } 00246 }
|
|
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.
Reimplemented from NodeRenderablePaper. Definition at line 297 of file nodedoc.cpp. 00298 { 00299 NodeDocument* NodeCopy; 00300 NodeCopy = new NodeDocument(); 00301 ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 00302 CopyNodeContents(NodeCopy); 00303 return (NodeCopy); 00304 }
|
|
|
|
|
|
|