DocComponent Class Reference

An implementation of an instance of a document component, such as a colour table, or a list of arrowheads. These are the objects that are instantiated for each Document object that exists, and are held in a list in each Document object. More...

#include <doccomp.h>

Inheritance diagram for DocComponent:

ListItem CCObject SimpleCCObject BitmapListComponent ColourListComponent DocInfoComponent FontComponent LineComponent PrintComponent PrintMarksComponent StrokeComponent Styles UnitListComponent ViewComponent List of all members.

Public Member Functions

virtual BOOL StartImport (BaseCamelotFilter *pFilter)
 Add an instance of a document component to the specified document. This function should create a default instance of the relevant DocComponent object for this class, and add it to the document. The function should check to see if one already exists in this document, and either replace it, or leave it alone, depending on the nature of the component.Inform the document component that a Native or Web import is about to start.
virtual BOOL EndImport (BaseCamelotFilter *pFilter, BOOL Success)
 Inform the document component that a Native or Web import has just finished.
virtual BOOL StartExport (BaseCamelotFilter *pFilter)
 Inform the document component that a WEb or Native export is about to start.
virtual BOOL StartExportBeforeComp (BaseCamelotFilter *pFilter)
 Inform the document component that a Web or Native export is about to start.
virtual BOOL EndExport (BaseCamelotFilter *pFilter, BOOL Success)
 Inform the document component that a Web or Native export is just finishing. This gives the component a chance to write out any pending data, such as named colours that weren't referenced in the document, etc.
virtual void CleanUpAfterExport (BOOL Success)
 Inform the document component that a Web or Native export has just finished.
virtual BOOL EPSStartImport (EPSFilter *)
 Inform the document component that an EPS import is about to start.
virtual void EPSEndImport (EPSFilter *, BOOL)
 Inform the document component that an EPS import has just finished.
virtual BOOL EPSStartExport (EPSFilter *)
 Inform the document component that an EPS export is about to start.
virtual void EPSEndExport (EPSFilter *)
 Inform the document component that an EPS export has just finished.
virtual BOOL WriteEPSProlog (EPSFilter *)
 Write out the EPS prolog for this document component, using the EPS filter object supplied. (The base class does nothing).
virtual BOOL WriteEPSSetup (EPSFilter *)
 Write out the EPS setup for this document component, using the EPS filter object supplied. (The base class does nothing).
virtual BOOL WriteEPSComments (EPSFilter *)
 Write out any comments that need to be in the initial batch of EPS comments (i.e. before the %EndComments line), using the specified EPS Filter object. (The base class does nothing).
virtual BOOL WriteScript (EPSFilter *)
 This is called after all the Comments, Prolog etc have been output so that DocComponents get a chance to do something right at the start of the real EPS data, but before the tree starts to be exported. (The base class does nothing).
virtual ProcessEPSResult ProcessEPSComment (EPSFilter *, const TCHAR *)
 Process an EPS comment found in the file, if it 'belongs' to this document component. If it does not, then the document component should return EPSCommentUnknown, and the comment will be passed on to the next document component. If the function returns EPSCommentOK, and the next line in the file starts with "%%+", i.e. an EPS/PostScript continuation comment, then this will be passed to this document component immediately, without trying any of the other document components first. This allows items such a colour lists to be imported easily, as they are usually specified on multiple lines in the file, using "%%+" comments. (The base class does nothing - it returns EPSCommentUnknown).
virtual void EndOfEPSComment (EPSFilter *)
 Informs the document component that the comment it has been decoding has now finished, and it should take whatever action required to act on the comment. This call is made even for single-line comments, because by the nature of DSC comments, it is not known until the next comment starts or a non-comment line is encountered that the comment is over and is not multi-line.
virtual INT32 GetSizeOfExport (Filter *)
 Find out how many nodes will be exported when this document component is exported. The node can use the filter to find out how it will be exported, e.g. bitmap lists should return a value that reflects whether or not bitmap indirection is possible with this filter and so on. NB. This is virtual - the default implementation just returns 1 - only override if this is not accurate.
virtual BOOL StartComponentCopy ()
 This function is called prior to nodes being copied from some Source document to the document where this DocComponent lives. It gives the DocComponent a chance to make preperations for caching any possible updates.
virtual BOOL EndComponentCopy ()
 This function is called after a successful copy from another document. If changes have been made to the components data then now is the time to commit them.
virtual void AbortComponentCopy ()
 This function is called if a node copy has failed. If any changes have been made then they may need to be vaped at this point. Note this function could get called without a prior StartComponentCopy call. Also it could get called more than once.

Detailed Description

An implementation of an instance of a document component, such as a colour table, or a list of arrowheads. These are the objects that are instantiated for each Document object that exists, and are held in a list in each Document object.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/08/94
See also:
DocumentComponentClass

Definition at line 156 of file doccomp.h.


Member Function Documentation

void DocComponent::AbortComponentCopy  )  [virtual]
 

This function is called if a node copy has failed. If any changes have been made then they may need to be vaped at this point. Note this function could get called without a prior StartComponentCopy call. Also it could get called more than once.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/8/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
NodeRenderable::CopyComponentData

DocComponent::EndComponentCopy

DocComponent::StartComponentCopy

Reimplemented in BitmapListComponent, ColourListComponent, and Styles.

Definition at line 644 of file doccomp.cpp.

00644 { }

void DocComponent::CleanUpAfterExport BOOL  Success  )  [virtual]
 

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

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/8/96
Parameters:
Success - True if everything went swimmingly, False if the export failed [INPUTS]
Notes: This is called after EndExport, so that the componenbt can clean up any during-export data structures. This allows situations like: PrintComponent wants to save a colour reference in it's Endxport call, but is called after the ColourComponent EndExport. The ColourComponent EndExport does not delete its data structures, so is still able to supply colour references to other components' EndExport functions.

The base class implementation does nothing

See also:
DocComponent::EndExport

Reimplemented in ColourListComponent.

Definition at line 282 of file doccomp.cpp.

00283 {
00284     // Base class does nothing
00285 }

BOOL DocComponent::EndComponentCopy  )  [virtual]
 

This function is called after a successful copy from another document. If changes have been made to the components data then now is the time to commit them.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/8/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
NodeRenderable::CopyComponentData

DocComponent::StartComponentCopy

DocComponent::AbortComponentCopy

Reimplemented in BitmapListComponent, ColourListComponent, and Styles.

Definition at line 621 of file doccomp.cpp.

00621 { return TRUE; }  

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

Inform the document component that a Web or Native export is just finishing. This gives the component a chance to write out any pending data, such as named colours that weren't referenced in the document, etc.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/5/96
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)
Notes: This saves any pending data (e.g. unreferenced Named colours) but DOES NOT DELETE ANY DATA STRUCTURES - these should be deleted in the CleanUpAfterExport function. This allows situations like: PrintComponent wants to save a colour reference in it's Endxport call, but is called after the ColourComponent EndExport. The ColourComponent EndExport does not delete its data structures, so is still able to supply colour references to other components' EndExport functions.

See also:
DocComponent::StartExport; DocComponent::CleanUpAfterExport

Reimplemented in BitmapListComponent, ColourListComponent, FontComponent, DocInfoComponent, LineComponent, PrintComponent, PrintMarksComponent, StrokeComponent, WizOpStyles, UnitListComponent, and ViewComponent.

Definition at line 252 of file doccomp.cpp.

00253 {
00254     return TRUE;
00255 }

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

Inform the document component that a Native or Web import has just finished.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/5/96
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)
See also:
DocComponent

Reimplemented in BitmapListComponent, ColourListComponent, FontComponent, DocInfoComponent, LineComponent, PrintMarksComponent, StrokeComponent, WizOpStyles, UnitListComponent, and ViewComponent.

Definition at line 177 of file doccomp.cpp.

00178 {
00179     return TRUE;
00180 }

void DocComponent::EndOfEPSComment EPSFilter pFilter  )  [virtual]
 

Informs the document component that the comment it has been decoding has now finished, and it should take whatever action required to act on the comment. This call is made even for single-line comments, because by the nature of DSC comments, it is not known until the next comment starts or a non-comment line is encountered that the comment is over and is not multi-line.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/08/94
Parameters:
pFilter - the EPS filter that is being used to import a file. [INPUTS]
See also:
DocComponent::ProcessEPSComment; DocComponent::WriteEPSProlog; DocComponent::WriteEPSSetup; DocComponent::WriteEPSComments; DocComponent; EPSFilter

Reimplemented in BitmapListComponent, and ColourListComponent.

Definition at line 546 of file doccomp.cpp.

00547 {
00548 }

void DocComponent::EPSEndExport EPSFilter pFilter  )  [virtual]
 

Inform the document component that an EPS export has just finished.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/08/94
Parameters:
pFilter - the EPS filter that is being used to import a file. [INPUTS]
See also:
DocComponent

Reimplemented in BitmapListComponent.

Definition at line 357 of file doccomp.cpp.

00358 {
00359 }

void DocComponent::EPSEndImport EPSFilter pFilter,
BOOL  Success
[virtual]
 

Inform the document component that an EPS import has just finished.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/08/94
Parameters:
pFilter - the EPS filter that is being used to import a file. [INPUTS] Success - TRUE => The import was successful; FALSE => The import failed - abandon any changes.
See also:
DocComponent

Reimplemented in BitmapListComponent, and ColourListComponent.

Definition at line 322 of file doccomp.cpp.

00323 {
00324 }

BOOL DocComponent::EPSStartExport EPSFilter pFilter  )  [virtual]
 

Inform the document component that an EPS export is about to start.

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

Reimplemented in BitmapListComponent.

Definition at line 340 of file doccomp.cpp.

00341 {
00342     return TRUE;
00343 }

BOOL DocComponent::EPSStartImport EPSFilter pFilter  )  [virtual]
 

Inform the document component that an EPS import is about to start.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/08/94
Parameters:
pFilter - the EPS 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 in BitmapListComponent, and ColourListComponent.

Definition at line 303 of file doccomp.cpp.

00304 {
00305     return TRUE;
00306 }

INT32 DocComponent::GetSizeOfExport Filter  )  [virtual]
 

Find out how many nodes will be exported when this document component is exported. The node can use the filter to find out how it will be exported, e.g. bitmap lists should return a value that reflects whether or not bitmap indirection is possible with this filter and so on. NB. This is virtual - the default implementation just returns 1 - only override if this is not accurate.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/01/95
Parameters:
pFilter - the export filter that will be used. [INPUTS]
Returns:
An approximation of the size of data that will be exported by this document component, in terms of nodes. (see NodeRenderable::GetSizeOfExport).
See also:
Node::NeedsToExport; Node::ExportRender; NodeRenderable::GetSizeOfExport

Reimplemented in BitmapListComponent.

Definition at line 571 of file doccomp.cpp.

00572 {
00573     // Default value is one node...
00574     return 1;
00575 }

ProcessEPSResult DocComponent::ProcessEPSComment EPSFilter pFilter,
const TCHAR pComment
[virtual]
 

Process an EPS comment found in the file, if it 'belongs' to this document component. If it does not, then the document component should return EPSCommentUnknown, and the comment will be passed on to the next document component. If the function returns EPSCommentOK, and the next line in the file starts with "%%+", i.e. an EPS/PostScript continuation comment, then this will be passed to this document component immediately, without trying any of the other document components first. This allows items such a colour lists to be imported easily, as they are usually specified on multiple lines in the file, using "%%+" comments. (The base class does nothing - it returns EPSCommentUnknown).

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/08/94
Parameters:
pFilter - the EPS filter that is being used to import a file. [INPUTS] pComment - read only buffer containing the whole EPS comment to parse.
Returns:
EPSCommentUnknown - This EPS comment is not recognised by the document component. EPSCommentError - This EPS comment was recognised by this document component, but it contained an error. EPSCommentSystemError - This EPS comment was recognised by this document component, but an error occured that was not caused directly by the comment, e.g. out of memory. EPSCommentOK - This EPS comment was recognised as a legal comment by this document component, and was processed successfully.
See also:
DocComponent::EndOfEPSComment; DocComponent::WriteEPSProlog; DocComponent::WriteEPSSetup; DocComponent::WriteEPSComments; DocComponent; ProcessEPSResult; EPSFIlter

Reimplemented in BitmapListComponent, and PrintComponent.

Definition at line 516 of file doccomp.cpp.

00518 {
00519     return EPSCommentUnknown;
00520 }

BOOL DocComponent::StartComponentCopy  )  [virtual]
 

This function is called prior to nodes being copied from some Source document to the document where this DocComponent lives. It gives the DocComponent a chance to make preperations for caching any possible updates.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/8/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
FALSE if we run out of memory

Errors: -

See also:
NodeRenderable::CopyComponentData

DocComponent::EndComponentCopy

DocComponent::AbortComponentCopy

Reimplemented in BitmapListComponent, ColourListComponent, and Styles.

Definition at line 599 of file doccomp.cpp.

00599 { return TRUE;}

BOOL DocComponent::StartExport BaseCamelotFilter pFilter  )  [virtual]
 

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

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/5/96
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 in BitmapListComponent, BrushComponent, ColourListComponent, FontComponent, DocInfoComponent, LineComponent, PrintMarksComponent, StrokeComponent, WizOpStyles, UnitListComponent, and ViewComponent.

Definition at line 219 of file doccomp.cpp.

00220 {
00221     return TRUE;
00222 }

BOOL DocComponent::StartExportBeforeComp BaseCamelotFilter pFilter  )  [virtual]
 

Inform the document component that a Web or Native export is about to start.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/7/96
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]
This is called before zlib compression is turned on, to give the doc component a chance to write out uncompressed records.

See also:
DocComponent

Reimplemented in DocInfoComponent.

Definition at line 200 of file doccomp.cpp.

00201 {
00202     return TRUE;
00203 }

BOOL DocComponent::StartImport BaseCamelotFilter pFilter  )  [virtual]
 

Add an instance of a document component to the specified document. This function should create a default instance of the relevant DocComponent object for this class, and add it to the document. The function should check to see if one already exists in this document, and either replace it, or leave it alone, depending on the nature of the component.Inform the document component that a Native or Web import is about to start.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/5/96
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 in BitmapListComponent, ColourListComponent, FontComponent, DocInfoComponent, LineComponent, PrintMarksComponent, StrokeComponent, WizOpStyles, UnitListComponent, and ViewComponent.

Definition at line 156 of file doccomp.cpp.

00157 {
00158     return TRUE;
00159 }

BOOL DocComponent::WriteEPSComments EPSFilter pFilter  )  [virtual]
 

Write out any comments that need to be in the initial batch of EPS comments (i.e. before the %EndComments line), using the specified EPS Filter object. (The base class does nothing).

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/08/94
Parameters:
pFilter - the EPS filter that is being used to export a file. [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the Prolog for this component was written out successfully; FALSE if not (e.g. out of disk space etc)
See also:
DocComponent::WriteEPSSetup; DocComponent::WriteEPSProlog; DocComponent::ProcessEPSComment; DocComponent; EPSFIlter

Reimplemented in BitmapListComponent, ColourListComponent, and PrintComponent.

Definition at line 440 of file doccomp.cpp.

00441 {
00442     return TRUE;
00443 }

BOOL DocComponent::WriteEPSProlog EPSFilter pFilter  )  [virtual]
 

Write out the EPS prolog for this document component, using the EPS filter object supplied. (The base class does nothing).

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/08/94
Parameters:
pFilter - the EPS filter that is being used to export a file. [INPUTS]
Returns:
TRUE if the Prolog for this component was written out successfully; FALSE if not (e.g. out of disk space etc)
See also:
DocComponent::WriteEPSSetup; DocComponent::WriteEPSComments; DocComponent::ProcessEPSComment; DocComponent; EPSFilter

Definition at line 383 of file doccomp.cpp.

00384 {
00385     return TRUE;
00386 }

BOOL DocComponent::WriteEPSSetup EPSFilter pFilter  )  [virtual]
 

Write out the EPS setup for this document component, using the EPS filter object supplied. (The base class does nothing).

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/08/94
Parameters:
pFilter - the EPS filter that is being used to export a file. [INPUTS]
Returns:
TRUE if the Prolog for this component was written out successfully; FALSE if not (e.g. out of disk space etc)
See also:
DocComponent::WriteEPSProlog; DocComponent::WriteEPSComments; DocComponent::ProcessEPSComment; DocComponent; EPSFilter

Definition at line 410 of file doccomp.cpp.

00411 {
00412     return TRUE;
00413 }

BOOL DocComponent::WriteScript EPSFilter pFilter  )  [virtual]
 

This is called after all the Comments, Prolog etc have been output so that DocComponents get a chance to do something right at the start of the real EPS data, but before the tree starts to be exported. (The base class does nothing).

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/1/95
Parameters:
pFilter - the EPS filter that is being used to export a file. [INPUTS]
Returns:
TRUE if the Script for this component was written out successfully; FALSE if not (e.g. out of disk space etc)
See also:
DocComponent::WriteEPSSetup; DocComponent::WriteEPSProlog; DocComponent::ProcessEPSComment; DocComponent; EPSFIlter

Reimplemented in BitmapListComponent.

Definition at line 468 of file doccomp.cpp.

00469 {
00470     return TRUE;
00471 }


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