|
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) |