2 * Copyright (C) 2017-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 "threads/CriticalSection.h"
12 #include "threads/Thread.h"
18 class CPVRGUIProgressHandler
: private CThread
21 CPVRGUIProgressHandler() = delete;
24 * @brief Creates and asynchronously shows a progress dialog with the given title.
25 * @param strTitle The title for the progress dialog.
27 explicit CPVRGUIProgressHandler(const std::string
& strTitle
);
29 ~CPVRGUIProgressHandler() override
= default;
32 * @brief Update the progress dialogs's content.
33 * @param strText The new progress text.
34 * @param fProgress The new progress value, in a range from 0.0 to 100.0.
36 void UpdateProgress(const std::string
& strText
, float fProgress
);
39 * @brief Update the progress dialogs's content.
40 * @param strText The new progress text.
41 * @param iCurrent The new current progress value, must be less or equal iMax.
42 * @param iMax The new maximum progress value, must be greater or equal iCurrent.
44 void UpdateProgress(const std::string
& strText
, int iCurrent
, int iMax
);
47 // CThread implementation
48 void Process() override
;
51 CCriticalSection m_critSection
;
52 const std::string m_strTitle
;
53 std::string m_strText
;
54 float m_fProgress
{0.0f
};
55 bool m_bChanged
{false};
56 bool m_bCreated
{false};