18#ifndef LIBJAMI_DATATRANSFERI_H
19#define LIBJAMI_DATATRANSFERI_H
34 const std::map<std::string, std::shared_ptr<CallbackWrapperBase>>&);
69 DataTransferEventCode::invalid};
71 int64_t totalSize {0};
72 int64_t bytesProgress {0};
110 const std::string& conversationId,
111 const std::string& path,
112 const std::string& displayName,
113 const std::string& replyTo)
noexcept;
124 const std::string& conversationId,
125 const std::string& interactionId,
126 const std::string& fileId,
127 const std::string& path)
noexcept;
142 const std::string& conversationId,
155 const std::string& conversationId,
156 const std::string& fileId,
159 int64_t& progress)
noexcept;
166 constexpr static const char* name =
"DataTransferEvent";
167 using cb_type = void(
const std::string& accountId,
168 const std::string& conversationId,
169 const std::string& interactionId,
170 const std::string& fileId,
direction
0: outgoing, 1: incoming
enum LIBJAMI_PUBLIC enum LIBJAMI_PUBLIC DataTransferError
DataTransferError cancelDataTransfer(const std::string &accountId, const std::string &conversationId, const std::string &fileId) noexcept
Refuse or abort an outgoing or an incoming file transfer.
enum LIBJAMI_PUBLIC wait_host_acceptance
enum LIBJAMI_PUBLIC finished
enum LIBJAMI_PUBLIC enum LIBJAMI_PUBLIC invalid_argument
DataTransferError fileTransferInfo(const std::string &accountId, const std::string &conversationId, const std::string &fileId, std::string &path, int64_t &total, int64_t &progress) noexcept
Return the amount of sent/received bytes of an existing data transfer.
enum LIBJAMI_PUBLIC unsupported
void sendFile(const std::string &accountId, const std::string &conversationId, const std::string &path, const std::string &displayName, const std::string &replyTo) noexcept
Asynchronously send a file to a peer using given account connection.
bool downloadFile(const std::string &accountId, const std::string &conversationId, const std::string &interactionId, const std::string &fileId, const std::string &path) noexcept
Asks for retransferring a file.
enum LIBJAMI_PUBLIC created
enum LIBJAMI_PUBLIC wait_peer_acceptance
enum LIBJAMI_PUBLIC closed_by_host
enum LIBJAMI_PUBLIC closed_by_peer
enum LIBJAMI_PUBLIC enum LIBJAMI_PUBLIC io
enum LIBJAMI_PUBLIC unjoinable_peer
enum LIBJAMI_PUBLIC timeout_expired
void registerDataXferHandlers(const std::map< std::string, std::shared_ptr< CallbackWrapperBase > > &handlers)
enum LIBJAMI_PUBLIC enum LIBJAMI_PUBLIC unknown
enum LIBJAMI_PUBLIC ongoing
enum LIBJAMI_PUBLIC DataTransferEventCode
enum LIBJAMI_PUBLIC invalid_pathname
std::string conversationId
std::string accountId
Identifier of the emiter/receiver account.
std::string mimetype
MimeType of transferred data (https://www.iana.org/assignments/media-types/media-types....
std::string peer
Identifier of the remote peer (in the semantic of the associated account)
std::string displayName
Human oriented transfer name.
std::string path
associated local file path if supported (empty, if not)
void(const std::string &accountId, const std::string &conversationId, const std::string &interactionId, const std::string &fileId, int eventCode) cb_type