Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches

Class: kodi::gui::controls::CEdit

Editable window text control used as an input control for the osd keyboard and other input fields
The edit control allows a user to input text in Kodi. More...

Topics

 Definitions, structures and enumerators
 Library definition values
 

Functions

 kodi::gui::controls::CEdit::CEdit (CWindow *window, int controlId)
 Construct a new control.
 
 kodi::gui::controls::CEdit::~CEdit () override=default
 Destructor.
 
void kodi::gui::controls::CEdit::SetVisible (bool visible)
 Set the control on window to visible.
 
void kodi::gui::controls::CEdit::SetEnabled (bool enabled)
 Set's the control's enabled/disabled state.
 
void kodi::gui::controls::CEdit::SetLabel (const std::string &label)
 To set the text string on edit control.
 
std::string kodi::gui::controls::CEdit::GetLabel () const
 Returns the text heading for this edit control.
 
void kodi::gui::controls::CEdit::SetText (const std::string &text)
 Set's text heading for this edit control.
 
std::string kodi::gui::controls::CEdit::GetText () const
 Returns the text value for this edit control.
 
void kodi::gui::controls::CEdit::SetCursorPosition (unsigned int position)
 Set the cursor position on text.
 
unsigned int kodi::gui::controls::CEdit::GetCursorPosition ()
 To get current cursor position on text field.
 
void kodi::gui::controls::CEdit::SetInputType (AddonGUIInputType type, const std::string &heading)
 To set field input type which are defined on AddonGUIInputType.
 

Detailed Description

Class: kodi::gui::controls::CEdit

Editable window text control used as an input control for the osd keyboard and other input fields
The edit control allows a user to input text in Kodi.

You can choose the font, size, colour, location and header of the text to be displayed.

It has the header #include <kodi/gui/controls/Edit.h> be included to enjoy it.

Here you find the needed skin partfor a edit control.

Note
The call of the control is only possible from the corresponding window as its class and identification number is required.

Function Documentation

◆ CEdit()

kodi::gui::controls::CEdit::CEdit ( CWindow * window,
int controlId )
inline

Construct a new control.

Parameters
[in]windowRelated window control class
[in]controlIdUsed skin xml control id

◆ GetCursorPosition()

unsigned int kodi::gui::controls::CEdit::GetCursorPosition ( )
inline

To get current cursor position on text field.

Returns
The current cursor position

◆ GetLabel()

std::string kodi::gui::controls::CEdit::GetLabel ( ) const
inline

Returns the text heading for this edit control.

Returns
Heading text

◆ GetText()

std::string kodi::gui::controls::CEdit::GetText ( ) const
inline

Returns the text value for this edit control.

Returns
Text value of control

◆ SetCursorPosition()

void kodi::gui::controls::CEdit::SetCursorPosition ( unsigned int position)
inline

Set the cursor position on text.

Parameters
[in]positionThe position to set

◆ SetEnabled()

void kodi::gui::controls::CEdit::SetEnabled ( bool enabled)
inline

Set's the control's enabled/disabled state.

Parameters
[in]enabledIf true enabled, otherwise disabled

◆ SetInputType()

void kodi::gui::controls::CEdit::SetInputType ( AddonGUIInputType type,
const std::string & heading )
inline

To set field input type which are defined on AddonGUIInputType.

Parameters
[in]typeThe Add-on input type to use
[in]headingThe heading text for related keyboard dialog

◆ SetLabel()

void kodi::gui::controls::CEdit::SetLabel ( const std::string & label)
inline

To set the text string on edit control.

Parameters
[in]labelText to show

◆ SetText()

void kodi::gui::controls::CEdit::SetText ( const std::string & text)
inline

Set's text heading for this edit control.

Parameters
[in]textstring or unicode - text string.

◆ SetVisible()

void kodi::gui::controls::CEdit::SetVisible ( bool visible)
inline

Set the control on window to visible.

Parameters
[in]visibleIf true visible, otherwise hidden

◆ ~CEdit()

kodi::gui::controls::CEdit::~CEdit ( )
overridedefault

Destructor.