2 * Copyright (C) 2012-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "guilib/GUIDialog.h"
16 class CGUIDialogProgressBarHandle
19 explicit CGUIDialogProgressBarHandle(const std::string
& strTitle
) : m_strTitle(strTitle
) {}
20 virtual ~CGUIDialogProgressBarHandle(void) = default;
22 const std::string
&Title(void) { return m_strTitle
; }
23 void SetTitle(const std::string
&strTitle
);
25 std::string
Text(void) const;
26 void SetText(const std::string
&strText
);
28 bool IsFinished(void) const { return m_bFinished
; }
29 void MarkFinished(void) { m_bFinished
= true; }
31 float Percentage(void) const { return m_fPercentage
;}
32 void SetPercentage(float fPercentage
) { m_fPercentage
= fPercentage
; }
33 void SetProgress(int currentItem
, int itemCount
);
36 mutable CCriticalSection m_critSection
;
37 float m_fPercentage
= 0;
38 std::string m_strTitle
;
39 std::string m_strText
;
40 bool m_bFinished
= false;
43 class CGUIDialogExtendedProgressBar
: public CGUIDialog
46 CGUIDialogExtendedProgressBar(void);
47 ~CGUIDialogExtendedProgressBar(void) override
= default;
48 bool OnMessage(CGUIMessage
& message
) override
;
49 void Process(unsigned int currentTime
, CDirtyRegionList
&dirtyregions
) override
;
51 CGUIDialogProgressBarHandle
*GetHandle(const std::string
&strTitle
);
54 void UpdateState(unsigned int currentTime
);
56 CCriticalSection m_critSection
;
57 unsigned int m_iCurrentItem
;
58 unsigned int m_iLastSwitchTime
;
59 std::vector
<CGUIDialogProgressBarHandle
*> m_handles
;