Ditto 4.8.0
Loading...
Searching...
No Matches
AttachmentFetchEvent.hpp
1#ifndef _DITTO_ATTACHMENT_FETCH_EVENT_
2#define _DITTO_ATTACHMENT_FETCH_EVENT_
3
4#include "Attachment.hpp"
5
6namespace ditto {
10enum class AttachmentFetchEventType {
11 Completed,
12 Progress,
13 Deleted,
14};
15
21 friend struct AttachmentFetchEventProgress;
22 friend struct AttachmentFetchEventDeleted;
23
27 AttachmentFetchEventType type;
28
29public: // Public virtual destructor to allow unique_ptr upcasting.
30 virtual ~AttachmentFetchEvent() = default;
31
32private:
33 explicit AttachmentFetchEvent(AttachmentFetchEventType type);
34};
35
51
57 friend class AttachmentFetcher;
58
64
68 uint64_t total_bytes;
69
70private:
72};
73
78 friend class AttachmentFetcher;
79
80private:
81 explicit AttachmentFetchEventDeleted(); // NOLINT(modernize-use-equals-delete)
82};
83
84} // namespace ditto
85#endif
These objects are returned by calls to Store::fetch_attachment.
Definition AttachmentFetcher.hpp:28
Represents an attachment and can be used to insert the associated attachment into a document at a spe...
Definition Attachment.hpp:22
An attachment fetch event used when the attachment's download has completed.
Definition AttachmentFetchEvent.hpp:40
Attachment attachment
The successfully fetched attachment.
Definition AttachmentFetchEvent.hpp:46
An attachment fetch event used when the attachment is deleted.
Definition AttachmentFetchEvent.hpp:77
The different types of attachment fetch events that can be delivered.
Definition AttachmentFetchEvent.hpp:19
AttachmentFetchEventType type
The type of the attachment fetch event.
Definition AttachmentFetchEvent.hpp:27
An attachment fetch event used when the attachment's download has progressed but is not yet complete.
Definition AttachmentFetchEvent.hpp:56
uint64_t total_bytes
Gets the full size of the attachment, if it were complete.
Definition AttachmentFetchEvent.hpp:68
uint64_t downloaded_bytes
Gets the size of the attachment that was successfully downloaded, in bytes.
Definition AttachmentFetchEvent.hpp:63