#include <chapter.h>
Inheritance diagram for Chapter:
Public Member Functions | |
Chapter () | |
This constructor creates a Chapter linked to no other nodes, with all status flags false, and NULL bounding and pasteboard rectangles. | |
Chapter (Node *ContextNode, AttachNodeDirection Direction, MILLIPOINT FldLineXCoord=1000, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE) | |
This method initialises the node and links it to ContextNode in the direction specified by Direction. All neccesary tree links are updated. | |
String | Describe (BOOL Plural, BOOL Verbose) |
To return a description of the Node object in either the singular or the plural. This method is called by the DescribeRange method. | |
virtual BOOL | IsChapter () const |
For finding if a node is a chapter node. | |
Chapter * | FindPreviousChapter (void) |
For finding the previous sibling chapter. | |
Spread * | FindFirstSpread () |
Returns the first spread which is an immediate child of the chapter. | |
XLONG | GetChapterDepth () |
Find the depth of a chapter in logical coords. i.e. how far from the top of the document the top of the chapter's pasteboard is. | |
void | Render (RenderRegion *pRender) |
void | SetFoldLineXCoord (MILLIPOINT value, BOOL DisplayFoldLine=TRUE) |
For setting the X coordinate of the chapters fold line, and enabling/disabling the display of the fold line (for single page spreads the fold line is disabled). | |
MILLIPOINT | GetFoldLineXCoord () const |
For finding the X coordinate of the chapters fold line. | |
BOOL | ShouldShowFoldLine (void) const |
To determine if the chapter fold line is intended to be displayed. | |
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. | |
virtual BOOL | WritePreChildrenWeb (BaseCamelotFilter *pFilter) |
Web files don't write out a chapter records. | |
virtual BOOL | WritePreChildrenNative (BaseCamelotFilter *pFilter) |
Writes out a chapter record. | |
virtual BOOL | WriteBeginChildRecordsWeb (BaseCamelotFilter *pFilter) |
Begins the child record sequence for chapter in the web format. | |
virtual BOOL | WriteBeginChildRecordsNative (BaseCamelotFilter *pFilter) |
Begin to write out you child records, in the native format. | |
virtual BOOL | WriteEndChildRecordsWeb (BaseCamelotFilter *pFilter) |
Ends the child record sequence for chapter in the web format. | |
virtual BOOL | WriteEndChildRecordsNative (BaseCamelotFilter *pFilter) |
Finished writing out you child records, in the native format. | |
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 (Chapter *NodeCopy) |
This method copies the node's contents to the node pointed to by NodeCopy. | |
Protected Attributes | |
MILLIPOINT | FoldLineXCoord |
BOOL | ShowFoldLine |
Definition at line 127 of file chapter.h.
|
This constructor creates a Chapter linked to no other nodes, with all status flags false, and NULL bounding and pasteboard rectangles.
Definition at line 136 of file chapter.cpp. 00136 : NodeRenderablePaper() 00137 { 00138 FoldLineXCoord = 0; 00139 ShowFoldLine = FALSE; 00140 }
|
|
This method 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 FldLineXCoord: X Coordinate of the main fold line for the spreads in the chapter 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 192 of file chapter.cpp. 00199 : NodeRenderablePaper(ContextNode, Direction, Locked, Mangled, 00200 Marked, Selected) 00201 { 00202 FoldLineXCoord = FldLineXCoord; 00203 ShowFoldLine = TRUE; 00204 }
|
|
This method copies the node's contents to the node pointed to by NodeCopy.
Definition at line 454 of file chapter.cpp. 00455 { 00456 ENSURE(NodeCopy != NULL,"Trying to copy node contents to\na node pointed to by a NULL pointer"); 00457 NodeRenderablePaper::CopyNodeContents(NodeCopy); 00458 NodeCopy->FoldLineXCoord = FoldLineXCoord; 00459 }
|
|
To return a description of the Node object in either the singular or the plural. This method is called by the DescribeRange method.
Reimplemented from Node. Definition at line 234 of file chapter.cpp. 00235 { 00236 if (Plural) 00237 return(String(_R(IDS_CHAPTER_DESCRP))); 00238 else 00239 return(String(_R(IDS_CHAPTER_DESCRS))); 00240 };
|
|
Returns the first spread which is an immediate child of the chapter.
Definition at line 299 of file chapter.cpp. 00300 { 00301 Node* pNode = FindFirstChild(); 00302 while(pNode != 0 && !pNode->IsSpread()) 00303 pNode = pNode->FindNext(); 00304 00305 return (Spread*) pNode; 00306 }
|
|
For finding the previous sibling chapter.
Definition at line 258 of file chapter.cpp. 00259 { 00260 Node* CurrentNode = FindPrevious(); 00261 while (CurrentNode != 0) 00262 { 00263 if (CurrentNode->IsChapter()) 00264 return (Chapter*) CurrentNode; 00265 CurrentNode = CurrentNode->FindPrevious(); 00266 } 00267 return 0; // No chapter found 00268 }
|
|
Find the depth of a chapter in logical coords. i.e. how far from the top of the document the top of the chapter's pasteboard is.
Definition at line 475 of file chapter.cpp. 00476 { 00477 XLONG Depth = 0; 00478 00479 // Loop through document tree calculating the logical coordinate offset for the 00480 // current chapter 00481 00482 // Chapter *pChapter = Node::FindFirstChapter(FindOwnerDoc()); 00483 Node* pNode = FindParent(); 00484 ERROR2IF(!(pNode->IsNodeDocument()), 0, "Parent of Chapter is not NodeDocument"); 00485 Chapter *pChapter = (Chapter*)pNode->FindFirstChild(CC_RUNTIME_CLASS(Chapter)); 00486 00487 ENSURE(pChapter != NULL, "Couldn't find first chapter in Chapter::GetChapterDepth"); 00488 00489 while ((pChapter != NULL) && (pChapter != this)) 00490 { 00491 00492 ENSURE(pChapter->IsKindOf(CC_RUNTIME_CLASS(Chapter)), 00493 "Chapter's sibling is not a Chapter"); 00494 00495 const DocRect ChapRect = pChapter->GetPasteboardRect(); 00496 00497 // Accumulate logical offset 00498 Depth += ChapRect.Height(); 00499 00500 pChapter = (Chapter *) pChapter->FindNext(); 00501 } 00502 00503 return Depth; 00504 }
|
|
For obtaining debug information about the Node.
Reimplemented from NodeRenderablePaper. Definition at line 534 of file chapter.cpp. 00535 { 00536 NodeRenderablePaper::GetDebugDetails(Str); 00537 String_256 TempStr; 00538 TempStr._MakeMsg(TEXT("\r\nFoldLine X Coord = #1%ld\r\n"), 00539 FoldLineXCoord); 00540 (*Str)+=TempStr; 00541 }
|
|
For finding the X coordinate of the chapters fold line.
Definition at line 376 of file chapter.cpp. 00377 { 00378 return (FoldLineXCoord); 00379 }
|
|
For finding the size of the node.
Reimplemented from Node. Definition at line 558 of file chapter.cpp. 00559 { 00560 return (sizeof(Chapter)); 00561 }
|
|
For finding if a node is a chapter node.
Reimplemented from Node. Definition at line 575 of file chapter.cpp. 00576 { 00577 return TRUE; 00578 }
|
|
Polymorphically copies the contents of this node to another.
Reimplemented from NodeRenderablePaper. Definition at line 425 of file chapter.cpp. 00426 { 00427 ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node"); 00428 ENSURE(IS_A(pNodeCopy, Chapter), "PolyCopyNodeContents given wrong dest node type"); 00429 00430 if (IS_A(pNodeCopy, Chapter)) 00431 CopyNodeContents((Chapter*)pNodeCopy); 00432 }
|
|
Reimplemented from Node. Definition at line 280 of file chapter.cpp.
|
|
For setting the X coordinate of the chapters fold line, and enabling/disabling the display of the fold line (for single page spreads the fold line is disabled).
After setting this value, you'll need to redraw the document appropriately
Definition at line 330 of file chapter.cpp. 00331 { 00332 FoldLineXCoord = value; 00333 ShowFoldLine = DisplayFoldLine; 00334 }
|
|
To determine if the chapter fold line is intended to be displayed.
Definition at line 354 of file chapter.cpp. 00355 { 00356 return(ShowFoldLine); 00357 }
|
|
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 404 of file chapter.cpp. 00405 { 00406 Chapter* NodeCopy; 00407 NodeCopy = new Chapter(); 00408 ERRORIF(NodeCopy == NULL, _R(IDE_NOMORE_MEMORY), NULL); 00409 CopyNodeContents(NodeCopy); 00410 return (NodeCopy); 00411 }
|
|
Begin to write out you child records, in the native format.
Reimplemented from Node. Definition at line 684 of file chapter.cpp. 00685 { 00686 return Node::WriteBeginChildRecordsNative(pFilter); 00687 }
|
|
Begins the child record sequence for chapter in the web format.
Reimplemented from Node. Definition at line 654 of file chapter.cpp. 00655 { 00656 return TRUE; 00657 }
|
|
Finished writing out you child records, in the native format.
Reimplemented from Node. Definition at line 689 of file chapter.cpp. 00690 { 00691 return Node::WriteEndChildRecordsNative(pFilter); 00692 }
|
|
Ends the child record sequence for chapter in the web format.
Reimplemented from Node. Definition at line 677 of file chapter.cpp. 00678 { 00679 return TRUE; 00680 }
|
|
Writes out a chapter record. > virtual BOOL Chapter::WritePreChildrenWeb(BaseCamelotFilter* pFilter)
Reimplemented from Node. Definition at line 617 of file chapter.cpp. 00618 { 00619 #ifdef DO_EXPORT 00620 BOOL RecordWritten = FALSE; 00621 00622 // Always write out the spread record in native files 00623 CXaraFileRecord Rec(TAG_CHAPTER,TAG_CHAPTER_SIZE); 00624 if (pFilter->Write(&Rec) != 0) 00625 RecordWritten = TRUE; 00626 else 00627 pFilter->GotError(_R(IDE_FILE_WRITE_ERROR)); 00628 00629 return RecordWritten; 00630 #else 00631 return FALSE; 00632 #endif 00633 }
|
|
Web files don't write out a chapter records. > virtual BOOL Chapter::WritePreChildrenWeb(BaseCamelotFilter* pFilter)
Reimplemented from Node. Definition at line 597 of file chapter.cpp. 00598 { 00599 return FALSE; 00600 }
|
|
|
|
|