#include <ItemListPropertyHandler.hpp>
Public Member Functions | |
void | acceptVisitor (PropertyHandlerVisitor *visitor) override |
bool | addNewItemOfType (string type) |
bool | addValue (Item *value) |
vector< Item * > | children () const override |
void | insertNames () override |
bool | insertNewItemOfType (int index, string type) |
bool | insertValue (int index, Item *value) |
bool | removeValueAt (int index) |
int | retrieveSelectedRow () |
void | setToEmpty () |
void | storeSelectedRow (int row) |
vector< Item * > | value () const |
![]() | |
vector< string > | allowedAndDisplayedDescendants () |
string | baseType () const |
string | defaultType () const |
bool | isCompound () const override |
bool | isValidValue (string value) const override |
PropertyHandler (const PropertyHandler &)=delete | |
PropertyHandler (Item *target, const PropertyDef *property, const SchemaDef *schema, NameManager *nameMgr) | |
![]() | |
PropertyHandler (const PropertyHandler &)=delete | |
PropertyHandler (Item *target, const PropertyDef *property, const SchemaDef *schema, NameManager *nameMgr) | |
virtual | ~PropertyHandler ()=default |
virtual void | acceptVisitor (PropertyHandlerVisitor *visitor)=0 |
virtual vector< Item * > | children () const |
bool | hasChanged () const |
bool | hasDefaultValue () const |
virtual void | insertNames ()=0 |
virtual bool | isCompound () const |
bool | isConfigured () |
bool | isConfiguredByUser () |
bool | isDisplayed () const |
bool | isRelevant () const |
bool | isRequired () const |
bool | isSilent () const |
virtual bool | isValidValue (string value) const =0 |
string | name () const |
NameManager * | nameManager () const |
PropertyHandler & | operator= (const PropertyHandler &)=delete |
void | rebuildNames () |
Item * | root () const |
const SchemaDef * | schema () const |
void | setConfiguredByUser (bool valid=true) |
void | setConfiguredToDefault () |
void | setNotConfigured () |
string | title () const |
string | type () const |
Additional Inherited Members | |
![]() | |
const PropertyDef * | property () const |
void | setChanged () |
Item * | target () const |
This class handles SMILE data item properties of type "list of pointer to item".
|
overridevirtual |
Accepts the specified visitor. This function is part of the "visitor" design pattern implementation used to handle properties of various types.
Implements PropertyHandler.
bool ItemListPropertyHandler::addNewItemOfType | ( | string | type | ) |
Constructs a new item instance of the specified type and adds it to the list held by the handled property in the target item. The target item assumes ownership of the new instance. The function returns false if a new item couldn't be added (e.g. because the specified type is inappropriate).
bool ItemListPropertyHandler::addValue | ( | Item * | value | ) |
Adds the specified item to the list held by the handled property in the target item. The target item assumes ownership of the specified instance. The function returns false if the item couldn't be added (e.g. because it has an inappropriate type).
|
overridevirtual |
Returns a list of SMILE data items including the immediate children of the target item in the dataset in which the target item resides. The implementation in this class returns the result of the value() function.
Reimplemented from PropertyHandler.
|
overridevirtual |
Causes the name manager associated with this handler to insert names into the global and/or local name sets corresponding to the current value of the target property. For item list properties, the function inserts the target property's name if the current property value is a nonempty list (i.e. including at least one item), and does not insert any names if the value is the empty list. In addition, the function inserts the names provided in the conditional expression of the "insert" attribute of the target property, if any.
Furthermore, for each of the items in the current property value, the function inserts the name of the item's type and of all its ancestor types, recursively. In addition, it inserts the names provided in the conditional expression of the "insert" attribute of these types, if any.
Implements PropertyHandler.
bool ItemListPropertyHandler::insertNewItemOfType | ( | int | index, |
string | type | ||
) |
Constructs a new instance of the specified type and inserts it at the specified index into the list held by the handled property in the target item. The target item assumes ownership of the new instance. The function returns false if a new item couldn't be added (e.g. because the specified item type is inappropriate).
bool ItemListPropertyHandler::insertValue | ( | int | index, |
Item * | value | ||
) |
Inserts the specified item at the specified index into the list held by the handled property in the target item. The target item assumes ownership of the specified instance. The function returns false if the item couldn't be added (e.g. because it has an inappropriate type).
bool ItemListPropertyHandler::removeValueAt | ( | int | index | ) |
Removes the item with the specified zero-based index from the list held by the handled property in the target item. The removed item is deleted. The function returns false if the item couldn't be removed (e.g. because the index is out of range).
int ItemListPropertyHandler::retrieveSelectedRow | ( | ) |
This function returns the stored selected row index for the handled property in the target item. If the selected row index has never been stored for this property and item, the function returns zero.
void ItemListPropertyHandler::setToEmpty | ( | ) |
Empties the list held by the handled property in the target item, removing any previously owned item instances.
void ItemListPropertyHandler::storeSelectedRow | ( | int | row | ) |
This function stores the selected row index for the handled property in the target item to the specified integer value.
vector< Item * > ItemListPropertyHandler::value | ( | ) | const |
Returns the value of the handled property in the target item.