diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /xbmc/guilib/GUIToggleButtonControl.h | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xbmc/guilib/GUIToggleButtonControl.h')
-rw-r--r-- | xbmc/guilib/GUIToggleButtonControl.h | 56 |
1 files changed, 56 insertions, 0 deletions
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; +}; + |