diff options
| author | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2020-10-19 00:52:24 +0200 |
| commit | be933ef2241d79558f91796cc5b3a161f72ebf9c (patch) | |
| tree | fe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Edit.h | |
| parent | 5f8335c1e49ce108ef3481863833c98efa00411b (diff) | |
| download | kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2 kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip | |
sync with upstream
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Edit.h')
| -rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Edit.h | 275 |
1 files changed, 0 insertions, 275 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Edit.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Edit.h deleted file mode 100644 index 99c01de..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Edit.h +++ /dev/null | |||
| @@ -1,275 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include "../../AddonBase.h" | ||
| 12 | #include "../Window.h" | ||
| 13 | |||
| 14 | namespace kodi | ||
| 15 | { | ||
| 16 | namespace gui | ||
| 17 | { | ||
| 18 | namespace controls | ||
| 19 | { | ||
| 20 | |||
| 21 | //============================================================================ | ||
| 22 | /// | ||
| 23 | /// \defgroup cpp_kodi_gui_controls_CEdit Control Edit | ||
| 24 | /// \ingroup cpp_kodi_gui | ||
| 25 | /// @brief \cpp_class{ kodi::gui::controls::CEdit } | ||
| 26 | /// **Editable window text control used as an input control for the osd keyboard | ||
| 27 | /// and other input fields** | ||
| 28 | /// | ||
| 29 | /// The edit control allows a user to input text in Kodi. You can choose the | ||
| 30 | /// font, size, colour, location and header of the text to be displayed. | ||
| 31 | /// | ||
| 32 | /// It has the header \ref Edit.h "#include <kodi/gui/controls/Edit.h>" | ||
| 33 | /// be included to enjoy it. | ||
| 34 | /// | ||
| 35 | /// Here you find the needed skin part for a \ref skin_Edit_control | ||
| 36 | /// "edit control". | ||
| 37 | /// | ||
| 38 | /// @note The call of the control is only possible from the corresponding | ||
| 39 | /// window as its class and identification number is required. | ||
| 40 | /// | ||
| 41 | |||
| 42 | //============================================================================ | ||
| 43 | // see gui/definition.h for use of group "cpp_kodi_gui_controls_CEdit_Defs" | ||
| 44 | /// | ||
| 45 | /// \defgroup cpp_kodi_gui_controls_CEdit_Defs Definitions, structures and enumerators | ||
| 46 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 47 | /// @brief **Library definition values** | ||
| 48 | /// | ||
| 49 | |||
| 50 | } /* namespace controls */ | ||
| 51 | } /* namespace gui */ | ||
| 52 | } /* namespace kodi */ | ||
| 53 | |||
| 54 | //============================================================================ | ||
| 55 | /// | ||
| 56 | /// \ingroup cpp_kodi_gui_controls_CEdit_Defs | ||
| 57 | /// @{ | ||
| 58 | /// @anchor AddonGUIInputType | ||
| 59 | /// @brief Text input types used on kodi::gui::controls::CEdit | ||
| 60 | enum AddonGUIInputType | ||
| 61 | { | ||
| 62 | /// Text inside edit control only readable | ||
| 63 | ADDON_INPUT_TYPE_READONLY = -1, | ||
| 64 | /// Normal text entries | ||
| 65 | ADDON_INPUT_TYPE_TEXT = 0, | ||
| 66 | /// To use on edit control only numeric numbers | ||
| 67 | ADDON_INPUT_TYPE_NUMBER, | ||
| 68 | /// To insert seconds | ||
| 69 | ADDON_INPUT_TYPE_SECONDS, | ||
| 70 | /// To insert time | ||
| 71 | ADDON_INPUT_TYPE_TIME, | ||
| 72 | /// To insert a date | ||
| 73 | ADDON_INPUT_TYPE_DATE, | ||
| 74 | /// Used for write in IP addresses | ||
| 75 | ADDON_INPUT_TYPE_IPADDRESS, | ||
| 76 | /// Text field used as password entry field with not visible text | ||
| 77 | ADDON_INPUT_TYPE_PASSWORD, | ||
| 78 | /// Text field used as password entry field with not visible text but | ||
| 79 | /// returned as MD5 value | ||
| 80 | ADDON_INPUT_TYPE_PASSWORD_MD5, | ||
| 81 | /// Use text field for search purpose | ||
| 82 | ADDON_INPUT_TYPE_SEARCH, | ||
| 83 | /// Text field as filter | ||
| 84 | ADDON_INPUT_TYPE_FILTER, | ||
| 85 | /// | ||
| 86 | ADDON_INPUT_TYPE_PASSWORD_NUMBER_VERIFY_NEW | ||
| 87 | }; | ||
| 88 | /// @} | ||
| 89 | //---------------------------------------------------------------------------- | ||
| 90 | |||
| 91 | namespace kodi | ||
| 92 | { | ||
| 93 | namespace gui | ||
| 94 | { | ||
| 95 | namespace controls | ||
| 96 | { | ||
| 97 | |||
| 98 | class ATTRIBUTE_HIDDEN CEdit : public CAddonGUIControlBase | ||
| 99 | { | ||
| 100 | public: | ||
| 101 | //========================================================================== | ||
| 102 | /// | ||
| 103 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 104 | /// @brief Construct a new control | ||
| 105 | /// | ||
| 106 | /// @param[in] window related window control class | ||
| 107 | /// @param[in] controlId Used skin xml control id | ||
| 108 | /// | ||
| 109 | CEdit(CWindow* window, int controlId) : CAddonGUIControlBase(window) | ||
| 110 | { | ||
| 111 | m_controlHandle = m_interface->kodi_gui->window->get_control_edit( | ||
| 112 | m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 113 | if (!m_controlHandle) | ||
| 114 | kodi::Log(ADDON_LOG_FATAL, | ||
| 115 | "kodi::gui::control::CEdit can't create control class from Kodi !!!"); | ||
| 116 | } | ||
| 117 | //-------------------------------------------------------------------------- | ||
| 118 | |||
| 119 | //========================================================================== | ||
| 120 | /// | ||
| 121 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 122 | /// @brief Destructor | ||
| 123 | /// | ||
| 124 | ~CEdit() override = default; | ||
| 125 | //-------------------------------------------------------------------------- | ||
| 126 | |||
| 127 | //========================================================================== | ||
| 128 | /// | ||
| 129 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 130 | /// @brief Set the control on window to visible | ||
| 131 | /// | ||
| 132 | /// @param[in] visible If true visible, otherwise hidden | ||
| 133 | /// | ||
| 134 | void SetVisible(bool visible) | ||
| 135 | { | ||
| 136 | m_interface->kodi_gui->control_edit->set_visible(m_interface->kodiBase, m_controlHandle, | ||
| 137 | visible); | ||
| 138 | } | ||
| 139 | //-------------------------------------------------------------------------- | ||
| 140 | |||
| 141 | //========================================================================== | ||
| 142 | /// | ||
| 143 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 144 | /// @brief Set's the control's enabled/disabled state | ||
| 145 | /// | ||
| 146 | /// @param[in] enabled If true enabled, otherwise disabled | ||
| 147 | /// | ||
| 148 | void SetEnabled(bool enabled) | ||
| 149 | { | ||
| 150 | m_interface->kodi_gui->control_edit->set_enabled(m_interface->kodiBase, m_controlHandle, | ||
| 151 | enabled); | ||
| 152 | } | ||
| 153 | //-------------------------------------------------------------------------- | ||
| 154 | |||
| 155 | //========================================================================== | ||
| 156 | /// | ||
| 157 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 158 | /// @brief To set the text string on edit control | ||
| 159 | /// | ||
| 160 | /// @param[in] label Text to show | ||
| 161 | /// | ||
| 162 | void SetLabel(const std::string& label) | ||
| 163 | { | ||
| 164 | m_interface->kodi_gui->control_edit->set_label(m_interface->kodiBase, m_controlHandle, | ||
| 165 | label.c_str()); | ||
| 166 | } | ||
| 167 | //-------------------------------------------------------------------------- | ||
| 168 | |||
| 169 | //========================================================================== | ||
| 170 | /// | ||
| 171 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 172 | /// @brief Returns the text heading for this edit control. | ||
| 173 | /// | ||
| 174 | /// @return Heading text | ||
| 175 | /// | ||
| 176 | std::string GetLabel() const | ||
| 177 | { | ||
| 178 | std::string label; | ||
| 179 | char* ret = | ||
| 180 | m_interface->kodi_gui->control_edit->get_label(m_interface->kodiBase, m_controlHandle); | ||
| 181 | if (ret != nullptr) | ||
| 182 | { | ||
| 183 | if (std::strlen(ret)) | ||
| 184 | label = ret; | ||
| 185 | m_interface->free_string(m_interface->kodiBase, ret); | ||
| 186 | } | ||
| 187 | return label; | ||
| 188 | } | ||
| 189 | //-------------------------------------------------------------------------- | ||
| 190 | |||
| 191 | //========================================================================== | ||
| 192 | /// | ||
| 193 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 194 | /// @brief Set's text heading for this edit control. | ||
| 195 | /// | ||
| 196 | /// @param[in] text string or unicode - text string. | ||
| 197 | /// | ||
| 198 | void SetText(const std::string& text) | ||
| 199 | { | ||
| 200 | m_interface->kodi_gui->control_edit->set_text(m_interface->kodiBase, m_controlHandle, | ||
| 201 | text.c_str()); | ||
| 202 | } | ||
| 203 | //-------------------------------------------------------------------------- | ||
| 204 | |||
| 205 | //========================================================================== | ||
| 206 | /// | ||
| 207 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 208 | /// @brief Returns the text value for this edit control. | ||
| 209 | /// | ||
| 210 | /// @return Text value of control | ||
| 211 | /// | ||
| 212 | std::string GetText() const | ||
| 213 | { | ||
| 214 | std::string text; | ||
| 215 | char* ret = | ||
| 216 | m_interface->kodi_gui->control_edit->get_text(m_interface->kodiBase, m_controlHandle); | ||
| 217 | if (ret != nullptr) | ||
| 218 | { | ||
| 219 | if (std::strlen(ret)) | ||
| 220 | text = ret; | ||
| 221 | m_interface->free_string(m_interface->kodiBase, ret); | ||
| 222 | } | ||
| 223 | return text; | ||
| 224 | } | ||
| 225 | //-------------------------------------------------------------------------- | ||
| 226 | |||
| 227 | //========================================================================== | ||
| 228 | /// | ||
| 229 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 230 | /// @brief Set the cursor position on text. | ||
| 231 | /// | ||
| 232 | /// @param[in] iPosition The position to set | ||
| 233 | /// | ||
| 234 | void SetCursorPosition(unsigned int iPosition) | ||
| 235 | { | ||
| 236 | m_interface->kodi_gui->control_edit->set_cursor_position(m_interface->kodiBase, m_controlHandle, | ||
| 237 | iPosition); | ||
| 238 | } | ||
| 239 | //-------------------------------------------------------------------------- | ||
| 240 | |||
| 241 | //========================================================================== | ||
| 242 | /// | ||
| 243 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 244 | /// @brief To get current cursor position on text field | ||
| 245 | /// | ||
| 246 | /// @return The current cursor position | ||
| 247 | /// | ||
| 248 | unsigned int GetCursorPosition() | ||
| 249 | { | ||
| 250 | return m_interface->kodi_gui->control_edit->get_cursor_position(m_interface->kodiBase, | ||
| 251 | m_controlHandle); | ||
| 252 | } | ||
| 253 | //-------------------------------------------------------------------------- | ||
| 254 | |||
| 255 | //========================================================================== | ||
| 256 | /// | ||
| 257 | /// \ingroup cpp_kodi_gui_controls_CEdit | ||
| 258 | /// @brief To set field input type which are defined on \ref AddonGUIInputType | ||
| 259 | /// | ||
| 260 | /// @param[in] type The \ref AddonGUIInputType "Add-on input type" | ||
| 261 | /// to use | ||
| 262 | /// @param[in] heading The heading text for related keyboard | ||
| 263 | /// dialog | ||
| 264 | /// | ||
| 265 | void SetInputType(AddonGUIInputType type, const std::string& heading) | ||
| 266 | { | ||
| 267 | m_interface->kodi_gui->control_edit->set_input_type(m_interface->kodiBase, m_controlHandle, | ||
| 268 | static_cast<int>(type), heading.c_str()); | ||
| 269 | } | ||
| 270 | //-------------------------------------------------------------------------- | ||
| 271 | }; | ||
| 272 | |||
| 273 | } /* namespace controls */ | ||
| 274 | } /* namespace gui */ | ||
| 275 | } /* namespace kodi */ | ||
