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

VCF::DefaultColumnModel Class Reference

Class DefaultColumnModel documentation. More...

#include <vcf/ApplicationKit/DefaultColumnModel.h>

Inheritance diagram for VCF::DefaultColumnModel:

VCF::ColumnModel VCF::Persistable VCF::Model VCF::Component VCF::ObjectWithEvents VCF::Object List of all members.

Public Member Functions

 DefaultColumnModel ()
virtual ~DefaultColumnModel ()
void init ()
 This is going to be removed from the bext release.
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
virtual void removeListModelHandler (EventHandler *handler)
virtual void addListModelHandler (EventHandler *handler)
virtual void addContentsChangedHandler (EventHandler *handler)
 adds a new handler that is notified whenever the contents of the model change.
virtual void removeContentsChangedHandler (EventHandler *handler)
 removes a handler that was interested in changes to the model.
virtual void addItemAddedHandler (EventHandler *handler)
 adds a new handler that is notified whenever an item is added.
virtual void removeItemAddedHandler (EventHandler *handler)
 removes a handler that was interested in item additions to the model.
virtual void addItemDeletedHandler (EventHandler *handler)
 adds a new handler that is notified whenever an item is removed.
virtual void removeItemDeletedHandler (EventHandler *handler)
 removes a handler that was interested in item deletions to the model.
virtual void deleteItem (ColumnItem *item)
 deletes the item from the model's collection of items.
virtual void deleteItem (const uint32 &index)
 deletes the item from the model's collection of items.
virtual void insertItem (const uint32 &index, ColumnItem *item)
 Inserts an item into the model's collection of items.
virtual void addItem (ColumnItem *item)
 Adds an item into the model's collection of items.
virtual ColumnItemgetItemFromIndex (const uint32 &index)
 Returns the item with the specified index in the model's collection.
virtual Enumerator< ColumnItem * > * getItems ()
 Returns an Enumerator of all the items in the model's collection.
virtual uint32 getCount ()
 returns the number of the items in the model
virtual void saveToStream (OutputStream *stream)
 Write the object to the specified output stream.
virtual void loadFromStream (InputStream *stream)
 Read the object from the specified input stream.

Public Attributes

VCF::Delegate ContentsChanged
 ColumnModel Handlers.
VCF::Delegate ItemAdded
VCF::Delegate ItemDeleted
VCF::Delegate ModelValidate
VCF::Delegate ModelEmptied

Protected Attributes

std::vector< ColumnItem * > columnItems_
EnumeratorContainer< std::vector<
ColumnItem * >, ColumnItem * > 
columnContainer_

Detailed Description

Class DefaultColumnModel documentation.


Constructor & Destructor Documentation

VCF::DefaultColumnModel::DefaultColumnModel  ) 
 

virtual VCF::DefaultColumnModel::~DefaultColumnModel  )  [virtual]
 


Member Function Documentation

virtual void VCF::DefaultColumnModel::addContentsChangedHandler EventHandler handler  )  [inline, virtual]
 

adds a new handler that is notified whenever the contents of the model change.

This can happen anytime an item is added or removed.

Parameters:
EventHandler the handler to add for future notifications

Implements VCF::ColumnModel.

virtual void VCF::DefaultColumnModel::addItem ColumnItem item  )  [virtual]
 

Adds an item into the model's collection of items.

Causes a notification to be sent to all listeners of the models ItemAdded events and the model's ContentsChanged event.

Parameters:
ColumnItem the item to add

Implements VCF::ColumnModel.

virtual void VCF::DefaultColumnModel::addItemAddedHandler EventHandler handler  )  [inline, virtual]
 

adds a new handler that is notified whenever an item is added.

Parameters:
EventHandler the handler to add for future notifications

Implements VCF::ColumnModel.

virtual void VCF::DefaultColumnModel::addItemDeletedHandler EventHandler handler  )  [inline, virtual]
 

adds a new handler that is notified whenever an item is removed.

Parameters:
EventHandler the handler to add for future notifications

Implements VCF::ColumnModel.

virtual void VCF::DefaultColumnModel::addListModelHandler EventHandler handler  )  [inline, virtual]
 

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

Adds a model listener to the model.

Implements VCF::Model.

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

Adds a validation listener to the model.

Implements VCF::Model.

virtual void VCF::DefaultColumnModel::deleteItem const uint32 index  )  [virtual]
 

deletes the item from the model's collection of items.

Causes a notification to be sent to all listeners of the models ItemDeleted events and the model's ContentsChanged event.

Parameters:
uint32 the index of the item to delete.

Implements VCF::ColumnModel.

virtual void VCF::DefaultColumnModel::deleteItem ColumnItem item  )  [virtual]
 

deletes the item from the model's collection of items.

Causes a notification to be sent to all listeners of the models ItemDeleted events and the model's ContentsChanged event.

Parameters:
ColumnItem the item to delete.

Implements VCF::ColumnModel.

virtual void VCF::DefaultColumnModel::empty  )  [virtual]
 

clears out the model's data

Implements VCF::Model.

virtual uint32 VCF::DefaultColumnModel::getCount  )  [virtual]
 

returns the number of the items in the model

Returns:
uint32 the count of items

Implements VCF::ColumnModel.

virtual ColumnItem* VCF::DefaultColumnModel::getItemFromIndex const uint32 index  )  [virtual]
 

Returns the item with the specified index in the model's collection.

Parameters:
uint32 teh index of the requested item to return
Returns:
ColumnItem the item at the position specified in index. This may be NULL if the index is out of bounds, or the model collection is empty

Implements VCF::ColumnModel.

virtual Enumerator<ColumnItem*>* VCF::DefaultColumnModel::getItems  )  [virtual]
 

Returns an Enumerator of all the items in the model's collection.

For example:

		ColumnModel* model = ...

		Enumerator<ColumnItem*>* items = model->getItems();

		while ( true == items->hasMoreElements() ) {
			ColumnItem* item = items->nextElemnt();
do something ...
		}
	
Returns:
Enumerator<ColumnItem*> the enumerator of items. The caller is not responsible for the returned pointer and should not delete it.
See also:
Enumerator

Implements VCF::ColumnModel.

void VCF::DefaultColumnModel::init  ) 
 

This is going to be removed from the bext release.

Deprecated:

Reimplemented from VCF::Object.

virtual void VCF::DefaultColumnModel::insertItem const uint32 index,
ColumnItem item
[virtual]
 

Inserts an item into the model's collection of items.

Causes a notification to be sent to all listeners of the models ItemAdded events and the model's ContentsChanged event.

Parameters:
uint32 the insertion index for the item
ColumnItem the item to insert

Implements VCF::ColumnModel.

virtual void VCF::DefaultColumnModel::loadFromStream InputStream stream  )  [virtual]
 

Read the object from the specified input stream.

Implements VCF::Persistable.

virtual void VCF::DefaultColumnModel::removeContentsChangedHandler EventHandler handler  )  [inline, virtual]
 

removes a handler that was interested in changes to the model.

Parameters:
EventHandler the handler to remove from future notifications

Implements VCF::ColumnModel.

virtual void VCF::DefaultColumnModel::removeItemAddedHandler EventHandler handler  )  [inline, virtual]
 

removes a handler that was interested in item additions to the model.

Parameters:
EventHandler the handler to remove from future notifications

Implements VCF::ColumnModel.

virtual void VCF::DefaultColumnModel::removeItemDeletedHandler EventHandler handler  )  [inline, virtual]
 

removes a handler that was interested in item deletions to the model.

Parameters:
EventHandler the handler to remove from future notifications

Implements VCF::ColumnModel.

virtual void VCF::DefaultColumnModel::removeListModelHandler EventHandler handler  )  [inline, virtual]
 

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

removes a model listener from the model

Implements VCF::Model.

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

removes a validation listener from the model

Implements VCF::Model.

virtual void VCF::DefaultColumnModel::saveToStream OutputStream stream  )  [virtual]
 

Write the object to the specified output stream.

Implements VCF::Persistable.

virtual void VCF::DefaultColumnModel::validate  )  [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.


Member Data Documentation

EnumeratorContainer<std::vector<ColumnItem*>, ColumnItem*> VCF::DefaultColumnModel::columnContainer_ [protected]
 

std::vector<ColumnItem*> VCF::DefaultColumnModel::columnItems_ [protected]
 

VCF::Delegate VCF::DefaultColumnModel::ContentsChanged
 

ColumnModel Handlers.

VCF::Delegate VCF::DefaultColumnModel::ItemAdded
 

VCF::Delegate VCF::DefaultColumnModel::ItemDeleted
 

VCF::Delegate VCF::DefaultColumnModel::ModelEmptied
 

VCF::Delegate VCF::DefaultColumnModel::ModelValidate
 

Event Delegate:
ModelValidate fired when the model's validate() method is called
event class: ValidationEvent
See also:
validate()

Reimplemented from VCF::Model.


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