ViewComponentClass Class Reference

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

#include <viewcomp.h>

Inheritance diagram for ViewComponentClass:

DocComponentClass ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

Provide a class that will add view components to new documents.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/7/96
See also:
DocComponentClass

Definition at line 120 of file viewcomp.h.


Member Function Documentation

BOOL ViewComponentClass::AddComponent BaseDocument pDocument  )  [virtual]
 

Add a view component to the specified document.

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

Errors: Out of memory

See also:
ViewComponentClass

Implements DocComponentClass.

Definition at line 186 of file viewcomp.cpp.

00187 {
00188     // Check to see if this document already has a view component; if so, leave it alone.
00189     if (pDocument->GetDocComponent(CC_RUNTIME_CLASS(ViewComponent)) != NULL)
00190         return TRUE;
00191 
00192     // No view component - try to create a new one for this document.
00193 
00194     // create the view component
00195     ViewComponent *pComponent = new ViewComponent;
00196 
00197     // All ok - add the component to the document.
00198     pDocument->AddDocComponent(pComponent);
00199 
00200     return TRUE;
00201 }

BOOL ViewComponentClass::Init void   )  [static]
 

Register the view document component with the main application.

Author:
Mark_Neves (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 156 of file viewcomp.cpp.

00157 {
00158     // Instantiate a component class to register with the application.
00159     ViewComponentClass *pClass = new ViewComponentClass;
00160     if (pClass == NULL)
00161         return FALSE;
00162 
00163     // Register it
00164     GetApplication()->RegisterDocComponent(pClass);
00165 
00166     // All ok
00167     return TRUE;
00168 }


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