From c04dcc2e7d834218ef2d4194331e383402495ae1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 20:07:22 +0200 Subject: Adding upstream version 2:20.4+dfsg. Signed-off-by: Daniel Baumann --- xbmc/guilib/GUIToggleButtonControl.h | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 xbmc/guilib/GUIToggleButtonControl.h (limited to 'xbmc/guilib/GUIToggleButtonControl.h') diff --git a/xbmc/guilib/GUIToggleButtonControl.h b/xbmc/guilib/GUIToggleButtonControl.h new file mode 100644 index 0000000..732adc7 --- /dev/null +++ b/xbmc/guilib/GUIToggleButtonControl.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +/*! +\file GUIToggleButtonControl.h +\brief +*/ + +#include "GUIButtonControl.h" + +/*! + \ingroup controls + \brief + */ +class CGUIToggleButtonControl : public CGUIButtonControl +{ +public: + CGUIToggleButtonControl(int parentID, int controlID, float posX, float posY, float width, float height, const CTextureInfo& textureFocus, const CTextureInfo& textureNoFocus, const CTextureInfo& altTextureFocus, const CTextureInfo& altTextureNoFocus, const CLabelInfo &labelInfo, bool wrapMultiline = false); + ~CGUIToggleButtonControl(void) override; + CGUIToggleButtonControl* Clone() const override { return new CGUIToggleButtonControl(*this); } + + void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) override; + void Render() override; + bool OnAction(const CAction &action) override; + void AllocResources() override; + void FreeResources(bool immediately = false) override; + void DynamicResourceAlloc(bool bOnOff) override; + void SetInvalid() override; + void SetPosition(float posX, float posY) override; + void SetWidth(float width) override; + void SetHeight(float height) override; + void SetMinWidth(float minWidth) override; + void SetLabel(const std::string& label) override; + void SetAltLabel(const std::string& label); + std::string GetDescription() const override; + void SetToggleSelect(const std::string &toggleSelect); + void SetAltClickActions(const CGUIAction &clickActions); + +protected: + bool UpdateColors(const CGUIListItem* item) override; + void OnClick() override; + CGUIButtonControl m_selectButton; + INFO::InfoPtr m_toggleSelect; + +private: + void ProcessToggle(unsigned int currentTime); + std::string m_altLabel; +}; + -- cgit v1.2.3