Extend ValueNode interface for ranged containers.

Add an IsContainerRangeFixed() hook which specifies whether or not
the container in question can only display elements within a fixed
lower/upper bound, i.e. B{Object}List.
This commit is contained in:
Rene Gollent 2013-05-20 18:18:57 -04:00
parent a8e846d0f4
commit 570241e8b7
4 changed files with 19 additions and 0 deletions

View File

@ -70,6 +70,13 @@ ValueNode::IsRangedContainer() const
}
bool
ValueNode::IsContainerRangeFixed() const
{
return false;
}
void
ValueNode::ClearChildren()
{

View File

@ -62,6 +62,10 @@ public:
// node types to allow the upper layers to be aware of this, and to be
// able to request that only a subset of children be created.
virtual bool IsRangedContainer() const;
virtual bool IsContainerRangeFixed() const;
// indicates that the user can't
// arbitrarily go outside of the
// specified/supported range.
virtual void ClearChildren();
virtual status_t CreateChildrenInRange(int32 lowIndex,
int32 highIndex);

View File

@ -330,6 +330,13 @@ BListValueNode::IsRangedContainer() const
}
bool
BListValueNode::IsContainerRangeFixed() const
{
return true;
}
void
BListValueNode::ClearChildren()
{

View File

@ -37,6 +37,7 @@ public:
virtual ValueNodeChild* ChildAt(int32 index) const;
virtual bool IsRangedContainer() const;
virtual bool IsContainerRangeFixed() const;
virtual void ClearChildren();
virtual status_t CreateChildrenInRange(int32 lowIndex,
int32 highIndex);