Contents

What is fGUI ?

fGUI basics
The factory
Event model
Legal Issues
Things to do
History

Tree of classes
About

The classes

fApplication
fClassInfo
fColor
fGroup
fObject
fPoint

The flexible GUI: fClassInfo

Declared in: fGUI/fClassInfo.h

Library: fGUI.so


Overview

fClassInfo is the base for most other classes in fGUI. It provides information about the class, its name, the name of the baseclass and has methods to query if the object is of a certain type or if that type is in its inheritance hierarchy.


Derived Classes

Nearly all classes are derived from fClassInfo. Have a look at the Tree of classes for a complete list.

The functionality for the interface that fClassInfo provides has to be rewritten in every derived class. To make that easier two sets of macros have been created: ClassDeclaration and ClassDefinition for concrete clases and VirtualClassDeclaration and VirtualClassDefinition for abstract classes. (see fDefines.h and the header file of any class derived from fClassInfo for more details on this). The macros for the concrete classes also register the class with the factory.

Note: Because in concrete derived classes the createInstance() method calls the constructor without arguments all classes must have a constructor that takes no arguments.


Constructor and Destructor


fClassInfo()

	fClassInfo( void)
Because fClassInfo is a virtual class this constructor cannot be called directly and does nothing.


~fClassInfo()

	virtual ~fClassInfo( void)
The destructor of fClassInfo is empty.


Member Functions


createInstance()

	virtual fClassInfo *createInstance( void) const = 0
Returns an instance of that class. As fClassInfo is a virtual class the method is declared true virtual. This method returns an instance of that class in concrete derived classes. This is used by the fFactory class to create new objects by name.


getClassName()

	virtual const char * const getClassName( void) const
Returns a pointer to the classes name.


getBaseClassName()

	virtual const char * const getBaseClassName( void) const
Returns a pointer to the name of the base class. This method returns NULL in fClassInfo as it does not have a superclass.


isOfClass()

	virtual bool isOfClass( const char *ClassName) const
Returns true if the class is of type ClassName, false otherwise.


isOfType()

	virtual bool isOfType( const char *ClassName) const
Returns true if the class is of type ClassName or if one of its superclasses is of that type and false otherwise.


The flexible GUI, in HTML for the BeOS Release 3.

Copyright © 1997-1998 Stegemann & Co. All rights reserved.

Last modified May 19, 1998.