VCF::Model Class Reference
A Model is the base class for storing data for a control or other visual elements. More...
#include <vcf/ApplicationKit/Model.h>
Inheritance diagram for VCF::Model:

Public Types | |
| enum | ModelEvents { MODEL_CHANGED = 2000, MODEL_VALIDATED, MODEL_EMPTIED, MODEL_LAST_EVENT } |
Public Member Functions | |
| Model () | |
| virtual | ~Model () |
| virtual void | addModelValidationHandler (EventHandler *handler)=0 |
| Adds a validation listener to the model. | |
| virtual void | removeModelValidationHandler (EventHandler *handler)=0 |
| removes a validation listener from the model | |
| virtual void | validate ()=0 |
| validate the model. | |
| virtual void | addModelHandler (EventHandler *handler)=0 |
| Adds a model listener to the model. | |
| virtual void | removeModelHandler (EventHandler *handler)=0 |
| removes a model listener from the model | |
| virtual void | empty ()=0 |
| clears out the model's data | |
| virtual void | addView (View *view) |
| adds a new view to the model | |
| virtual void | removeView (View *view) |
| removes a view from the model | |
| virtual void | updateAllViews () |
| notifies all the views the model has changed calls View::updateView( ), passing itself in as the updated Model | |
| Enumerator< View * > * | getViews () |
| void | changed (ModelEvent *event) |
Public Attributes | |
| VCF::Delegate | ModelChanged |
| VCF::Delegate | ModelValidate |
Protected Attributes | |
| std::vector< View * > | views_ |
| EnumeratorContainer< std::vector< View * >, View * > | viewContainer_ |
Detailed Description
A Model is the base class for storing data for a control or other visual elements.
Member Enumeration Documentation
|
|
|
Constructor & Destructor Documentation
|
|
|
|
|
|
Member Function Documentation
|
|
Adds a model listener to the model.
Implemented in VCF::AbstractModel, VCF::DefaultColumnModel, and VCF::DefaultTabModel. |
|
|
Adds a validation listener to the model.
Implemented in VCF::AbstractModel, VCF::DefaultColumnModel, and VCF::DefaultTabModel. |
|
|
adds a new view to the model
|
|
|
|
|
|
clears out the model's data
Implemented in VCF::AbstractModel, VCF::DefaultColumnModel, VCF::DefaultListModel, VCF::DefaultTableModel, VCF::DefaultTabModel, VCF::DefaultTextModel, VCF::DefaultTreeModel, and VCF::Document. |
|
|
|
|
|
removes a model listener from the model
Implemented in VCF::AbstractModel, VCF::DefaultColumnModel, and VCF::DefaultTabModel. |
|
|
removes a validation listener from the model
Implemented in VCF::AbstractModel, VCF::DefaultColumnModel, and VCF::DefaultTabModel. |
|
|
removes a view from the model
|
|
|
notifies all the views the model has changed calls View::updateView( ), passing itself in as the updated Model
|
|
|
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. Implemented in VCF::AbstractModel, VCF::DefaultColumnModel, VCF::DefaultTableModel, and VCF::DefaultTabModel. |
Member Data Documentation
|
|
|
|
|
Reimplemented in VCF::DefaultColumnModel, and VCF::DefaultTabModel. |
|
|
|
|
|
|
The documentation for this class was generated from the following file:
- vcf/ApplicationKit/Model.h
