Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
orxonox::ChatInputHandler Class Reference

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/orxonox/chat/ChatInputHandler.h>

Inheritance diagram for orxonox::ChatInputHandler:
orxonox::Singleton< ChatInputHandler > orxonox::ChatListener orxonox::Listable orxonox::Identifiable

Public Member Functions

 ChatInputHandler ()
 constructor More...
 
 ~ChatInputHandler ()
 
void activate (bool full)
 
void deactivate ()
 Deactivate the chat window, meaning: hide it. More...
 
virtual void incomingChat (const std::string &message, const std::string &name) override
 
- Public Member Functions inherited from orxonox::ChatListener
 ChatListener ()
 
virtual ~ChatListener ()
 
- Public Member Functions inherited from orxonox::Listable
 Listable ()
 Constructor: Allocates space in the element list. More...
 
 Listable (Context *context)
 Constructor: Allocates space in the element list and assigns the context. More...
 
virtual ~Listable ()
 Destructor: Removes the object from the object-lists. More...
 
ContextgetContext () const
 
void setContext (Context *context)
 Changes the context. More...
 
void unregisterObject ()
 Removes this object from the object-lists. More...
 
- Public Member Functions inherited from orxonox::Identifiable
 Identifiable ()
 Constructor: Sets the default values. More...
 
virtual ~Identifiable ()
 
ORX_FORCEINLINE voidgetDerivedPointer (unsigned int classID)
 Returns a valid pointer of any derived type that is registered in the class hierarchy. More...
 
template<class T >
ORX_FORCEINLINE T * getDerivedPointer (unsigned int classID)
 Version of getDerivedPointer with template. More...
 
template<class T >
ORX_FORCEINLINE const T * getDerivedPointer (unsigned int classID) const
 Const version of getDerivedPointer with template. More...
 
IdentifiergetIdentifier () const
 Returns the Identifier of the object. More...
 
bool isA (const Identifier *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
template<class B >
bool isA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isA (const Identifiable *object)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isChildOf (const Identifier *identifier)
 Returns true if the object's class is a child of the given type. More...
 
template<class B >
bool isChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a child of the given type. More...
 
bool isChildOf (const Identifiable *object)
 Returns true if the object's class is a child of the given type. More...
 
bool isDirectChildOf (const Identifier *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
template<class B >
bool isDirectChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectChildOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectParentOf (const Identifier *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
template<class B >
bool isDirectParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
bool isDirectParentOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isExactlyA (const Identifier *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
template<class B >
bool isExactlyA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
bool isExactlyA (const Identifiable *object)
 Returns true if the object's class is exactly of the given type. More...
 
bool isParentOf (const Identifier *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
template<class B >
bool isParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
bool isParentOf (const Identifiable *object)
 Returns true if the object's class is a parent of the given type. More...
 

Static Public Member Functions

static void activate_small_static ()
 stop listening More...
 
static void activate_static ()
 start listening More...
 
static ChatInputHandlergetInstance (void)
 
- Static Public Member Functions inherited from orxonox::Singleton< ChatInputHandler >
static bool exists ()
 Tells whether the singleton has been created. More...
 
static ChatInputHandlergetInstance ()
 Returns a reference to the singleton instance. More...
 

Private Member Functions

void addline ()
 
void backspace ()
 
void configureInputBuffer ()
 setup input buffer, the constructor calls this More...
 
void cursorEnd ()
 
void cursorHome ()
 
void cursorLeft ()
 
void cursorRight ()
 
void deleteChar ()
 
void exit ()
 
void inputChanged ()
 
void setupColors ()
 
void sub_adjust_dispoffset (int maxlen, int cursorpos, int inplen)
 adjust display offset depending on cursor position More...
 
void sub_setcolor (CEGUI::ListboxTextItem *tocolor, std::string name)
 

Private Attributes

int disp_offset
 
bool fullchat
 
InputBufferinpbuf
 Input buffer, to be used to catch input from the keyboard. More...
 
CEGUI::Window * input
 cegui window handles More...
 
CEGUI::Window * inputonly
 
InputStateinputState
 input state More...
 
CEGUI::Listbox * lb_history
 cegui handle for the history window More...
 
CEGUIColour text_colors [NumberOfColors]
 
int width
 

Static Private Attributes

static const int NumberOfColors = 10
 
static ChatInputHandlersingletonPtr_s
 singleton pointer More...
 

Friends

class Singleton< ChatInputHandler >
 

Additional Inherited Members

- Protected Member Functions inherited from orxonox::Singleton< ChatInputHandler >
 Singleton ()
 Constructor sets the singleton instance pointer. More...
 
virtual ~Singleton ()
 Destructor resets the singleton instance pointer. More...
 

Constructor & Destructor Documentation

orxonox::ChatInputHandler::ChatInputHandler ( )

constructor

orxonox::ChatInputHandler::~ChatInputHandler ( )

Member Function Documentation

void orxonox::ChatInputHandler::activate ( bool  full)
Parameters
fulltrue means show full chat window with history, false means show only an input line

Show the chat window and redirect the game's keyboard input into it.

void orxonox::ChatInputHandler::activate_small_static ( )
static

stop listening

void orxonox::ChatInputHandler::activate_static ( )
static

start listening

void orxonox::ChatInputHandler::addline ( )
private
void orxonox::ChatInputHandler::backspace ( )
private
void orxonox::ChatInputHandler::configureInputBuffer ( )
private

setup input buffer, the constructor calls this

void orxonox::ChatInputHandler::cursorEnd ( )
private
void orxonox::ChatInputHandler::cursorHome ( )
private
void orxonox::ChatInputHandler::cursorLeft ( )
private
void orxonox::ChatInputHandler::cursorRight ( )
private
void orxonox::ChatInputHandler::deactivate ( )

Deactivate the chat window, meaning: hide it.

void orxonox::ChatInputHandler::deleteChar ( )
private
void orxonox::ChatInputHandler::exit ( )
private
static ChatInputHandler& orxonox::ChatInputHandler::getInstance ( void  )
inlinestatic
void orxonox::ChatInputHandler::incomingChat ( const std::string &  message,
const std::string &  name 
)
overridevirtual
Parameters
messagethe message text
nameName of the player who sent the message

Deal with incoming chat (which means in our case: Add it to the history window of the full chat window)

Implements orxonox::ChatListener.

void orxonox::ChatInputHandler::inputChanged ( )
private
void orxonox::ChatInputHandler::setupColors ( )
private
void orxonox::ChatInputHandler::sub_adjust_dispoffset ( int  maxlen,
int  cursorpos,
int  inplen 
)
private

adjust display offset depending on cursor position

void orxonox::ChatInputHandler::sub_setcolor ( CEGUI::ListboxTextItem *  tocolor,
std::string  name 
)
private

Friends And Related Function Documentation

friend class Singleton< ChatInputHandler >
friend

Member Data Documentation

int orxonox::ChatInputHandler::disp_offset
private
bool orxonox::ChatInputHandler::fullchat
private
InputBuffer* orxonox::ChatInputHandler::inpbuf
private

Input buffer, to be used to catch input from the keyboard.

CEGUI::Window* orxonox::ChatInputHandler::input
private

cegui window handles

CEGUI::Window * orxonox::ChatInputHandler::inputonly
private
InputState* orxonox::ChatInputHandler::inputState
private

input state

CEGUI::Listbox* orxonox::ChatInputHandler::lb_history
private

cegui handle for the history window

const int orxonox::ChatInputHandler::NumberOfColors = 10
staticprivate
ChatInputHandler* orxonox::ChatInputHandler::singletonPtr_s
staticprivate

singleton pointer

CEGUIColour orxonox::ChatInputHandler::text_colors[NumberOfColors]
private
int orxonox::ChatInputHandler::width
private

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