diff options
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Button.h')
| -rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Button.h | 171 |
1 files changed, 0 insertions, 171 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Button.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Button.h deleted file mode 100644 index 081ab06..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Button.h +++ /dev/null | |||
| @@ -1,171 +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_CButton Control Button | ||
| 24 | /// \ingroup cpp_kodi_gui | ||
| 25 | /// @brief \cpp_class{ kodi::gui::controls::CButton } | ||
| 26 | /// **Standard push button control for window** | ||
| 27 | /// | ||
| 28 | /// The button control is used for creating push buttons in Kodi. You can | ||
| 29 | /// choose the position, size, and look of the button, as well as choosing | ||
| 30 | /// what action(s) should be performed when pushed. | ||
| 31 | /// | ||
| 32 | /// It has the header \ref Button.h "#include <kodi/gui/controls/Button.h>" | ||
| 33 | /// be included to enjoy it. | ||
| 34 | /// | ||
| 35 | /// Here you find the needed skin part for a \ref skin_Button_control "button control" | ||
| 36 | /// | ||
| 37 | /// @note The call of the control is only possible from the corresponding | ||
| 38 | /// window as its class and identification number is required. | ||
| 39 | /// | ||
| 40 | class ATTRIBUTE_HIDDEN CButton : public CAddonGUIControlBase | ||
| 41 | { | ||
| 42 | public: | ||
| 43 | //========================================================================== | ||
| 44 | /// | ||
| 45 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 46 | /// @brief Construct a new control | ||
| 47 | /// | ||
| 48 | /// @param[in] window related window control class | ||
| 49 | /// @param[in] controlId Used skin xml control id | ||
| 50 | /// | ||
| 51 | CButton(CWindow* window, int controlId) : CAddonGUIControlBase(window) | ||
| 52 | { | ||
| 53 | m_controlHandle = m_interface->kodi_gui->window->get_control_button( | ||
| 54 | m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 55 | if (!m_controlHandle) | ||
| 56 | kodi::Log(ADDON_LOG_FATAL, "kodi::gui::CButton can't create control class from Kodi !!!"); | ||
| 57 | } | ||
| 58 | //-------------------------------------------------------------------------- | ||
| 59 | |||
| 60 | //========================================================================== | ||
| 61 | /// | ||
| 62 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 63 | /// @brief Destructor | ||
| 64 | /// | ||
| 65 | ~CButton() override = default; | ||
| 66 | //-------------------------------------------------------------------------- | ||
| 67 | |||
| 68 | //========================================================================== | ||
| 69 | /// | ||
| 70 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 71 | /// @brief Set the control on window to visible | ||
| 72 | /// | ||
| 73 | /// @param[in] visible If true visible, otherwise hidden | ||
| 74 | /// | ||
| 75 | void SetVisible(bool visible) | ||
| 76 | { | ||
| 77 | m_interface->kodi_gui->control_button->set_visible(m_interface->kodiBase, m_controlHandle, | ||
| 78 | visible); | ||
| 79 | } | ||
| 80 | //-------------------------------------------------------------------------- | ||
| 81 | |||
| 82 | //========================================================================== | ||
| 83 | /// | ||
| 84 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 85 | /// @brief Set's the control's enabled/disabled state | ||
| 86 | /// | ||
| 87 | /// @param[in] enabled If true enabled, otherwise disabled | ||
| 88 | /// | ||
| 89 | void SetEnabled(bool enabled) | ||
| 90 | { | ||
| 91 | m_interface->kodi_gui->control_button->set_enabled(m_interface->kodiBase, m_controlHandle, | ||
| 92 | enabled); | ||
| 93 | } | ||
| 94 | //-------------------------------------------------------------------------- | ||
| 95 | |||
| 96 | //========================================================================== | ||
| 97 | /// | ||
| 98 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 99 | /// @brief To set the text string on button | ||
| 100 | /// | ||
| 101 | /// @param[in] label Text to show | ||
| 102 | /// | ||
| 103 | void SetLabel(const std::string& label) | ||
| 104 | { | ||
| 105 | m_interface->kodi_gui->control_button->set_label(m_interface->kodiBase, m_controlHandle, | ||
| 106 | label.c_str()); | ||
| 107 | } | ||
| 108 | //-------------------------------------------------------------------------- | ||
| 109 | |||
| 110 | //========================================================================== | ||
| 111 | /// | ||
| 112 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 113 | /// @brief Get the used text from button | ||
| 114 | /// | ||
| 115 | /// @return Text shown | ||
| 116 | /// | ||
| 117 | std::string GetLabel() const | ||
| 118 | { | ||
| 119 | std::string label; | ||
| 120 | char* ret = | ||
| 121 | m_interface->kodi_gui->control_button->get_label(m_interface->kodiBase, m_controlHandle); | ||
| 122 | if (ret != nullptr) | ||
| 123 | { | ||
| 124 | if (std::strlen(ret)) | ||
| 125 | label = ret; | ||
| 126 | m_interface->free_string(m_interface->kodiBase, ret); | ||
| 127 | } | ||
| 128 | return label; | ||
| 129 | } | ||
| 130 | //-------------------------------------------------------------------------- | ||
| 131 | |||
| 132 | //========================================================================== | ||
| 133 | /// | ||
| 134 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 135 | /// @brief If two labels are used for button becomes it set with them | ||
| 136 | /// | ||
| 137 | /// @param[in] label Text for second label | ||
| 138 | /// | ||
| 139 | void SetLabel2(const std::string& label) | ||
| 140 | { | ||
| 141 | m_interface->kodi_gui->control_button->set_label2(m_interface->kodiBase, m_controlHandle, | ||
| 142 | label.c_str()); | ||
| 143 | } | ||
| 144 | //-------------------------------------------------------------------------- | ||
| 145 | |||
| 146 | //========================================================================== | ||
| 147 | /// | ||
| 148 | /// @ingroup cpp_kodi_gui_control_CButton | ||
| 149 | /// @brief Get the second label if present | ||
| 150 | /// | ||
| 151 | /// @return Second label | ||
| 152 | /// | ||
| 153 | std::string GetLabel2() const | ||
| 154 | { | ||
| 155 | std::string label; | ||
| 156 | char* ret = | ||
| 157 | m_interface->kodi_gui->control_button->get_label2(m_interface->kodiBase, m_controlHandle); | ||
| 158 | if (ret != nullptr) | ||
| 159 | { | ||
| 160 | if (std::strlen(ret)) | ||
| 161 | label = ret; | ||
| 162 | m_interface->free_string(m_interface->kodiBase, ret); | ||
| 163 | } | ||
| 164 | return label; | ||
| 165 | } | ||
| 166 | //-------------------------------------------------------------------------- | ||
| 167 | }; | ||
| 168 | |||
| 169 | } /* namespace controls */ | ||
| 170 | } /* namespace gui */ | ||
| 171 | } /* namespace kodi */ | ||
