#include <Iguana/Models/interface/IgSimpleTextModel.h>
Public Types | |
typedef std::vector< Listener > | Listeners |
Public Member Functions | |
virtual void | changed (void) |
IgSimpleTextModel (void) | |
virtual void | listen (EventType event, const Listener &listener) |
virtual void | set (IgTextRep *rep) |
virtual IgTextRep * | text (void) const |
virtual void | unlisten (EventType event, const Listener &listener) |
Private Attributes | |
IgTextRep * | m_current |
Listeners | m_listeners |
Definition at line 16 of file IgSimpleTextModel.h.
typedef std::vector<Listener> IgSimpleTextModel::Listeners |
Definition at line 19 of file IgSimpleTextModel.h.
IgSimpleTextModel::IgSimpleTextModel | ( | void | ) |
Implements IgTextModel.
Definition at line 37 of file IgSimpleTextModel.cc.
References event(), and m_listeners.
Referenced by set().
00038 { 00039 IgTextModelEvent event (this); 00040 for (Listeners::iterator pos = m_listeners.begin (); 00041 pos != m_listeners.end (); ++pos) 00042 (*pos) (event); 00043 }
Implements IgTextModel.
Definition at line 23 of file IgSimpleTextModel.cc.
References m_listeners.
Referenced by IgQtTextBrowser::IgQtTextBrowser().
00024 { m_listeners.push_back (listener); }
Definition at line 46 of file IgSimpleTextModel.cc.
References changed(), m_current, and old.
Referenced by IgQtTextBrowser::browse(), and IgQtTextBrowser::selectMessage().
00047 { 00048 IgTextRep *old = m_current; 00049 m_current = rep; 00050 if (old != m_current) 00051 changed (); 00052 }
Implements IgTextModel.
Definition at line 55 of file IgSimpleTextModel.cc.
References m_current.
00056 { return m_current; }
Implements IgTextModel.
Definition at line 27 of file IgSimpleTextModel.cc.
References ASSERT, find(), and m_listeners.
Referenced by IgQtTextBrowser::~IgQtTextBrowser().
00028 { 00029 Listeners::iterator pos = std::find (m_listeners.begin (), 00030 m_listeners.end(), 00031 listener); 00032 ASSERT (pos != m_listeners.end ()); 00033 m_listeners.erase (pos); 00034 }
IgTextRep* IgSimpleTextModel::m_current [private] |
Listeners IgSimpleTextModel::m_listeners [private] |
Definition at line 35 of file IgSimpleTextModel.h.
Referenced by changed(), listen(), and unlisten().