#include <rechunit.h>
Inheritance diagram for UnitsRecordHandler:
Public Member Functions | |
UnitsRecordHandler () | |
~UnitsRecordHandler () | |
virtual BOOL | BeginImport () |
Initialises the units record handler. | |
virtual UINT32 * | GetTagList () |
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 | |
UnitListComponent * | pUnitsComponent |
Private Member Functions | |
CC_DECLARE_DYNAMIC (UnitsRecordHandler) |
Definition at line 124 of file rechunit.h.
|
Definition at line 130 of file rechunit.h. 00130 : CamelotRecordHandler() {}
|
|
Definition at line 131 of file rechunit.h.
|
|
Initialises the units record handler.
Reimplemented from CXaraFileRecordHandler. Definition at line 135 of file rechunit.cpp. 00136 { 00137 pUnitsComponent = GetUnitDocComponent(); 00138 00139 return (pUnitsComponent != NULL); 00140 }
|
|
|
|
Provides the record handler system with a list of records handled by this handler.
Implements CXaraFileRecordHandler. Definition at line 156 of file rechunit.cpp. 00157 { 00158 static UINT32 TagList[] = {TAG_DEFINE_PREFIXUSERUNIT, TAG_DEFINE_SUFFIXUSERUNIT, 00159 TAG_DEFINE_DEFAULTUNITS, 00160 CXFRH_TAG_LIST_END}; 00161 00162 return (UINT32*)&TagList; 00163 }
|
|
Handles the given record.
Implements CXaraFileRecordHandler. Definition at line 179 of file rechunit.cpp. 00180 { 00181 // WEBSTER - markn 17/12/96 00182 // No unit record handling needed 00183 #ifdef WEBSTER 00184 return TRUE; 00185 #else 00186 ERROR2IF(pCXaraFileRecord == NULL,FALSE,"UnitsRecordHandler::HandleRecord pCXaraFileRecord is NULL"); 00187 00188 BOOL ok = TRUE; 00189 Document * pDoc = GetDocument(); 00190 INT32 Tag = pCXaraFileRecord->GetTag(); 00191 switch (Tag) 00192 { 00193 case TAG_DEFINE_DEFAULTUNITS: 00194 // Ask the units document component class to import those default display units for us 00195 // If we are just importing data from this document into an existing one, 00196 // then don't import this data. 00197 if (IsImporting()) 00198 break; 00199 if (pUnitsComponent) 00200 pUnitsComponent->ImportDefaultDisplayUnits(pCXaraFileRecord, pDoc); 00201 else 00202 ERROR3("UnitsRecordHandler::HandleRecord no pUnitsComponent"); 00203 break; 00204 case TAG_DEFINE_PREFIXUSERUNIT: 00205 case TAG_DEFINE_SUFFIXUSERUNIT: 00206 // Ask the units document component class to import this user unit definition for us 00207 if (pUnitsComponent) 00208 pUnitsComponent->ImportUserUnitDefinition(pCXaraFileRecord, pDoc, Tag); 00209 else 00210 ERROR3("UnitsRecordHandler::HandleRecord no pUnitsComponent"); 00211 break; 00212 00213 default: 00214 ok = FALSE; 00215 ERROR3_PF(("UnitsRecordHandler::HandleRecord I don't handle records with the tag (%d)\n",pCXaraFileRecord->GetTag())); 00216 break; 00217 } 00218 00219 return ok; 00220 #endif // WEBSTER 00221 }
|
|
Definition at line 147 of file rechunit.h. |