Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::AbstractModel Class Reference

The AbstractModel is a base class for creating your own custom model classes. More...

#include <vcf/ApplicationKit/AbstractModel.h>

Inheritance diagram for VCF::AbstractModel:

VCF::Model VCF::Component VCF::ObjectWithEvents VCF::Object VCF::DefaultListModel VCF::DefaultTableModel VCF::DefaultTextModel VCF::DefaultTreeModel VCF::Document VCF::ToolbarModel List of all members.

Public Member Functions

virtual void addModelValidationHandler (EventHandler *handler)
 Adds a validation listener to the model.
virtual void removeModelValidationHandler (EventHandler *handler)
 removes a validation listener from the model
virtual void addModelHandler (EventHandler *handler)
 Adds a model listener to the model.
virtual void removeModelHandler (EventHandler *handler)
 removes a model listener from the model
virtual void validate ()
 validate the model.
virtual void empty ()
 clears out the model's data

Detailed Description

The AbstractModel is a base class for creating your own custom model classes.

It provides a basic implementation of some of the Model class's methods.

Event Delegates for this class:


Member Function Documentation

virtual void VCF::AbstractModel::addModelHandler EventHandler handler  )  [inline, virtual]
 

Adds a model listener to the model.

Implements VCF::Model.

virtual void VCF::AbstractModel::addModelValidationHandler EventHandler handler  )  [inline, virtual]
 

Adds a validation listener to the model.

Implements VCF::Model.

virtual void VCF::AbstractModel::empty  )  [inline, virtual]
 

clears out the model's data

Implements VCF::Model.

Reimplemented in VCF::DefaultListModel, VCF::DefaultTableModel, VCF::DefaultTextModel, VCF::DefaultTreeModel, and VCF::Document.

virtual void VCF::AbstractModel::removeModelHandler EventHandler handler  )  [inline, virtual]
 

removes a model listener from the model

Implements VCF::Model.

virtual void VCF::AbstractModel::removeModelValidationHandler EventHandler handler  )  [inline, virtual]
 

removes a validation listener from the model

Implements VCF::Model.

virtual void VCF::AbstractModel::validate  )  [inline, virtual]
 

validate the model.

The implementation for this can vary widely, or even be nonexistant for model's that do not require validation. The basic idea is to call all the listeners in the list , passing in a local variable to the onModelValidate() methods of the listener's. The variable is initialized to true, and if it is still true at the end of the listener iterations, then it is safe to apply the changes to the model, other wise the changes are removed.

Implements VCF::Model.

Reimplemented in VCF::DefaultTableModel.


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information