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

VCF::TreeModel Class Reference

#include <vcf/ApplicationKit/TreeModel.h>

Inheritance diagram for VCF::TreeModel:

VCF::Model VCF::Component VCF::ObjectWithCallbacks VCF::Object VCF::DefaultTreeModel VCF::TreeListModel List of all members.

Public Types

typedef TreeModelKey Key
enum  { RootKey = 0, InvalidKey = (uint32)-1 }
enum  TreeModelEvents {
  TREE_MODEL_CONST = Model::MODEL_LAST_EVENT + 2000, ContentsDeleted = CUSTOM_EVENT_TYPES + TREE_MODEL_CONST + 1, ItemChanged, ItemAdded,
  ItemRemoved, ItemMoved, ChildItemsRemoved, SubItemAdded,
  SubItemRemoved, SubItemChanged
}

Public Member Functions

NodeRemoved TreeModel ()
virtual ~TreeModel ()
virtual bool isEmpty ()
 Returns whether or not the model has an data.
Key insert (const VariantData &value, const Key &parentKey=RootKey)
 inserts some data at the specified parentKey value.
void remove (const Key &key)
 removes any data associated with the key and any children as well
virtual VariantData get (const Key &key)=0
 Returns the variant data for the specified key.
virtual String getAsString (const Key &key)
 Returns the value associated with the key as a string.
void set (const Key &key, const VariantData &value)
 Sets the value at the specified key.
virtual void setAsString (const Key &key, const String &value)
 Sets the value at the specified key.
bool copy (const Key &srcKey, const Key &destKey, bool deepCopy=false)
 Copies the value at the source key, and copies (or inserts if need be) the value to the destination key.
bool move (const Key &srcKey, const Key &destParentKey)
 Moves the data at src key (removing it) and inserts it at the new parent key.
void clearChildren (const Key &key)
virtual bool getChildren (const Key &key, std::vector< Key > &children)=0
 Returns true if any children are found for the specified key.
virtual Key getParent (const Key &key)=0
 Get the parent key for the specified key.
virtual Key getNextSibling (const Key &key)=0
 Get the next sibling for the specified key.
virtual Key getPrevSibling (const Key &key)=0
virtual Key getFirstChild (const Key &key)=0
virtual bool isLeaf (const Key &key)=0
 Identifies whether or not the key is a "leaf".
virtual uint32 getCount ()=0
 Returns the number of keys in this model.
virtual uint32 getChildCount (const Key &key)=0
 Returns the number of child keys contained in the specified key.
virtual bool supportsSubItems ()
void insertSubItem (const Key &key, const uint32 &subItemIndex, const VariantData &value)
void removeSubItem (const Key &key, const uint32 &subItemIndex)
virtual VariantData getSubItem (const Key &key, const uint32 &subItemIndex)
virtual String getSubItemAsString (const Key &key, const uint32 &subItemIndex)
void setSubItem (const Key &key, const uint32 &subItemIndex, const VariantData &value)
virtual void setSubItemAsString (const Key &key, const uint32 &subItemIndex, const String &value)
virtual uint32 getSubItemsCount (const Key &key)
virtual bool getSubItems (const Key &key, std::vector< VariantData > &items)

Public Attributes

VCF::Delegate TreeModelDelegate
NodeAdded VCF::Delegate TreeModelDelegate

Protected Member Functions

virtual Key doInsert (const VariantData &value, const Key &parentKey=RootKey)
virtual Key doRemove (const Key &key)
virtual bool doClearChildren (const Key &key)
virtual bool doSet (const Key &key, const VariantData &value)
virtual Key doCopy (const Key &srcKey, const Key &destKey, bool deepCopy=false)
virtual Key doMove (const Key &srcKey, const Key &destParentKey)
virtual bool doInsertSubItem (const Key &key, const uint32 &subItemIndex, const VariantData &value)
virtual bool doRemoveSubItem (const Key &key, const uint32 &subItemIndex)
virtual bool doSetSubItem (const Key &key, const uint32 &subItemIndex, const VariantData &value)
void notifyItemRemoved (const Key &key, const Key &parentKey)
void notifySubItemRemoved (const Key &key, const uint32 &subItemIndex)
void notifySubItemAdded (const Key &key, const uint32 &subItemIndex)

Member Typedef Documentation

typedef TreeModelKey VCF::TreeModel::Key
 


Member Enumeration Documentation

anonymous enum
 

Enumerator:
RootKey 
InvalidKey 

enum VCF::TreeModel::TreeModelEvents
 

Enumerator:
TREE_MODEL_CONST 
ContentsDeleted 
ItemChanged 
ItemAdded 
ItemRemoved 
ItemMoved 
ChildItemsRemoved 
SubItemAdded 
SubItemRemoved 
SubItemChanged 


Constructor & Destructor Documentation

NodeRemoved VCF::TreeModel::TreeModel  )  [inline]
 

virtual VCF::TreeModel::~TreeModel  )  [inline, virtual]
 


Member Function Documentation

void VCF::TreeModel::clearChildren const Key key  ) 
 

bool VCF::TreeModel::copy const Key srcKey,
const Key destKey,
bool  deepCopy = false
 

Copies the value at the source key, and copies (or inserts if need be) the value to the destination key.

If deepCopy is true then any children associated with the src key are copied as well.

virtual bool VCF::TreeModel::doClearChildren const Key key  )  [inline, protected, virtual]
 

virtual Key VCF::TreeModel::doCopy const Key srcKey,
const Key destKey,
bool  deepCopy = false
[inline, protected, virtual]
 

virtual Key VCF::TreeModel::doInsert const VariantData value,
const Key parentKey = RootKey
[inline, protected, virtual]
 

virtual bool VCF::TreeModel::doInsertSubItem const Key key,
const uint32 subItemIndex,
const VariantData value
[inline, protected, virtual]
 

virtual Key VCF::TreeModel::doMove const Key srcKey,
const Key destParentKey
[inline, protected, virtual]
 

virtual Key VCF::TreeModel::doRemove const Key key  )  [inline, protected, virtual]
 

virtual bool VCF::TreeModel::doRemoveSubItem const Key key,
const uint32 subItemIndex
[inline, protected, virtual]
 

virtual bool VCF::TreeModel::doSet const Key key,
const VariantData value
[inline, protected, virtual]
 

virtual bool VCF::TreeModel::doSetSubItem const Key key,
const uint32 subItemIndex,
const VariantData value
[inline, protected, virtual]
 

virtual VariantData VCF::TreeModel::get const Key key  )  [pure virtual]
 

Returns the variant data for the specified key.

virtual String VCF::TreeModel::getAsString const Key key  )  [inline, virtual]
 

Returns the value associated with the key as a string.

virtual uint32 VCF::TreeModel::getChildCount const Key key  )  [pure virtual]
 

Returns the number of child keys contained in the specified key.

virtual bool VCF::TreeModel::getChildren const Key key,
std::vector< Key > &  children
[pure virtual]
 

Returns true if any children are found for the specified key.

Any children will be stored as keys in the passed in vector.

virtual uint32 VCF::TreeModel::getCount  )  [pure virtual]
 

Returns the number of keys in this model.

Implemented in VCF::DefaultTreeModel.

virtual Key VCF::TreeModel::getFirstChild const Key key  )  [pure virtual]
 

virtual Key VCF::TreeModel::getNextSibling const Key key  )  [pure virtual]
 

Get the next sibling for the specified key.

If no sibling is found the return value of the key is TreeModel::InvalidKey

virtual Key VCF::TreeModel::getParent const Key key  )  [pure virtual]
 

Get the parent key for the specified key.

virtual Key VCF::TreeModel::getPrevSibling const Key key  )  [pure virtual]
 

virtual VariantData VCF::TreeModel::getSubItem const Key key,
const uint32 subItemIndex
[inline, virtual]
 

virtual String VCF::TreeModel::getSubItemAsString const Key key,
const uint32 subItemIndex
[inline, virtual]
 

virtual bool VCF::TreeModel::getSubItems const Key key,
std::vector< VariantData > &  items
[inline, virtual]
 

virtual uint32 VCF::TreeModel::getSubItemsCount const Key key  )  [inline, virtual]
 

Key VCF::TreeModel::insert const VariantData value,
const Key parentKey = RootKey
 

inserts some data at the specified parentKey value.

The specified key value is the "parent" of the value. The return value is the key that's directly associated with the data value.

void VCF::TreeModel::insertSubItem const Key key,
const uint32 subItemIndex,
const VariantData value
 

virtual bool VCF::TreeModel::isEmpty  )  [inline, virtual]
 

Returns whether or not the model has an data.

The default is true, since in it's abstract form the model doesn't (yet) have any data associated it. It is up to implementers to return something meaningful here.

Reimplemented from VCF::Model.

virtual bool VCF::TreeModel::isLeaf const Key key  )  [pure virtual]
 

Identifies whether or not the key is a "leaf".

A "leaf" is a key that has no children.

bool VCF::TreeModel::move const Key srcKey,
const Key destParentKey
 

Moves the data at src key (removing it) and inserts it at the new parent key.

void VCF::TreeModel::notifyItemRemoved const Key key,
const Key parentKey
[inline, protected]
 

void VCF::TreeModel::notifySubItemAdded const Key key,
const uint32 subItemIndex
[inline, protected]
 

void VCF::TreeModel::notifySubItemRemoved const Key key,
const uint32 subItemIndex
[inline, protected]
 

void VCF::TreeModel::remove const Key key  ) 
 

removes any data associated with the key and any children as well

void VCF::TreeModel::removeSubItem const Key key,
const uint32 subItemIndex
 

void VCF::TreeModel::set const Key key,
const VariantData value
 

Sets the value at the specified key.

virtual void VCF::TreeModel::setAsString const Key key,
const String value
[inline, virtual]
 

Sets the value at the specified key.

The string value is converted to a variant.

void VCF::TreeModel::setSubItem const Key key,
const uint32 subItemIndex,
const VariantData value
 

virtual void VCF::TreeModel::setSubItemAsString const Key key,
const uint32 subItemIndex,
const String value
[inline, virtual]
 

virtual bool VCF::TreeModel::supportsSubItems  )  [inline, virtual]
 


Member Data Documentation

NodeAdded VCF::Delegate VCF::TreeModel::TreeModelDelegate
 

Event Delegate:
NodeRemoved
event class:

VCF::Delegate VCF::TreeModel::TreeModelDelegate
 

Event Delegate:
NodeAdded
event class:


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