DocInfoRecordHandler Class Reference

Provide a units record handler for the new native and web file formats. This asks the units document component to import the unit definitions for us. More...

#include <rechinfo.h>

Inheritance diagram for DocInfoRecordHandler:

CamelotRecordHandler CXaraFileRecordHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 DocInfoRecordHandler ()
 ~DocInfoRecordHandler ()
virtual BOOL BeginImport ()
 Initialises the units record handler.
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.

Protected Attributes

DocInfoComponentpInfoComponent

Private Member Functions

 CC_DECLARE_DYNAMIC (DocInfoRecordHandler)

Detailed Description

Provide a units record handler for the new native and web file formats. This asks the units document component to import the unit definitions for us.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/7/96
See also:
UnitListDocComponent;

Definition at line 124 of file rechinfo.h.


Constructor & Destructor Documentation

DocInfoRecordHandler::DocInfoRecordHandler  )  [inline]
 

Definition at line 130 of file rechinfo.h.

00130 : CamelotRecordHandler() {}

DocInfoRecordHandler::~DocInfoRecordHandler  )  [inline]
 

Definition at line 131 of file rechinfo.h.

00131 {}


Member Function Documentation

BOOL DocInfoRecordHandler::BeginImport  )  [virtual]
 

Initialises the units record handler.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/7/96
Parameters:
- [INPUTS]
Returns:
TRUE if ok FALSE otherwise

Errors: -

See also:
-

Reimplemented from CXaraFileRecordHandler.

Definition at line 136 of file rechinfo.cpp.

00137 {
00138     pInfoComponent = GetDocInfoComponent();
00139 
00140     return (pInfoComponent != NULL);
00141 }

DocInfoRecordHandler::CC_DECLARE_DYNAMIC DocInfoRecordHandler   )  [private]
 

UINT32 * DocInfoRecordHandler::GetTagList  )  [virtual]
 

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

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/7/96
Parameters:
- [INPUTS]
Returns:
Ptr to a list of tag values, terminated by CXFRH_TAG_LIST_END
See also:
-

Implements CXaraFileRecordHandler.

Definition at line 157 of file rechinfo.cpp.

00158 {
00159     static UINT32 TagList[] = {TAG_DOCUMENTCOMMENT, TAG_DOCUMENTDATES,
00160                               TAG_DOCUMENTUNDOSIZE,
00161                               TAG_DOCUMENTFLAGS,
00162                               CXFRH_TAG_LIST_END};
00163 
00164     return (UINT32*)&TagList;
00165 }

BOOL DocInfoRecordHandler::HandleRecord CXaraFileRecord pCXaraFileRecord  )  [virtual]
 

Handles the given record.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/7/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
See also:
-

Implements CXaraFileRecordHandler.

Definition at line 181 of file rechinfo.cpp.

00182 {
00183     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"DocInfoRecordHandler::HandleRecord pCXaraFileRecord is NULL");
00184 
00185     BOOL ok = TRUE;
00186     Document * pDoc = GetDocument();
00187     INT32 Tag = pCXaraFileRecord->GetTag();
00188     if (pInfoComponent == NULL)
00189     {
00190         ERROR3("DocInfoRecordHandler::HandleRecord no pInfoComponent");
00191         return FALSE;
00192     }
00193 
00194     // If we are just importing data from this document into an existing one,
00195     // then don't import any of this data.
00196     if (IsImporting())
00197         return TRUE;
00198 
00199     switch (Tag)
00200     {
00201         case TAG_DOCUMENTCOMMENT:
00202             // Ask the document information component class to import that data for us
00203             pInfoComponent->ImportDocumentComment(pCXaraFileRecord, pDoc);
00204             break;
00205 
00206         case TAG_DOCUMENTDATES:
00207             // Ask the document information component class to import that data for us
00208             pInfoComponent->ImportDocumentDates(pCXaraFileRecord, pDoc);
00209             break;
00210 
00211         case TAG_DOCUMENTUNDOSIZE:
00212             // Ask the document information component class to import that data for us
00213             pInfoComponent->ImportUndoBufferSize(pCXaraFileRecord, pDoc);
00214             break;
00215 
00216         case TAG_DOCUMENTFLAGS:
00217             // Ask the document information component class to import that data for us
00218             pInfoComponent->ImportDocumentFlags(pCXaraFileRecord, pDoc);
00219             break;
00220 
00221         default:
00222             ok = FALSE;
00223             ERROR3_PF(("DocInfoRecordHandler::HandleRecord I don't handle records with the tag (%d)\n",Tag));
00224             break;
00225     }
00226 
00227     return ok;
00228 }


Member Data Documentation

DocInfoComponent* DocInfoRecordHandler::pInfoComponent [protected]
 

Definition at line 146 of file rechinfo.h.


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