1
0

DownloadViewCallback.h 909 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include <atomic>
  2. #include "Main.h"
  3. #include "Downloaded.h"
  4. #include "DownloadStatus.h"
  5. #include "DownloadsDialog.h"
  6. #include "api__ml_downloads.h"
  7. #include "api/service/waServiceFactory.h"
  8. #include "../../..\Components\wac_network\wac_network_http_receiver_api.h"
  9. class DownloadViewCallback : public ifc_downloadManagerCallback
  10. {
  11. public:
  12. DownloadViewCallback();
  13. void OnInit( DownloadToken token );
  14. void OnConnect( DownloadToken token );
  15. void OnData( DownloadToken token, void *data, size_t datalen );
  16. void OnCancel( DownloadToken token );
  17. void OnError( DownloadToken token, int error );
  18. void OnFinish( DownloadToken token );
  19. size_t AddRef();
  20. size_t Release();
  21. private: // private destructor so no one accidentally calls delete directly on this reference counted object
  22. ~DownloadViewCallback();
  23. protected:
  24. RECVS_DISPATCH;
  25. private:
  26. std::atomic<std::size_t> _ref_count = 1;
  27. };