PageRenderTime 18ms CodeModel.GetById 13ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/xbmc/guilib/GUIToggleButtonControl.h

http://github.com/xbmc/xbmc
C Header | 56 lines | 33 code | 8 blank | 15 comment | 0 complexity | aec276ae7c1a570de87198692ae3528f MD5 | raw file
 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/*!
12\file GUIToggleButtonControl.h
13\brief
14*/
15
16#include "GUIButtonControl.h"
17
18/*!
19 \ingroup controls
20 \brief
21 */
22class CGUIToggleButtonControl : public CGUIButtonControl
23{
24public:
25  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);
26  ~CGUIToggleButtonControl(void) override;
27  CGUIToggleButtonControl *Clone() const override { return new CGUIToggleButtonControl(*this); };
28
29  void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) override;
30  void Render() override;
31  bool OnAction(const CAction &action) override;
32  void AllocResources() override;
33  void FreeResources(bool immediately = false) override;
34  void DynamicResourceAlloc(bool bOnOff) override;
35  void SetInvalid() override;
36  void SetPosition(float posX, float posY) override;
37  void SetWidth(float width) override;
38  void SetHeight(float height) override;
39  void SetMinWidth(float minWidth) override;
40  void SetLabel(const std::string& label) override;
41  void SetAltLabel(const std::string& label);
42  std::string GetDescription() const override;
43  void SetToggleSelect(const std::string &toggleSelect);
44  void SetAltClickActions(const CGUIAction &clickActions);
45
46protected:
47  bool UpdateColors() override;
48  void OnClick() override;
49  CGUIButtonControl m_selectButton;
50  INFO::InfoPtr m_toggleSelect;
51
52private:
53  void ProcessToggle(unsigned int currentTime);
54  std::string m_altLabel;
55};
56