WizOpStyles Class Reference

Provide a component that allows us to save out the information for this document using the serialisation facilities of the DocComponent base class. More...

#include <styles.h>

Inheritance diagram for WizOpStyles:

Styles DocComponent ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 WizOpStyles ()
virtual BOOL StartImport (BaseCamelotFilter *pFilter)
 Inform the colour list document component that a Native or Web import is about to start.
virtual BOOL EndImport (BaseCamelotFilter *pFilter, BOOL Success)
 Inform the component that a Native or Web import has just finished. Calls EndCopyComponent(q.v).
WizOpStyleFindStyleFromRecordReference (XFileRef RecordRef) const
 In between StartImport & EndImport this function is called by WizOpStyleRefRecordHandler::HandleRecord so it knows which WizOpStyle to use for its StyleRefAttribute.
BOOL SetRecordHandler (WizOpStyleRecordHandler &RecordHandler)
WizOpStyleRecordHandlerGetRecordHandler () const
virtual BOOL StartExport (BaseCamelotFilter *pFilter)
 Inform the colour list document component that a WEb or Native export is about to start.
virtual BOOL EndExport (BaseCamelotFilter *pFilter, BOOL Success)
 Inform the colour list document component that a Web or Native export has just finished.
virtual XFileRef GetRecordRefForStyle (const WizOpStyle &Style)
 Writes out a WizOpStyle record.

Private Attributes

WizOpStyleRecordHandlerm_pImporter

Detailed Description

Provide a component that allows us to save out the information for this document using the serialisation facilities of the DocComponent base class.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/07/96
See also:
DocComponent

Definition at line 307 of file styles.h.


Constructor & Destructor Documentation

WizOpStyles::WizOpStyles  )  [inline]
 

Definition at line 312 of file styles.h.

00312 {}


Member Function Documentation

BOOL WizOpStyles::EndExport BaseCamelotFilter pFilter,
BOOL  Success
[virtual]
 

Inform the colour list document component that a Web or Native export has just finished.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/07/97
Parameters:
pFilter - the BaseCamelotFilter filter that is being used to import a file. [INPUTS] Success - True if everything went swimmingly, False if just a clean up is required.
Returns:
TRUE if the component was able to end the importing; FALSE if not (e.g. out of memory)
See also:
DocComponent

Reimplemented from DocComponent.

Definition at line 1246 of file styles.cpp.

01247 {
01248 #ifdef DO_EXPORT
01249     ENSURE_NOT_NULL(pFilter);
01250     ENSURE_NOT_NULL(m_pCurrentExporter);
01251 
01252     delete m_pCurrentExporter;
01253     m_pCurrentExporter = NULL;
01254 
01255     return TRUE;
01256 #endif      
01257     return TRUE;
01258 }

BOOL WizOpStyles::EndImport BaseCamelotFilter pFilter,
BOOL  Success
[virtual]
 

Inform the component that a Native or Web import has just finished. Calls EndCopyComponent(q.v).

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/07/97
Parameters:
pFilter - the BaseCamelotFilter filter that is being used to import a file. [INPUTS] Success - TRUE => The import was successful; FALSE => The import failed - abandon any changes.
Returns:
TRUE if the component was able to end the importing; FALSE if not (e.g. out of memory)

Reimplemented from DocComponent.

Definition at line 1126 of file styles.cpp.

01127 {
01128     ENSURE_NOT_NULL(pFilter);
01129 
01130     BOOL Ok = EndComponentCopy();
01131 
01132     m_pImporter = NULL;
01133 
01134     return Ok;
01135 }

WizOpStyle * WizOpStyles::FindStyleFromRecordReference XFileRef  RecordRef  )  const
 

In between StartImport & EndImport this function is called by WizOpStyleRefRecordHandler::HandleRecord so it knows which WizOpStyle to use for its StyleRefAttribute.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/07/97

Definition at line 1103 of file styles.cpp.

01104 {
01105     return GetRecordHandler().FindStyleFromRecordReference(RecordRef);
01106 }

WizOpStyleRecordHandler & WizOpStyles::GetRecordHandler  )  const
 

Definition at line 1150 of file styles.cpp.

01151 {
01152     // This static dummy object is used for returning in the ERROR2 case
01153     // The original used to return a ptr to a local variable, which is a tad dangerous.
01154     // This solution is not ideal, because there's a permanent instance of an object
01155     // that will probably never be used.
01156     static WizOpStyleRecordHandler Dummy;
01157 
01158     ERROR2IF(m_pImporter == NULL, Dummy, "NULL Member");
01159 
01160     return *m_pImporter;
01161 }

XFileRef WizOpStyles::GetRecordRefForStyle const WizOpStyle Style  )  [virtual]
 

Writes out a WizOpStyle record.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/07/97
Parameters:
Style - The document colour to save [INPUTS]
Returns:
A record reference to be used for the style. This will be zero if a problem has occurred.
Notes: In the process of getting a record reference for the style the style itself may be written to the record stream. As this does save information, it MUST* be called before the caller has called StartRecord() as otherwise the records will become intertwined!

Definition at line 1215 of file styles.cpp.

01216 {
01217 #ifdef DO_EXPORT
01218     // We should only be here after a StartExport
01219     ENSURE_NOT_NULL(m_pCurrentExporter);
01220 
01221     INT32 RecordNumber = m_pCurrentExporter->WriteStyle(Style);
01222     
01223     return RecordNumber;
01224 #endif
01225     return 0L;
01226 }

BOOL WizOpStyles::SetRecordHandler WizOpStyleRecordHandler RecordHandler  ) 
 

Definition at line 1138 of file styles.cpp.

01139 {
01140 #ifdef _DEBUG
01141     /*Styles& ThisShouldWork =*/ GetStylesToAdd();      // there should be some styles that we can add to
01142 #endif
01143 
01144     m_pImporter = &RecordHandler;
01145 
01146     return TRUE;
01147 }

BOOL WizOpStyles::StartExport BaseCamelotFilter pFilter  )  [virtual]
 

Inform the colour list document component that a WEb or Native export is about to start.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/07/97
Returns:
TRUE if the component was able to prepare for exporting; FALSE if not (e.g. out of memory)
Parameters:
pFilter - the BaseCamelotFilter filter that is being used to export a file. [INPUTS]
See also:
DocComponent

Reimplemented from DocComponent.

Definition at line 1178 of file styles.cpp.

01179 {
01180 #ifdef DO_EXPORT
01181     ENSURE_NOT_NULL(pFilter);
01182 
01183     // We don't support multi-threading
01184     ERROR2IF(m_pCurrentExporter != NULL, FALSE, "Current exporter already exists");
01185 
01186     // Create an exporter for the styles
01187     m_pCurrentExporter = new StylesExporter(*this, *pFilter);
01188     if (m_pCurrentExporter == NULL)
01189         return FALSE;
01190 #endif
01191     return TRUE;
01192 }

BOOL WizOpStyles::StartImport BaseCamelotFilter pFilter  )  [virtual]
 

Inform the colour list document component that a Native or Web import is about to start.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/07/97
Parameters:
pFilter - the BaseCamelotFilter filter that is being used to import a file. [INPUTS]
Returns:
TRUE if the component was able to prepare for importing; FALSE if not (e.g. out of memory)
See also:
DocComponent

Reimplemented from DocComponent.

Definition at line 1080 of file styles.cpp.

01081 {
01082     ENSURE_NOT_NULL(pFilter);
01083 
01084     BOOL Ok = StartComponentCopy();
01085 
01086     return Ok;
01087 }


Member Data Documentation

WizOpStyleRecordHandler* WizOpStyles::m_pImporter [private]
 

Definition at line 331 of file styles.h.


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