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>


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

Public Member Functions

virtual ~Receiver ()
virtual bool OnTextEntered (const CYIString &text, int32_t cursor)=0
virtual bool OnTextDeleted (int32_t beforeCursor, int32_t afterCursor)=0
virtual void OnTextReplaced (const CYIString &text, size_t cursor)=0
virtual void OnCursorPositionChanged (size_t cursor)=0
virtual bool OnKeyboardHidden ()=0
virtual void OnReturnKeyPressed ()=0
virtual void OnSynchronizeKeyboard (Description &receiverKeyboardInfo)
virtual CYIKeyboardInputBridge::InputType GetInputType () const
virtual CYIKeyboardInputBridge::InputModifiers GetInputModifiers () const
ReturnKeyType GetReturnKeyType () const
void SetReturnKeyType (ReturnKeyType keyType)
bool SetAccessoryImageUrl (const CYIUrl &url)
const CYIUrlGetAccessoryImageUrl () const

Protected Member Functions

 Receiver ()

Protected Attributes

CYIUrl m_accessoryImageUrl
ReturnKeyType m_keyType

Constructor & Destructor Documentation

◆ ~Receiver()

virtual CYIKeyboardInputBridge::Receiver::~Receiver ( )

◆ Receiver()

CYIKeyboardInputBridge::Receiver::Receiver ( )

Member Function Documentation

◆ GetAccessoryImageUrl()

const CYIUrl & CYIKeyboardInputBridge::Receiver::GetAccessoryImageUrl ( ) const

Returns the Url used for the AccessoryImage.

See also

◆ GetInputModifiers()

CYIKeyboardInputBridge::InputModifiers CYIKeyboardInputBridge::Receiver::GetInputModifiers ( ) const

Returns the current input modifiers that the receiver expects the keyboard to use when displaying the keyboard. CYIKeyboardInputBridge::InputModifiers::None is set by default.

◆ GetInputType()

CYIKeyboardInputBridge::InputType CYIKeyboardInputBridge::Receiver::GetInputType ( ) const

Returns the input layout type that the receiver expects the keyboard to use when displaying the keyboard. CYIKeyboardInputBridge::InputType::Text is set by default.

◆ GetReturnKeyType()

CYIKeyboardInputBridge::ReturnKeyType CYIKeyboardInputBridge::Receiver::GetReturnKeyType ( ) const

◆ OnCursorPositionChanged()

virtual void CYIKeyboardInputBridge::Receiver::OnCursorPositionChanged ( size_t  cursor)
pure virtual

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

◆ OnKeyboardHidden()

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

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

See also

◆ OnReturnKeyPressed()

virtual void CYIKeyboardInputBridge::Receiver::OnReturnKeyPressed ( )
pure virtual

Called when the keyboard's return key is pressed. Some implementations might send a CYIKeyEvent with key code CYIKeyEvent::KeyCode::Enter instead.

◆ OnSynchronizeKeyboard()

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

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

See also

◆ OnTextDeleted()

virtual bool CYIKeyboardInputBridge::Receiver::OnTextDeleted ( int32_t  beforeCursor,
int32_t  afterCursor 
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.

◆ OnTextEntered()

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

Called by the keyboard when text is entered. text contains the new text, and cursor 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.

◆ OnTextReplaced()

virtual void CYIKeyboardInputBridge::Receiver::OnTextReplaced ( const CYIString text,
size_t  cursor 
pure virtual

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

◆ SetAccessoryImageUrl()

bool CYIKeyboardInputBridge::Receiver::SetAccessoryImageUrl ( const CYIUrl url)

Set the Url to be used for the AccessoryImage. The url can be for either a local or remote image, that image will then be displayed above the keyboard. Returns false if an AccessoryImage is not supported by the current platform.

◆ SetReturnKeyType()

void CYIKeyboardInputBridge::Receiver::SetReturnKeyType ( CYIKeyboardInputBridge::ReturnKeyType  keyType)

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

See also

Member Data Documentation

◆ m_accessoryImageUrl

CYIUrl CYIKeyboardInputBridge::Receiver::m_accessoryImageUrl

◆ m_keyType

ReturnKeyType CYIKeyboardInputBridge::Receiver::m_keyType

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