CrystalSpace

Public API Reference

iConsoleInput Struct Reference

This is a plugin that can handle keyboard input and display it on an associated console. More...

#include <ivaria/conin.h>

Inheritance diagram for iConsoleInput:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual void Bind (iConsoleOutput *console)=0
 Bind to an output console.
virtual void Clear ()=0
 Clear the history buffer.
virtual int GetBufferSize () const =0
 Retrieve the size of the history buffer.
virtual int GetCurLine () const =0
 Return the current input line number.
virtual iConsoleExecCallbackGetExecuteCallback ()=0
 Get the command execution callback.
virtual const char * GetText (int line=-1) const =0
 Return a line from the input buffer.
virtual bool HandleEvent (iEvent &)=0
 Handle a console-related event.
virtual void SetBufferSize (int size)=0
 Set the size of the history buffer.
virtual void SetExecuteCallback (iConsoleExecCallback *callback)=0
 Set the command execution callback.
virtual void SetPrompt (const char *prompt)=0
 Set the prompt string.

Detailed Description

This is a plugin that can handle keyboard input and display it on an associated console.

The plugin has a command history and when user presses 'Enter' can call some callback function to execute the entered command.

WARNING Do NOT use the event handler that may (or may not) be implemented by the console and register that to the event queue. This doesn't work properly. Instead register your own event handler and call HandleEvent() from that.

Main creators of instances implementing this interface:

Main ways to get pointers to this interface:

Definition at line 61 of file conin.h.


Member Function Documentation

virtual void iConsoleInput::Bind ( iConsoleOutput console  )  [pure virtual]

Bind to an output console.

Parameters:
console 

virtual void iConsoleInput::Clear (  )  [pure virtual]

Clear the history buffer.

virtual int iConsoleInput::GetBufferSize (  )  const [pure virtual]

Retrieve the size of the history buffer.

virtual int iConsoleInput::GetCurLine (  )  const [pure virtual]

Return the current input line number.

virtual iConsoleExecCallback* iConsoleInput::GetExecuteCallback (  )  [pure virtual]

Get the command execution callback.

virtual const char* iConsoleInput::GetText ( int  line = -1  )  const [pure virtual]

Return a line from the input buffer.

Parameters:
line is the line number to get or -1 (default) for current line.

virtual bool iConsoleInput::HandleEvent ( iEvent  )  [pure virtual]

Handle a console-related event.

Do NOT use the event handler that may (or may not) be implemented by the console and register that to the event queue. This doesn't work properly. Instead register your own event handler and call HandleEvent() from that.

virtual void iConsoleInput::SetBufferSize ( int  size  )  [pure virtual]

Set the size of the history buffer.

Parameters:
size is the size in lines of the history buffer.

virtual void iConsoleInput::SetExecuteCallback ( iConsoleExecCallback callback  )  [pure virtual]

Set the command execution callback.

Parameters:
callback will be called whenever the user presses enter so the application can then perform the command that was entered.

virtual void iConsoleInput::SetPrompt ( const char *  prompt  )  [pure virtual]

Set the prompt string.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.4.7