Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CAndroidKeyboard Class Reference

Native Android on-screen keyboard implementation. More...

#include <AndroidKeyboard.h>

Inheritance diagram for CAndroidKeyboard:
CGUIKeyboard jni::IKeyboardInputHandler ITimerCallback

Public Member Functions

 CAndroidKeyboard (CGUIKeyboard &owner)
 
 ~CAndroidKeyboard () override=default
 
bool ShowAndGetInput (char_callback_t pCallback, const std::string &initialString, std::string &typedString, const std::string &heading, bool hiddenInput) override
 each native keyboard needs to implement this function with the following behaviour:
 
void Cancel () override
 This call should cancel a currently shown keyboard dialog. The implementation should return false from the modal ShowAndGetInput once anyone calls this method.
 
bool SetTextToKeyboard (const std::string &text, bool closeKeyboard=false) override
 
void OnTextChanged (const std::string &text) override
 
void OnInputFinished (const std::string &text) override
 
void OnInputCanceled () override
 
- Public Member Functions inherited from CGUIKeyboard
 CGUIKeyboard ()
 
 ~CGUIKeyboard () override=default
 
virtual int GetWindowId () const
 
void OnTimeout () override
 
void startAutoCloseTimer (unsigned int autoCloseMs)
 
void resetAutoCloseTimer ()
 
- Public Member Functions inherited from ITimerCallback
virtual ~ITimerCallback ()=default
 
- Public Member Functions inherited from jni::IKeyboardInputHandler
virtual ~IKeyboardInputHandler ()=default
 

Detailed Description

Native Android on-screen keyboard implementation.

Wraps the Java soft keyboard dialog (jni::CJNIXBMCNativeKeyboard) and blocks the calling thread until the user has either confirmed or canceled the input, as required by the CGUIKeyboard interface.

Constructor & Destructor Documentation

◆ CAndroidKeyboard()

CAndroidKeyboard::CAndroidKeyboard ( CGUIKeyboard & owner)
inlineexplicit

◆ ~CAndroidKeyboard()

CAndroidKeyboard::~CAndroidKeyboard ( )
overridedefault

Member Function Documentation

◆ Cancel()

void CAndroidKeyboard::Cancel ( )
overridevirtual

This call should cancel a currently shown keyboard dialog. The implementation should return false from the modal ShowAndGetInput once anyone calls this method.

Implements CGUIKeyboard.

◆ OnInputCanceled()

void CAndroidKeyboard::OnInputCanceled ( )
overridevirtual

◆ OnInputFinished()

void CAndroidKeyboard::OnInputFinished ( const std::string & text)
overridevirtual

◆ OnTextChanged()

void CAndroidKeyboard::OnTextChanged ( const std::string & text)
overridevirtual

◆ SetTextToKeyboard()

bool CAndroidKeyboard::SetTextToKeyboard ( const std::string & text,
bool closeKeyboard = false )
overridevirtual

Reimplemented from CGUIKeyboard.

◆ ShowAndGetInput()

bool CAndroidKeyboard::ShowAndGetInput ( char_callback_t pCallback,
const std::string & initialString,
std::string & typedString,
const std::string & heading,
bool bHiddenInput )
overridevirtual

each native keyboard needs to implement this function with the following behaviour:

Parameters
pCallbackimplementation should call this on each keypress with the current whole string
initialStringimplementation should show that initialstring
typedstringreturns the typed string after close if return is true
headingimplementation should show a heading (e.x. "search for a movie")
bHiddenInputif true the implementation should obfuscate the user input (e.x. by printing "*" for each char)
Returns
- true if typedstring is valid and user has confirmed input - false if typedstring is undefined and user canceled the input

Implements CGUIKeyboard.


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