PageRenderTime 28ms CodeModel.GetById 13ms app.highlight 9ms RepoModel.GetById 2ms app.codeStats 0ms

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