
TextModel implementation that handles a plain text string
The Traits template argument may be used to modify the inserted string. That class must have a legalize function that converts the input string into an accepted one.
| Traits | the text acceptance policy. The default is AcceptAll which accepts any input passed to it. |
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 | |
| std::string | getText (const index &, const index &) const |
| virtual std::string | insert (const std::string &s, const index &pos)=0 |
| inserts the given text into the model | |
| std::string | insert (const std::string &, const index &) |
| 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 | remove (const index &, const index &) |
| void | removeTextModelListener (const LPtr &l) |
| void | setMuted (bool mute) |
| mutes or un-mutes the dispatcher | |
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