DocInfoComponentClass Class Reference

Provide a class that will add document information components to new documents. More...

#include <infocomp.h>

Inheritance diagram for DocInfoComponentClass:

DocComponentClass ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

BOOL AddComponent (BaseDocument *)
 Add a unit list component to the specified document.

Static Public Member Functions

static BOOL Init ()
 Register the unit list document component with the main application.

Detailed Description

Provide a class that will add document information components to new documents.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/07/96
See also:
DocComponentClass

Definition at line 120 of file infocomp.h.


Member Function Documentation

BOOL DocInfoComponentClass::AddComponent BaseDocument pDocument  )  [virtual]
 

Add a unit list component to the specified document.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/7/96
Parameters:
pDocument - the document to add the unit list to. [INPUTS]
Returns:
TRUE if the unit list was added ok; FALSE if not.

Errors: Out of memory

See also:
DocInfoComponentClass

Implements DocComponentClass.

Definition at line 179 of file infocomp.cpp.

00180 {
00181     // Check to see if this document already has a colour list; if so, leave it alone.
00182     if (pDocument->GetDocComponent(CC_RUNTIME_CLASS(DocInfoComponent)) != NULL)
00183         return TRUE;
00184 
00185     // Ok - create the colour list component using this list.
00186     DocInfoComponent *pComponent = new DocInfoComponent();
00187     if (pComponent == NULL)
00188     {
00189         // Out of memory...
00190         return FALSE;
00191     }
00192 
00193     // All ok - add the component to the document.
00194     pDocument->AddDocComponent(pComponent);
00195     return TRUE;
00196 }

DocComponent BOOL DocInfoComponentClass::Init void   )  [static]
 

Register the unit list document component with the main application.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/7/96
Returns:
TRUE if all went well; FALSE if not.

Errors: Out of memory.

See also:
DocComponent

Reimplemented from SimpleCCObject.

Definition at line 149 of file infocomp.cpp.

00150 {
00151     // Instantiate a component class to register with the application.
00152     DocInfoComponentClass *pClass = new DocInfoComponentClass;
00153     if (pClass == NULL)
00154         return FALSE;
00155 
00156     // Register it
00157     GetApplication()->RegisterDocComponent(pClass);
00158 
00159     // All ok
00160     return TRUE;
00161 }


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