You.i Engine
CYIKeyboardInputBridge::Receiver Class Referenceabstract

Detailed Description

Provides an interface to interact with the system software keyboard.

Derive this class to interact with the system software keyboard. Use this class to specify the type of input you would like to receive as well as what to do with the input. Will also get notified when the keyboard has been hidden by the OS.

#include <platform/YiKeyboardInputBridge.h>

Inheritance diagram for CYIKeyboardInputBridge::Receiver:

Classes

struct  Description
 Provides details to the system software keyboard. More...
 

Public Member Functions

virtual ~Receiver ()
 
virtual bool OnTextEntered (const CYIString &text, int32_t nCursor)=0
 
virtual bool OnTextDeleted (int32_t nBeforeCursor, int32_t nAfterCursor)=0
 
virtual void OnTextReplaced (const CYIString &text, int32_t nCursor)=0
 
virtual void OnCursorPositionChanged (int32_t nCursor)=0
 
virtual bool OnKeyboardHidden ()=0
 
virtual void OnSynchronizeKeyboard (Description &receiverKeyboardInfo)
 
virtual INPUT_TYPE GetInputType () const
 
RETURN_KEY_TYPE GetReturnKeyType () const
 
void SetReturnKeyType (RETURN_KEY_TYPE eKeyType)
 
virtual bool OnSetComposingText (const CYIString &text, int32_t nCursor)=0
 
virtual bool OnFinishComposingText ()=0
 
virtual bool OnSetComposingRegion (int32_t nStart, int32_t nEnd)=0
 
virtual bool OnTextPasted (const CYIString &text)=0
 

Public Attributes

CYISignal< CYIKeyboardInputBridge::Receiver * > ReturnKeyPressed
 

Protected Member Functions

 Receiver ()
 

Protected Attributes

RETURN_KEY_TYPE m_keyType
 

Constructor & Destructor Documentation

virtual CYIKeyboardInputBridge::Receiver::~Receiver ( )
inlinevirtual
CYIKeyboardInputBridge::Receiver::Receiver ( )
inlineprotected

Member Function Documentation

CYIKeyboardInputBridge::INPUT_TYPE CYIKeyboardInputBridge::Receiver::GetInputType ( ) const
inlinevirtual

Returns CYIKeyboardInputBridge::INPUT_TEXT by default.

See also
INPUT_TYPE

Reimplemented in CYITextEditView.

CYIKeyboardInputBridge::RETURN_KEY_TYPE CYIKeyboardInputBridge::Receiver::GetReturnKeyType ( ) const
inline
virtual void CYIKeyboardInputBridge::Receiver::OnCursorPositionChanged ( int32_t  nCursor)
pure virtual

Called by the keyboard when the cursor position has changed. nCursor indicates the new cursor position in the existing text.

Implemented in CYITextEditView, and CYIPasswordTextEditView.

bool CYIKeyboardInputBridge::Receiver::OnFinishComposingText ( )
inlinepure virtual

Called by the keyboard when text is finished composing. Any composing text will be removed.

Implemented in CYITextEditView.

virtual bool CYIKeyboardInputBridge::Receiver::OnKeyboardHidden ( )
pure virtual

Called when the keyboard is hidden either by the user of the application, or programmatically.

See also
CYIKeyboardInputBridge::HideKeyboard()

Implemented in CYITextEditView.

bool CYIKeyboardInputBridge::Receiver::OnSetComposingRegion ( int32_t  nStart,
int32_t  nEnd 
)
inlinepure virtual

Called by the keyboard to mark a certain region of text as the composing text.

Implemented in CYITextEditView.

bool CYIKeyboardInputBridge::Receiver::OnSetComposingText ( const CYIString text,
int32_t  nCursor 
)
inlinepure virtual

Called by the keyboard when text is being composed. text contains the new composing text which replaces any previous composition text. nCursor is the new position of the cursor around the text. A value of 1 advances the cursor to the position after the new text. If >0 it is relative to the end of the text-1, if <= 0 it is relative to the start of the text.

Implemented in CYITextEditView.

virtual void CYIKeyboardInputBridge::Receiver::OnSynchronizeKeyboard ( Description receiverKeyboardInfo)
virtual

Called by the keyboard when the user opens the keyboard. Implementations must populate receiverKeyboardInfo.

See also
Description
virtual bool CYIKeyboardInputBridge::Receiver::OnTextDeleted ( int32_t  nBeforeCursor,
int32_t  nAfterCursor 
)
pure virtual

Called by the keyboard when text is deleted. The parameters indicate the number of characters before and after the current cursor position were deleted.

Implemented in CYITextEditView, and CYIPasswordTextEditView.

virtual bool CYIKeyboardInputBridge::Receiver::OnTextEntered ( const CYIString text,
int32_t  nCursor 
)
pure virtual

Called by the keyboard when text is entered. text contains the new text, and nCursor is the new position of the cursor around the text. A value of 1 advances the cursor to the position after the new text. If >0 it is relative to the end of the text-1, if <= 0 it is relative to the start of the text.

Implemented in CYITextEditView.

virtual bool CYIKeyboardInputBridge::Receiver::OnTextPasted ( const CYIString text)
pure virtual

Called by the keyboard when text is pasted. text contains the new text which should be inserted where the cursor is, and the cursor should be moved to the end of the pasted text.

Implemented in CYITextEditView, and CYIPasswordTextEditView.

virtual void CYIKeyboardInputBridge::Receiver::OnTextReplaced ( const CYIString text,
int32_t  nCursor 
)
pure virtual

Called by the keyboard when the text is replaced. text contains the new text which replaces any existing text, and nCursor indicates the cursor position in the new text.

Implemented in CYITextEditView, and CYIPasswordTextEditView.

void CYIKeyboardInputBridge::Receiver::SetReturnKeyType ( CYIKeyboardInputBridge::RETURN_KEY_TYPE  keyType)
inline

Set the type of return key to be used when the keyboard is shown.

See also
GetReturnKeyType
RETURN_KEY_TYPE

Member Data Documentation

RETURN_KEY_TYPE CYIKeyboardInputBridge::Receiver::m_keyType
protected
CYISignal<CYIKeyboardInputBridge::Receiver *> CYIKeyboardInputBridge::Receiver::ReturnKeyPressed

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