/xbmc/dialogs/GUIDialogCache.h

http://github.com/xbmc/xbmc · C Header · 46 lines · 29 code · 10 blank · 7 comment · 0 complexity · e2423ccec3bbf7ac7ff2a3b25f0e2c7b 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. #include "filesystem/File.h"
  10. #include "threads/SystemClock.h"
  11. #include "threads/Thread.h"
  12. #include <string>
  13. class CGUIDialogProgress;
  14. class CGUIDialogCache : public CThread, public XFILE::IFileCallback
  15. {
  16. public:
  17. CGUIDialogCache(DWORD dwDelay = 0, const std::string& strHeader="", const std::string& strMsg="");
  18. ~CGUIDialogCache() override;
  19. void SetHeader(const std::string& strHeader);
  20. void SetHeader(int nHeader);
  21. void SetMessage(const std::string& strMessage);
  22. bool IsCanceled() const;
  23. void ShowProgressBar(bool bOnOff);
  24. void SetPercentage(int iPercentage);
  25. void Close(bool bForceClose = false);
  26. void Process() override;
  27. bool OnFileCallback(void* pContext, int ipercent, float avgSpeed) override;
  28. protected:
  29. void OpenDialog();
  30. XbmcThreads::EndTime m_endtime;
  31. CGUIDialogProgress* m_pDlg;
  32. std::string m_strHeader;
  33. std::string m_strLinePrev;
  34. std::string m_strLinePrev2;
  35. bool bSentCancel;
  36. };