FontComponentClass Class Reference

The document font componentA class that will add Font Components to new documents. More...

#include <fontcomp.h>

Inheritance diagram for FontComponentClass:

DocComponentClass ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

BOOL AddComponent (BaseDocument *pDoc)
 Adds a font component to the specified document See Also: class FontComponent.

Static Public Member Functions

static BOOL Init ()
 Registers the font component with the main application See Also: class DocComponentClass.

Detailed Description

The document font componentA class that will add Font Components to new documents.

Author:
Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/08/96 Base Class: DocComponentClass
See also:
class DocComponentClass, class FontComponent

Definition at line 123 of file fontcomp.h.


Member Function Documentation

BOOL FontComponentClass::AddComponent BaseDocument pDoc  )  [virtual]
 

Adds a font component to the specified document See Also: class FontComponent.

Author:
Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/08/96
Parameters:
pDoc - pointer to the document to which we add a component to [INPUTS]
Returns:
TRUE if successful, FALSE otherwise

Implements DocComponentClass.

Definition at line 294 of file fontcomp.cpp.

00295 {
00296     // check to see if this document already has a font component, if so we leave it alone
00297     if (pDoc->GetDocComponent(CC_RUNTIME_CLASS(FontComponent)) != NULL)
00298     {
00299         return TRUE;
00300     }
00301     else
00302     {
00303         // no document component - try to create one for this document
00304         FontComponent *pFontComponent = new FontComponent;
00305 
00306         // now add this to the document
00307         pDoc->AddDocComponent(pFontComponent);
00308 
00309         // success!
00310         return TRUE;
00311     }
00312 }

BOOL FontComponentClass::Init void   )  [static]
 

Registers the font component with the main application See Also: class DocComponentClass.

Author:
Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/08/96
Parameters:
- [INPUTS]
Returns:
TRUE if successful, FALSE otherwise

Reimplemented from SimpleCCObject.

Definition at line 266 of file fontcomp.cpp.

00267 {
00268     // Instantiate a component class to register with the application
00269     FontComponentClass *pClass = new FontComponentClass;
00270     if (pClass==NULL)
00271     {
00272         return FALSE;
00273     }
00274     else
00275     {
00276         GetApplication()->RegisterDocComponent(pClass);
00277         return TRUE;
00278     }
00279 }


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