PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

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