#include <prnmks.h>
Inheritance diagram for PrintMarkItem:
Public Member Functions | |
PrintMarkItem () | |
Construct a new print mark item. | |
~PrintMarkItem () | |
destruct a print mark item | |
NodeGroup * | GetMarkGlyph () const |
UINT32 | GetHandle () const |
PrintMark * | GetPrintMark () |
INT32 | GetWidth () const |
INT32 | GetHeight () const |
DocCoord | GetOrigin () const |
MarkOrient | GetOrient () const |
BOOL | DefaultsToOn () const |
BOOL | NeedsSaving () const |
BOOL | NeedsToRender () const |
Private Member Functions | |
CC_DECLARE_DYNCREATE (PrintMarkItem) | |
void | RemoveMark () |
Remove the cached mark from our list structure. This is generally called when the mark item is destroyed. | |
void | SetType (MarkType type) |
void | SetHandle (UINT32 hndle) |
BOOL | SetMarkGlyph (NodeGroup *pMark, BOOL MakeCopy=FALSE) |
Cache a print mark in this print mark item. The mark pointer should be a group held in the document tree. As we attempt to make attributes complete on this group, it has to be in the tree. MakeCopy which defaults to FALSE will, when TRUE, copy the entire group and used the copy, hence it will leave the document unaffected. When FALSE the group will be extracted from the tree. This is only acceptable in a few circumstances when undo is not being generated. | |
void | SetSaveable (BOOL state) |
void | SetRenderable (BOOL state) |
Private Attributes | |
UINT32 | Handle |
PrintMark | Mark |
NodeGroup * | pMarkGlyph |
BOOL | Saveable |
BOOL | Renderable |
Friends | |
class | PrintMarksCache |
Definition at line 345 of file prnmks.h.
|
Construct a new print mark item.
Definition at line 492 of file prnmks.cpp. 00493 { 00494 pMarkGlyph = NULL; 00495 Handle = 0; 00496 Saveable = TRUE; 00497 Renderable = TRUE; 00498 }
|
|
destruct a print mark item
Definition at line 511 of file prnmks.cpp. 00512 { 00513 RemoveMark(); 00514 }
|
|
|
|
Definition at line 671 of file prnmks.cpp. 00672 { 00673 return Mark.DefaultsToOn(); 00674 }
|
|
Definition at line 356 of file prnmks.h. 00356 { return Handle; }
|
|
Definition at line 644 of file prnmks.cpp. 00645 { 00646 if (pMarkGlyph!=NULL) 00647 { 00648 DocRect bounds = pMarkGlyph->GetBoundingRect(); 00649 return bounds.Height(); 00650 } 00651 return 0; 00652 }
|
|
Definition at line 355 of file prnmks.h. 00355 { return pMarkGlyph; }
|
|
Definition at line 665 of file prnmks.cpp. 00666 { 00667 return Mark.GetOrientation(); 00668 }
|
|
Definition at line 654 of file prnmks.cpp. 00655 { 00656 if (pMarkGlyph!=NULL) 00657 { 00658 DocRect bounds = pMarkGlyph->GetBoundingRect(); 00659 return bounds.lo; 00660 } 00661 return DocCoord(0,0); 00662 }
|
|
Definition at line 357 of file prnmks.h. 00357 { return &Mark; }
|
|
Definition at line 634 of file prnmks.cpp. 00635 { 00636 if (pMarkGlyph!=NULL) 00637 { 00638 DocRect bounds = pMarkGlyph->GetBoundingRect(); 00639 return bounds.Width(); 00640 } 00641 return 0; 00642 }
|
|
Definition at line 677 of file prnmks.cpp. 00678 { 00679 return Saveable; 00680 }
|
|
Definition at line 688 of file prnmks.cpp. 00689 { 00690 return Renderable; 00691 }
|
|
Remove the cached mark from our list structure. This is generally called when the mark item is destroyed.
Definition at line 620 of file prnmks.cpp. 00621 { 00622 // check to see if we have a sub tree here 00623 if (pMarkGlyph!=NULL) 00624 { 00625 Node* pNode = pMarkGlyph->FindFirstChild(); 00626 if (pNode!=NULL) 00627 pMarkGlyph->DeleteChildren(pNode); 00628 } 00629 delete pMarkGlyph; 00630 pMarkGlyph = NULL; 00631 }
|
|
Definition at line 370 of file prnmks.h. 00370 { Handle=hndle; }
|
|
Cache a print mark in this print mark item. The mark pointer should be a group held in the document tree. As we attempt to make attributes complete on this group, it has to be in the tree. MakeCopy which defaults to FALSE will, when TRUE, copy the entire group and used the copy, hence it will leave the document unaffected. When FALSE the group will be extracted from the tree. This is only acceptable in a few circumstances when undo is not being generated. BOOL PrintMarkItem::SetMarkGlyph(NodeGroup* pNewMark, BOOL MakeCopy=FALSE)
Definition at line 540 of file prnmks.cpp. 00541 { 00542 ERROR2IF(pNewMark==NULL,FALSE, "NULL mark pointer passed to SetMark"); 00543 00544 if (MakeCopy) 00545 { 00546 NodeGroup* pNewGroup = new NodeGroup; 00547 if (pNewGroup==NULL) 00548 return FALSE; 00549 00550 NodeGroup* pNewGroup1 = new NodeGroup; 00551 if (pNewGroup1==NULL) 00552 { 00553 delete pNewGroup; 00554 return FALSE; 00555 } 00556 00557 // attach this new group to the tree 00558 pNewGroup->AttachNode(pNewMark,NEXT); 00559 pNewGroup1->AttachNode(pNewGroup,FIRSTCHILD); 00560 00561 // copy the children across to this new group 00562 if (!pNewMark->CopyChildrenTo(pNewGroup1)) 00563 { 00564 // CascadeDelete unlinks the node from the tree so don't panic. 00565 pNewGroup->CascadeDelete(); 00566 delete pNewGroup; 00567 return FALSE; 00568 } 00569 00570 // make sure we have all the attributes we're gonna need 00571 if (!pNewGroup->MakeAttributeComplete(NULL,TRUE,NULL,TRUE)) 00572 { 00573 pNewGroup->CascadeDelete(); 00574 delete pNewGroup; 00575 return FALSE; 00576 } 00577 00578 // dump the tree out 00579 //TRACEUSER( "Mike", _T("Dumping subtree contents\n\n")); 00580 //DebugTreeDlg::DumpSubTree(pNewGroup); 00581 00582 // rip the node out of the tree and stick it in our cache. 00583 pNewGroup->UnlinkNodeFromTree(); 00584 00585 // Make sure we get rid of any previously cached mark 00586 if (pMarkGlyph!=NULL) 00587 RemoveMark(); 00588 00589 pMarkGlyph = pNewGroup; 00590 } 00591 else 00592 { 00593 if (!pNewMark->MakeAttributeComplete(NULL,TRUE,NULL,TRUE)) 00594 return FALSE; 00595 00596 pNewMark->UnlinkNodeFromTree(); 00597 00598 // Make sure we get rid of any previously cached mark 00599 if (pMarkGlyph!=NULL) 00600 RemoveMark(); 00601 00602 pMarkGlyph = pNewMark; 00603 } 00604 00605 return TRUE; 00606 }
|
|
Definition at line 693 of file prnmks.cpp. 00694 { 00695 Renderable = renderstate; 00696 }
|
|
Definition at line 683 of file prnmks.cpp. 00684 { 00685 Saveable = savestate; 00686 }
|
|
Definition at line 369 of file prnmks.h.
|
|
|
|
|
|
|
|
|
|
|
|
|