/xbmc/guilib/GUIProgressControl.h

http://github.com/xbmc/xbmc · C Header · 68 lines · 45 code · 8 blank · 15 comment · 0 complexity · 06210e4a6e76575c851d3544eaa0a5cf 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. #pragma once
  9. /*!
  10. \file GUIProgressControl.h
  11. \brief
  12. */
  13. #include "GUIControl.h"
  14. #include "GUITexture.h"
  15. /*!
  16. \ingroup controls
  17. \brief
  18. */
  19. class CGUIProgressControl :
  20. public CGUIControl
  21. {
  22. public:
  23. CGUIProgressControl(int parentID, int controlID, float posX, float posY,
  24. float width, float height, const CTextureInfo& backGroundTexture,
  25. const CTextureInfo& leftTexture, const CTextureInfo& midTexture,
  26. const CTextureInfo& rightTexture, const CTextureInfo& overlayTexture,
  27. bool reveal=false);
  28. ~CGUIProgressControl(void) override;
  29. CGUIProgressControl *Clone() const override { return new CGUIProgressControl(*this); };
  30. void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) override;
  31. void Render() override;
  32. bool CanFocus() const override;
  33. void AllocResources() override;
  34. void FreeResources(bool immediately = false) override;
  35. void DynamicResourceAlloc(bool bOnOff) override;
  36. void SetInvalid() override;
  37. bool OnMessage(CGUIMessage& message) override;
  38. void SetPosition(float posX, float posY) override;
  39. void SetPercentage(float fPercent);
  40. void SetInfo(int iInfo, int iInfo2 = 0);
  41. int GetInfo() const {return m_iInfoCode;};
  42. float GetPercentage() const;
  43. std::string GetDescription() const override;
  44. void UpdateInfo(const CGUIListItem *item = NULL) override;
  45. bool UpdateLayout(void);
  46. protected:
  47. bool UpdateColors() override;
  48. CGUITexture m_guiBackground;
  49. CGUITexture m_guiLeft;
  50. CGUITexture m_guiMid;
  51. CGUITexture m_guiRight;
  52. CGUITexture m_guiOverlay;
  53. CRect m_guiMidClipRect;
  54. int m_iInfoCode;
  55. int m_iInfoCode2 = 0;
  56. float m_fPercent;
  57. float m_fPercent2 = 0.0f;
  58. bool m_bReveal;
  59. bool m_bChanged;
  60. };