
string s.
The model's size may be bounded via the ListModel::setMaximumCapacity function. The oldest entry is discarded when the bound is reached.
All modifying operations defined for the model notify the registered listeners of the change.
Public Types | |
| typedef Data::size_type | index |
| typedef ListModelListener * | LPtr |
Public Member Functions | |
| void | add (const std::string &s) |
| adds an item to the model | |
| void | addListModelListener (const LPtr &l) |
| void | clear () |
| removes all items from the model | |
| EventDispatcher () | |
| void | fireEvent (ListModelEvent &e) const |
| notifies all registered listeners | |
| const std::string & | get (const index &pos) const |
| retrieves an item from the model | |
| index | getMaximumCapacity () const |
| retrieves the current maximum capacity | |
| index | getSize () const |
| accesses the number of items in the model | |
| index | indexOf (const std::string &s) const |
searches the model for s | |
| bool | isEmpty () const |
| checks if this model is empty | |
| bool | isMuted () const |
| reflects this dispatcher's muted state. | |
| ListModel (const index &cap=UNBOUNDED) | |
| creates a model with an optional size limit. | |
| void | remove (const index &pos) |
| removes an entry from the model | |
| void | removeListModelListener (const LPtr &l) |
| void | setMaximumCapacity (const index &cap) |
| changes the maximum capacity | |
| void | setMuted (bool mute) |
| mutes or un-mutes the dispatcher | |
Static Public Attributes | |
| static const index | INVALID |
| invalid index constant | |
| static const index | UNBOUNDED |
| constant for a (quasi) unlimited number of entries | |
Protected Member Functions | |
| void | add (const LPtr &l) |
| registers a listener | |
| void | remove (const LPtr &l) |
| de-registers a listener. | |
|
|
|
|
|
|
|
|
creates a model with an optional size limit.
The default maximum capacity i
|
|
|
registers a listener
|
|
|
adds an item to the model
If
|
|
|
|
|
|
removes all items from the model
|
|
|
|
|
|
notifies all registered listeners
The listeners are called in the order in which they were added.
|
|
|
retrieves an item from the model
Note that
|
|
|
retrieves the current maximum capacity
|
|
|
accesses the number of items in the model
|
|
|
searches the model for
|
|
|
checks if this model is empty
|
|
|
reflects this dispatcher's muted state.
|
|
|
de-registers a listener.
This listener will no longer notify
|
|
|
removes an entry from the model
Note that
|
|
|
|
|
|
changes the maximum capacity
If
|
|
|
mutes or un-mutes the dispatcher Muted dispatchers no longer notify their listeners. |
|
|
invalid index constant
|
|
|
constant for a (quasi) unlimited number of entries
|
1.4.3