1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 03:05:07 +00:00
serenity/Libraries/LibProtocol/Client.h
Andreas Kling 5d4ee0f58a LibIPC: Move IPC client/server connection templates to LibIPC
Move over the CoreIPC::Server and CoreIPC::Client namespace stuff
into LibIPC where it will soon becomes LibIPC-style things.
2019-12-02 11:11:05 +01:00

31 lines
786 B
C++

#pragma once
#include <LibIPC/IServerConnection.h>
#include <ProtocolServer/ProtocolClientEndpoint.h>
#include <ProtocolServer/ProtocolServerEndpoint.h>
namespace LibProtocol {
class Download;
class Client : public IPC::Client::ConnectionNG<ProtocolClientEndpoint, ProtocolServerEndpoint>
, public ProtocolClientEndpoint {
C_OBJECT(Client)
public:
Client();
virtual void handshake() override;
bool is_supported_protocol(const String&);
RefPtr<Download> start_download(const String& url);
bool stop_download(Badge<Download>, Download&);
private:
virtual void handle(const ProtocolClient::DownloadProgress&) override;
virtual void handle(const ProtocolClient::DownloadFinished&) override;
HashMap<i32, RefPtr<Download>> m_downloads;
};
}