OpApplyGlobalAffect Class Reference

An operation to scan all objects in all documents, calling a user defined function to perform a none undoable operation on them. More...

#include <textops.h>

Inheritance diagram for OpApplyGlobalAffect:

Operation MessageHandler ListItem CCObject SimpleCCObject OpAffectFontChange List of all members.

Protected Member Functions

void DoAffectChange (ObjChangeParam *pObjChange, Document *pSearchDoc=NULL)
 Scans through all object nodes of all object trees in all documents, passing the user object change parameter to every node it comes accross. The tree scans are depth first. This is a useful operation for other ops to derive themselves off.
virtual void AffectNode (Document *, Node *, ObjChangeParam *)
 This function checks for text story nodes. If the entry node is one, the node will be reformated and redrawn.

Private Member Functions

 CC_DECLARE_DYNCREATE (OpApplyGlobalAffect)

Detailed Description

An operation to scan all objects in all documents, calling a user defined function to perform a none undoable operation on them.

class CCAPI OpAffectFontChange : public Operation

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/01/96

Definition at line 992 of file textops.h.


Member Function Documentation

void OpApplyGlobalAffect::AffectNode Document pDocument,
Node pNode,
ObjChangeParam pObjChange
[protected, virtual]
 

This function checks for text story nodes. If the entry node is one, the node will be reformated and redrawn.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/01/96
Parameters:
pDocument = a pointer to the document currently being scanned [INPUTS] pNode = a pointer to the node the scan is at (going up the tree) pObjChange = a pointer to a user change parameter

Reimplemented in OpAffectFontChange.

Definition at line 6102 of file textops.cpp.

06103 {
06104 }

OpApplyGlobalAffect::CC_DECLARE_DYNCREATE OpApplyGlobalAffect   )  [private]
 

void OpApplyGlobalAffect::DoAffectChange ObjChangeParam pObjChange,
Document pSearchDoc = NULL
[protected]
 

Scans through all object nodes of all object trees in all documents, passing the user object change parameter to every node it comes accross. The tree scans are depth first. This is a useful operation for other ops to derive themselves off.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/01/96
Parameters:
pObjChange = a pointer to a user change parameter [INPUTS]

Definition at line 6022 of file textops.cpp.

06023 {
06024     // Get a pointer to the StartDocument 
06025     ERROR3IF(pObjChange == NULL, "DoAffectChange called with a NULL pObjChange param");
06026     if (pObjChange==NULL)
06027         return;
06028 
06029     Document* pDocument = pSearchDoc;
06030     if (!pDocument)
06031         pDocument = (Document*) Camelot.Documents.GetHead();
06032 
06033 #if !defined(EXCLUDE_FROM_RALPH)
06034     // render blobs off (only in selected doc)
06035     if (Camelot.FindSelection()!=NULL)
06036     {
06037         Node* SelNode = Camelot.FindSelection()->FindFirst();
06038         if (SelNode!=NULL)
06039         {
06040             Spread* SelSpread = (Spread*)SelNode->FindParent(CC_RUNTIME_CLASS(Spread));
06041             if (SelSpread!=NULL)
06042                 Camelot.GetBlobManager()->RenderOff(NULL, SelSpread);
06043         }
06044     }
06045 #endif
06046 
06047     // scan through all documents
06048     while (pDocument != NULL)
06049     {
06050         // Get a pointer to first node
06051         Node* pNode = Node::DocFindFirstDepthFirst(pDocument);
06052         // Scan through the tree, on a depth first traversal affecting all nodes.
06053         while (pNode != NULL)
06054         {
06055             AffectNode(pDocument, pNode, pObjChange);
06056             // Move onto the next node in the tree
06057             pNode = pNode->DocFindNextDepthFirst(); 
06058         }
06059         // make sure we update all of this document
06060         pDocument->FlushRedraw();
06061         
06062         if (pSearchDoc==NULL)
06063             pDocument = (Document*) Camelot.Documents.GetNext(pDocument);
06064         else
06065             pDocument = NULL;
06066     }
06067 
06068     // Now for the important bit, make sure we update all the changed nodes.
06069     pObjChange->Define(OBJCHANGE_FINISHED,pObjChange->GetChangeFlags(),NULL,NULL);
06070     UpdateAllChangedNodes(pObjChange);
06071 
06072 #if !defined(EXCLUDE_FROM_RALPH)
06073     // render blobs back on again!
06074     if (Camelot.FindSelection()!=NULL)
06075     {
06076         Node* SelNode = Camelot.FindSelection()->FindFirst();
06077         if (SelNode!=NULL)
06078         {
06079             Spread* SelSpread = (Spread*)SelNode->FindParent(CC_RUNTIME_CLASS(Spread));
06080             if (SelSpread!=NULL)
06081                 Camelot.GetBlobManager()->RenderOff(NULL, SelSpread);
06082         }
06083     }
06084 #endif
06085 }


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