presage  0.9.2~beta
Public Member Functions | Protected Member Functions | List of all members
PresageCallback Class Referenceabstract

#include <presageCallback.h>

Inheritance diagram for PresageCallback:
Inheritance graph
Collaboration diagram for PresageCallback:
Collaboration graph

Public Member Functions

virtual ~PresageCallback ()
 
virtual std::string get_past_stream () const =0
 
virtual std::string get_future_stream () const =0
 

Protected Member Functions

 PresageCallback ()
 

Detailed Description

Abstract callback object used to retrieve context from user application.

A concrete callback implementation must implement the getPastStream() and getFutureStream() method which are responsible for retrieving the context from the user text buffer.

Using a callback object decouples the user application from the chosen text buffer (which could be a simple string, a graphical text widget, a file stream, etc.) and frees the caller from having to explicitly notify of any updates to the context. Presage will invoke on the callback whenever access to contextual data is required.

getPastStream() must return a string containing the text preceding the current insertion point.

getFutureStream() must return a string containing the text following the current insertion point.

Definition at line 66 of file presageCallback.h.

Constructor & Destructor Documentation

◆ ~PresageCallback()

virtual PresageCallback::~PresageCallback ( )
inlinevirtual

Definition at line 68 of file presageCallback.h.

◆ PresageCallback()

PresageCallback::PresageCallback ( )
inlineprotected

Definition at line 74 of file presageCallback.h.

Member Function Documentation

◆ get_future_stream()

virtual std::string PresageCallback::get_future_stream ( ) const
pure virtual

Implemented in CPresageCallback, LegacyPresageCallback, PresageDemoCallback, and SimulatorPresageCallback.

Referenced by ContextTracker::getFutureStream(), and ContextTracker::toString().

Here is the caller graph for this function:

◆ get_past_stream()

virtual std::string PresageCallback::get_past_stream ( ) const
pure virtual

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