ColourRecordHandler Class Reference

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

#include <rechcol.h>

Inheritance diagram for ColourRecordHandler:

CamelotRecordHandler CXaraFileRecordHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ColourRecordHandler ()
 ~ColourRecordHandler ()
virtual BOOL BeginImport ()
 Initialises the colour 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

ColourListComponentpColComponent

Private Member Functions

 CC_DECLARE_DYNAMIC (ColourRecordHandler)

Detailed Description

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

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/5/96
See also:
ColourDocComponent;

Definition at line 125 of file rechcol.h.


Constructor & Destructor Documentation

ColourRecordHandler::ColourRecordHandler  )  [inline]
 

Definition at line 131 of file rechcol.h.

ColourRecordHandler::~ColourRecordHandler  )  [inline]
 

Definition at line 132 of file rechcol.h.

00132 {}


Member Function Documentation

BOOL ColourRecordHandler::BeginImport  )  [virtual]
 

Initialises the colour record handler.

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

Errors: -

See also:
-

Reimplemented from CXaraFileRecordHandler.

Definition at line 134 of file rechcol.cpp.

00135 {
00136     pColComponent = GetColourDocComponent();
00137 
00138     return (pColComponent != NULL);
00139 }

ColourRecordHandler::CC_DECLARE_DYNAMIC ColourRecordHandler   )  [private]
 

UINT32 * ColourRecordHandler::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:
29/5/96
Parameters:
- [INPUTS]
Returns:
Ptr to a list of tag values, terminated by CXFRH_TAG_LIST_END
See also:
-

Implements CXaraFileRecordHandler.

Definition at line 155 of file rechcol.cpp.

00156 {
00157     static UINT32 TagList[] = {TAG_DEFINERGBCOLOUR,TAG_DEFINECOMPLEXCOLOUR,CXFRH_TAG_LIST_END};
00158 
00159     return (UINT32*)&TagList;
00160 }

BOOL ColourRecordHandler::HandleRecord CXaraFileRecord pCXaraFileRecord  )  [virtual]
 

Handles the given record.

Author:
Neville_Humphrys (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
See also:
-

Implements CXaraFileRecordHandler.

Definition at line 176 of file rechcol.cpp.

00177 {
00178     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"ColourRecordHandler::HandleRecord pCXaraFileRecord is NULL");
00179 
00180     BOOL ok = TRUE;
00181 
00182     switch (pCXaraFileRecord->GetTag())
00183     {
00184         case TAG_DEFINERGBCOLOUR:
00185             // Ask the colour document component class to import that colour for us
00186             if (pColComponent)
00187                 ok = pColComponent->ImportSimpleColour(pCXaraFileRecord);
00188             else
00189                 ERROR3("ColourRecordHandler::HandleRecord no pColComponent");
00190             break;
00191         case TAG_DEFINECOMPLEXCOLOUR:
00192             // Ask the colour document component class to import that colour for us
00193             if (pColComponent)
00194                 ok = pColComponent->ImportColourDefinition(pCXaraFileRecord);
00195             else
00196                 ERROR3("ColourRecordHandler::HandleRecord no pColComponent");
00197             break;
00198 
00199         default:
00200             ok = FALSE;
00201             ERROR3_PF(("ColourRecordHandler::HandleRecord I don't handle records with the tag (%d)\n",pCXaraFileRecord->GetTag()));
00202             break;
00203     }
00204 
00205     return ok;
00206 }


Member Data Documentation

ColourListComponent* ColourRecordHandler::pColComponent [protected]
 

Definition at line 150 of file rechcol.h.


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