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>
Classes | |
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 | OnNextKeyPressed ()=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 CYIUrl & | GetAccessoryImageUrl () const |
Protected Member Functions | |
Receiver () | |
Protected Attributes | |
CYIUrl | m_accessoryImageUrl |
ReturnKeyType | m_keyType |
|
virtual |
|
inlineprotected |
|
inline |
Returns the Url used for the AccessoryImage.
|
inlinevirtual |
Returns the current input modifiers that the receiver expects the keyboard to use when displaying the keyboard. CYIKeyboardInputBridge::InputModifiers::None is set by default.
|
inlinevirtual |
Returns the input layout type that the receiver expects the keyboard to use when displaying the keyboard. CYIKeyboardInputBridge::InputType::Text is set by default.
|
inline |
Returns CYIKeyboardInputBridge::ReturnKeyType::Default by default.
|
pure virtual |
Called by the keyboard when the cursor position has changed. cursor indicates the new cursor position in the existing text.
|
pure virtual |
Called when the keyboard is hidden either by the user of the application, or programmatically.
|
pure virtual |
Called when the keyboard's return key is pressed while the ReturnKeyType is CYIKeyboardInputBridge::ReturnKeyType::Next. Some implementations might send a CYIKeyEvent with key code CYIKeyEvent::KeyCode::Tab instead.
|
pure virtual |
Called when the keyboard's return key is pressed. Some implementations might send a CYIKeyEvent with key code CYIKeyEvent::KeyCode::Enter instead.
|
virtual |
Called by the keyboard when the user opens the keyboard. Implementations must populate receiverKeyboardInfo.
|
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.
|
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.
|
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.
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.
|
inline |
Set the type of return key to be used when the keyboard is shown.
|
protected |
|
protected |