PrintingRecordHandler Class Reference

Handles importing of the print options records: TAG_PRINTERSETTINGS TAG_IMAGESETTING TAG_COLOURPLATE. More...

#include <rechprnt.h>

Inheritance diagram for PrintingRecordHandler:

CamelotRecordHandler CXaraFileRecordHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 PrintingRecordHandler ()
 ~PrintingRecordHandler ()
virtual BOOL BeginImport ()
 Initialises the record handler ready for importing.
virtual UINT32GetTagList ()
 Provides the record handler system with a list of records handled by this handler.
virtual BOOL HandleRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record.
virtual BOOL BeginSubtree (UINT32 Tag)
 Informs the record handler that a subtree is following a tag of type 'Tag'.
virtual BOOL EndSubtree (UINT32 Tag)
 Informs the record handler that a subtree that followed a tag of type 'Tag' has ended.

Private Member Functions

 CC_DECLARE_DYNAMIC (PrintingRecordHandler)

Private Attributes

PrintComponentpPrintComponent
PrintMarksComponentpPrintMarksComponent

Detailed Description

Handles importing of the print options records: TAG_PRINTERSETTINGS TAG_IMAGESETTING TAG_COLOURPLATE.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/8/96
See also:
PrintComponent

Definition at line 128 of file rechprnt.h.


Constructor & Destructor Documentation

PrintingRecordHandler::PrintingRecordHandler  )  [inline]
 

Definition at line 133 of file rechprnt.h.

PrintingRecordHandler::~PrintingRecordHandler  )  [inline]
 

Definition at line 134 of file rechprnt.h.

00134 {}


Member Function Documentation

BOOL PrintingRecordHandler::BeginImport  )  [virtual]
 

Initialises the record handler ready for importing.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/8/96
Returns:
TRUE if ok FALSE otherwise

Reimplemented from CXaraFileRecordHandler.

Definition at line 132 of file rechprnt.cpp.

00133 {
00134 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
00135     pPrintComponent = GetPrintComponent();
00136 
00137     // Let's not faff around for the print marks component - just find it for ourselves
00138     Document *ScopeDoc = GetDocument();
00139     if (ScopeDoc != NULL)
00140     {
00141         pPrintMarksComponent = (PrintMarksComponent *)
00142                             ScopeDoc->GetDocComponent(CC_RUNTIME_CLASS(PrintMarksComponent));
00143     }
00144 
00145     return (pPrintComponent != NULL && pPrintMarksComponent != NULL);
00146 #else
00147     return TRUE;
00148 #endif
00149 }

BOOL PrintingRecordHandler::BeginSubtree UINT32  Tag  )  [virtual]
 

Informs the record handler that a subtree is following a tag of type 'Tag'.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/9/96
Parameters:
Tag = tag value of the tag this handler last handled [INPUTS]
Returns:
TRUE if this func wants exclusive handling of the tag FALSE otherwise
If you override this func and you do not wish other parts of the system to be informed of the subtree start, you should return TRUE

Reimplemented from CXaraFileRecordHandler.

Definition at line 264 of file rechprnt.cpp.

00265 {
00266     // We only want to know about following subtrees when doing custom print mark records.
00267     // If we are doing one, then we grab the subtree so nobody else can faff about with it
00268     if (Tag != TAG_PRINTMARKCUSTOM)
00269         return(FALSE);
00270 
00271     return(TRUE);
00272 }

PrintingRecordHandler::CC_DECLARE_DYNAMIC PrintingRecordHandler   )  [private]
 

BOOL PrintingRecordHandler::EndSubtree UINT32  Tag  )  [virtual]
 

Informs the record handler that a subtree that followed a tag of type 'Tag' has ended.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/9/96
Parameters:
Tag = tag value of the tag this handler last handled [INPUTS]
Returns:
TRUE if this func wants exclusive handling of the tag FALSE otherwise
If you override this func and you do not wish other parts of the system to be informed of the subtree end, you should return TRUE

Reimplemented from CXaraFileRecordHandler.

Definition at line 294 of file rechprnt.cpp.

00295 {
00296     // We only want to know about following subtrees when doing custom print mark records.
00297     // If we are doing one, then we grab the subtree so nobody else can faff about with it
00298     if (Tag != TAG_PRINTMARKCUSTOM)
00299         return(FALSE);
00300 
00301 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
00302     // OK, it is the end of a custom print mark record, so complete the import
00303     if (pPrintMarksComponent && !IsImporting())
00304         pPrintMarksComponent->EndImportCustomPrintMark(this);
00305 #endif
00306     
00307     return(TRUE);
00308 }

UINT32 * PrintingRecordHandler::GetTagList  )  [virtual]
 

Provides the record handler system with a list of records handled by this handler.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/5/96
Returns:
Ptr to a list of tag values, terminated by CXFRH_TAG_LIST_END

Implements CXaraFileRecordHandler.

Definition at line 166 of file rechprnt.cpp.

00167 {
00168     static UINT32 TagList[] =
00169     {
00170         TAG_PRINTERSETTINGS,
00171         TAG_IMAGESETTING,
00172         TAG_COLOURPLATE,
00173         TAG_PRINTMARKDEFAULT,
00174         TAG_PRINTMARKCUSTOM,
00175         CXFRH_TAG_LIST_END
00176     };
00177 
00178     return(TagList);
00179 }

BOOL PrintingRecordHandler::HandleRecord CXaraFileRecord pCXaraFileRecord  )  [virtual]
 

Handles the given record.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/5/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise

Implements CXaraFileRecordHandler.

Definition at line 199 of file rechprnt.cpp.

00200 {
00201     ERROR2IF(pCXaraFileRecord == NULL, FALSE, "PrintingRecordHandler::HandleRecord pCXaraFileRecord is NULL");
00202 
00203 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
00204     // When we're "opening" a file, we load, but if we're "importing" then we ignore all
00205     // printing options from the imported file (we don't want to override the existing
00206     // settings when you import into a different document)
00207     if (IsImporting())
00208         return(TRUE);
00209 
00210     switch (pCXaraFileRecord->GetTag())
00211     {
00212         case TAG_PRINTERSETTINGS:
00213             if (pPrintComponent)
00214                 pPrintComponent->ImportPrintSettings(pCXaraFileRecord);
00215             break;
00216 
00217         case TAG_IMAGESETTING:
00218             if (pPrintComponent)
00219                 pPrintComponent->ImportImagesetting(pCXaraFileRecord);
00220             break;
00221 
00222         case TAG_COLOURPLATE:
00223             if (pPrintComponent)
00224                 pPrintComponent->ImportColourPlate(pCXaraFileRecord, this);
00225             break;
00226 
00227         case TAG_PRINTMARKDEFAULT:
00228             if (pPrintMarksComponent)
00229                 pPrintMarksComponent->ImportDefaultPrintMark(pCXaraFileRecord);
00230             break;
00231 
00232         case TAG_PRINTMARKCUSTOM:
00233             if (pPrintMarksComponent)
00234                 pPrintMarksComponent->StartImportCustomPrintMark(this, pCXaraFileRecord);
00235             break;
00236 
00237         default:
00238             ERROR3_PF(("PrintingRecordHandler::HandleRecord doesn't handle records with the tag (%d)\n",pCXaraFileRecord->GetTag()));
00239             return(FALSE);
00240     }
00241 #endif
00242     return(TRUE);
00243 }


Member Data Documentation

PrintComponent* PrintingRecordHandler::pPrintComponent [private]
 

Definition at line 151 of file rechprnt.h.

PrintMarksComponent* PrintingRecordHandler::pPrintMarksComponent [private]
 

Definition at line 152 of file rechprnt.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:00:01 2007 for Camelot by  doxygen 1.4.4