Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
Control Edit

\cpp_class{ kodi::gui::controls::CEdit } Editable window text control used as an input control for the osd keyboard and other input fields More...

Modules

 Definitions, structures and enumerators
 Library definition values
 

Functions

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

Detailed Description

\cpp_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 part for 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  iPosition)
inline

Set the cursor position on text.

Parameters
[in]iPositionThe 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.