
A text model may or may not contain some higher form of structure. Also, it may accept all input text or reject or convert all or part of the strings passed to TextModel::insert function. Changes to the model may be monitored via the TextModelListener interface.
Public Types | |
| typedef std::string::size_type | index |
| typedef TextModelListener * | LPtr |
Public Member Functions | |
| void | addTextModelListener (const LPtr &l) |
| EventDispatcher () | |
| void | fireEvent (TextModelEvent &e) const |
| notifies all registered listeners | |
| virtual std::string | getText (const index &from=0, const index &to=std::string::npos) const =0 |
retrieves the stored data from from, inclusively to to, exclusively | |
| virtual std::string | insert (const std::string &s, const index &pos)=0 |
| inserts the given text into the model | |
| bool | isMuted () const |
| reflects this dispatcher's muted state. | |
| virtual void | remove (const index &from, const index &to)=0 |
removes the content from from, inclusively to to, exclusively | |
| void | removeTextModelListener (const LPtr &l) |
| void | setMuted (bool mute) |
| mutes or un-mutes the dispatcher | |
| virtual | ~TextModel () |
Protected Member Functions | |
| void | add (const LPtr &l) |
| registers a listener | |
| void | remove (const LPtr &l) |
| de-registers a listener. | |
|
|
|
|
|
|
|
|
|
|
|
registers a listener
|
|
|
|
|
|
|
|
|
notifies all registered listeners
The listeners are called in the order in which they were added.
|
|
||||||||||||
|
retrieves the stored data from If called without parameters, this function returns the complete text.
|
|
||||||||||||
|
inserts the given text into the model
Implementations may reject, modify or simply insert
|
|
|
reflects this dispatcher's muted state.
|
|
|
de-registers a listener.
This listener will no longer notify
|
|
||||||||||||
|
removes the content from
|
|
|
|
|
|
mutes or un-mutes the dispatcher Muted dispatchers no longer notify their listeners. |
1.4.3