diff options
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Image.h')
| -rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Image.h | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Image.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Image.h new file mode 100644 index 0000000..1179fab --- /dev/null +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/gui/controls/Image.h | |||
| @@ -0,0 +1,123 @@ | |||
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Copyright (C) 2005-2017 Team KODI | ||
| 4 | * http://kodi.tv | ||
| 5 | * | ||
| 6 | * This Program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | * any later version. | ||
| 10 | * | ||
| 11 | * This Program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with KODI; see the file COPYING. If not, see | ||
| 18 | * <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include "../../AddonBase.h" | ||
| 23 | #include "../Window.h" | ||
| 24 | |||
| 25 | namespace kodi | ||
| 26 | { | ||
| 27 | namespace gui | ||
| 28 | { | ||
| 29 | namespace controls | ||
| 30 | { | ||
| 31 | |||
| 32 | //============================================================================ | ||
| 33 | /// | ||
| 34 | /// \defgroup cpp_kodi_gui_controls_CImage Control Image | ||
| 35 | /// \ingroup cpp_kodi_gui | ||
| 36 | /// @brief \cpp_class{ kodi::gui::controls::CImage } | ||
| 37 | /// **Window control used to show an image.** | ||
| 38 | /// | ||
| 39 | /// The image control is used for displaying images in Kodi. You can choose | ||
| 40 | /// the position, size, transparency and contents of the image to be displayed. | ||
| 41 | /// | ||
| 42 | /// It has the header \ref Image.h "#include <kodi/gui/controls/Image.h>" | ||
| 43 | /// be included to enjoy it. | ||
| 44 | /// | ||
| 45 | /// Here you find the needed skin part for a \ref Image_Control "image control" | ||
| 46 | /// | ||
| 47 | /// @note The call of the control is only possible from the corresponding | ||
| 48 | /// window as its class and identification number is required. | ||
| 49 | /// | ||
| 50 | class CImage : public CAddonGUIControlBase | ||
| 51 | { | ||
| 52 | public: | ||
| 53 | //========================================================================== | ||
| 54 | /// | ||
| 55 | /// \ingroup cpp_kodi_gui_controls_CImage | ||
| 56 | /// @brief Construct a new control | ||
| 57 | /// | ||
| 58 | /// @param[in] window related window control class | ||
| 59 | /// @param[in] controlId Used skin xml control id | ||
| 60 | /// | ||
| 61 | CImage(CWindow* window, int controlId) | ||
| 62 | : CAddonGUIControlBase(window) | ||
| 63 | { | ||
| 64 | m_controlHandle = m_interface->kodi_gui->window->get_control_image(m_interface->kodiBase, m_Window->GetControlHandle(), controlId); | ||
| 65 | if (!m_controlHandle) | ||
| 66 | kodi::Log(ADDON_LOG_FATAL, "kodi::gui::controls::CImage can't create control class from Kodi !!!"); | ||
| 67 | } | ||
| 68 | //-------------------------------------------------------------------------- | ||
| 69 | |||
| 70 | //========================================================================== | ||
| 71 | /// | ||
| 72 | /// \ingroup cpp_kodi_gui_controls_CImage | ||
| 73 | /// @brief Destructor | ||
| 74 | /// | ||
| 75 | ~CImage() override = default; | ||
| 76 | //-------------------------------------------------------------------------- | ||
| 77 | |||
| 78 | //========================================================================== | ||
| 79 | /// | ||
| 80 | /// \ingroup cpp_kodi_gui_controls_CImage | ||
| 81 | /// @brief Set the control on window to visible | ||
| 82 | /// | ||
| 83 | /// @param[in] visible If true visible, otherwise hidden | ||
| 84 | /// | ||
| 85 | void SetVisible(bool visible) | ||
| 86 | { | ||
| 87 | m_interface->kodi_gui->control_image->set_visible(m_interface->kodiBase, m_controlHandle, visible); | ||
| 88 | } | ||
| 89 | //-------------------------------------------------------------------------- | ||
| 90 | |||
| 91 | //========================================================================== | ||
| 92 | /// | ||
| 93 | /// \ingroup cpp_kodi_gui_controls_CImage | ||
| 94 | /// @brief To set the filename used on image control. | ||
| 95 | /// | ||
| 96 | /// @param[in] filename Image file to use | ||
| 97 | /// @param[in] useCache To define storage of image, default is | ||
| 98 | /// in cache, if false becomes it loaded | ||
| 99 | /// always on changes again | ||
| 100 | /// | ||
| 101 | void SetFileName(const std::string& filename, bool useCache = true) | ||
| 102 | { | ||
| 103 | m_interface->kodi_gui->control_image->set_filename(m_interface->kodiBase, m_controlHandle, filename.c_str(), useCache); | ||
| 104 | } | ||
| 105 | //-------------------------------------------------------------------------- | ||
| 106 | |||
| 107 | //========================================================================== | ||
| 108 | /// | ||
| 109 | /// \ingroup cpp_kodi_gui_controls_CImage | ||
| 110 | /// @brief To set set the diffuse color on image. | ||
| 111 | /// | ||
| 112 | /// @param[in] colorDiffuse Color to use for diffuse | ||
| 113 | /// | ||
| 114 | void SetColorDiffuse(uint32_t colorDiffuse) | ||
| 115 | { | ||
| 116 | m_interface->kodi_gui->control_image->set_color_diffuse(m_interface->kodiBase, m_controlHandle, colorDiffuse); | ||
| 117 | } | ||
| 118 | //-------------------------------------------------------------------------- | ||
| 119 | }; | ||
| 120 | |||
| 121 | } /* namespace controls */ | ||
| 122 | } /* namespace gui */ | ||
| 123 | } /* namespace kodi */ | ||
