Molybden API
Loading...
Searching...
No Matches
download_events.hpp
1// Copyright (c) 2000-2024 TeamDev. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_DOWNLOAD_EVENTS_HPP
6#define MOLYBDEN_DOWNLOAD_EVENTS_HPP
7
8#include <string>
9
10#include "molybden/base/event.hpp"
11
12namespace molybden {
13
14class Download;
15
23 std::shared_ptr<Download> download;
24};
25
33 std::shared_ptr<Download> download;
34};
35
39enum class DownloadInterruptReason {
40 kUnspecified,
41
45 kUnknown,
46
50 kFileFailed,
51
55 kFileAccessDenied,
56
60 kFileNoSpace,
61
65 kFileNameTooLong,
66
70 kFileTooLarge,
71
75 kFileVirusInfected,
76
82 kFileTransientError,
83
87 kFileBlocked,
88
93 kFileSecurityCheckFailed,
94
99 kFileTooShort,
100
104 kFileHashMismatch,
105
109 kFileSameAsSource,
110
114 kNetworkFailed,
115
119 kNetworkTimeout,
120
124 kNetworkDisconnected,
125
129 kNetworkServerDown,
130
140 kNetworkInvalidRequest,
141
145 kServerFailed,
146
150 kServerNoRange,
151
155 kServerBadContent,
156
160 kServerUnauthorized,
161
165 kServerCertProblem,
166
170 kServerForbidden,
171
176 kServerUnreachable,
177
184 kServerContentLengthMismatch,
185
189 kUserCanceled,
190
194 kUserShutdown,
195
199 kCrash
200};
201
209 std::shared_ptr<Download> download;
210
214 DownloadInterruptReason reason;
215};
216
224 std::shared_ptr<Download> download;
225};
226
234 std::shared_ptr<Download> download;
235
240
244 int64_t total_bytes;
245
250
256};
257
318
319} // namespace molybden
320
321#endif // MOLYBDEN_DOWNLOAD_EVENTS_HPP
A class that contains all download events.
Definition download_events.hpp:261
Event< DownloadCanceled > onDownloadCanceled
Invoked when the download has been canceled.
Definition download_events.hpp:283
Event< DownloadPaused > onDownloadPaused
Invoked when the download has been paused.
Definition download_events.hpp:305
Event< DownloadUpdated > onDownloadUpdated
Invoked when the download has been updated.
Definition download_events.hpp:316
Event< DownloadInterrupted > onDownloadInterrupted
Invoked when the download has been interrupted.
Definition download_events.hpp:294
Event< DownloadFinished > onDownloadFinished
Invoked when the download has been finished.
Definition download_events.hpp:272
Events allow you to be notified when something happens in Molybden.
Definition event.hpp:25
The DownloadEvents::onDownloadCanceled event arguments.
Definition download_events.hpp:29
std::shared_ptr< Download > download
The download instance initiated this event.
Definition download_events.hpp:33
The DownloadEvents::onDownloadFinished event arguments.
Definition download_events.hpp:19
std::shared_ptr< Download > download
The download instance initiated this event.
Definition download_events.hpp:23
The DownloadEvents::onDownloadInterrupted event arguments.
Definition download_events.hpp:205
DownloadInterruptReason reason
The interrupt reason of this download.
Definition download_events.hpp:214
std::shared_ptr< Download > download
The download instance initiated this event.
Definition download_events.hpp:209
The DownloadEvents::onDownloadPaused event arguments.
Definition download_events.hpp:220
std::shared_ptr< Download > download
The download instance initiated this event.
Definition download_events.hpp:224
The DownloadEvents::onDownloadUpdated event arguments.
Definition download_events.hpp:230
int percent_complete
The rough percent complete.
Definition download_events.hpp:255
std::shared_ptr< Download > download
The download instance initiated this event.
Definition download_events.hpp:234
int64_t total_bytes
The total size of the downloaded file in bytes.
Definition download_events.hpp:244
int64_t received_bytes
The number or received (downloaded) bytes.
Definition download_events.hpp:249
int64_t current_speed
The current download speed estimate in bytes/second.
Definition download_events.hpp:239