tbx  0.7.6
Public Member Functions | Protected Member Functions | List of all members
tbx::TextChangedEvent Class Referenceabstract

Event details for a change of text in a gadget. More...

#include <textchangedlistener.h>

Inheritance diagram for tbx::TextChangedEvent:
tbx::EventInfo tbx::StringSetTextChangedEvent tbx::WritableFieldTextChangedEvent

Public Member Functions

 TextChangedEvent (IdBlock &id_block, PollBlock &data)
 Construct the event.
 
virtual ~TextChangedEvent ()
 Virtual destructor.
 
bool too_long () const
 Check if new text was delivered with the toolbox event. More...
 
std::string text () const
 Get the text of the gadget that delivered the event. More...
 
- Public Member Functions inherited from tbx::EventInfo
 EventInfo (const IdBlock &id_block, PollBlock &data)
 Contruct the event information from the id_block and data update by the toolbox.
 
const IdBlockid_block () const
 IdBlock for the current event. More...
 

Protected Member Functions

virtual std::string text_from_gadget () const =0
 Override in sub class to fetch text from the gadget. More...
 
std::string text_from_event () const
 text from event data
 

Additional Inherited Members

- Protected Attributes inherited from tbx::EventInfo
PollBlock_data
 raw data from the event
 

Detailed Description

Event details for a change of text in a gadget.

See also
TextChangedListener

Member Function Documentation

◆ text()

std::string tbx::TextChangedEvent::text ( ) const
inline

Get the text of the gadget that delivered the event.

This will be the text delivered with the event if the too_long parameter is false. Otherwise the text will be retrieved from the gadget.

Returns
the gadget text.

◆ text_from_gadget()

virtual std::string tbx::TextChangedEvent::text_from_gadget ( ) const
protectedpure virtual

Override in sub class to fetch text from the gadget.

Called from the text method if the text wasn't delivered in the event buffer.

Implemented in tbx::WritableFieldTextChangedEvent, and tbx::StringSetTextChangedEvent.

◆ too_long()

bool tbx::TextChangedEvent::too_long ( ) const
inline

Check if new text was delivered with the toolbox event.

Returns
true If the gadget contained more text than would fit in the event delivery buffer.

The documentation for this class was generated from the following file: