OpenTTD Source  20241108-master-g80f628063a
ContentCallback Struct Reference

Callbacks for notifying others about incoming data. More...

#include <network_content.h>

Inheritance diagram for ContentCallback:
BaseNetworkContentDownloadStatusWindow BootstrapAskForDownloadWindow ClientNetworkContentSocketHandler ConsoleContentCallback NetworkContentListWindow BootstrapContentDownloadStatusWindow NetworkContentDownloadStatusWindow

Public Member Functions

virtual void OnConnect ([[maybe_unused]] bool success)
 Callback for when the connection has finished. More...
 
virtual void OnDisconnect ()
 Callback for when the connection got disconnected.
 
virtual void OnReceiveContentInfo ([[maybe_unused]] const ContentInfo *ci)
 We received a content info. More...
 
virtual void OnDownloadProgress ([[maybe_unused]] const ContentInfo *ci, [[maybe_unused]] int bytes)
 We have progress in the download of a file. More...
 
virtual void OnDownloadComplete ([[maybe_unused]] ContentID cid)
 We have finished downloading a file. More...
 
virtual ~ContentCallback ()=default
 Silentium.
 

Detailed Description

Callbacks for notifying others about incoming data.

Definition at line 29 of file network_content.h.

Member Function Documentation

◆ OnConnect()

virtual void ContentCallback::OnConnect ( [[maybe_unused] ] bool  success)
inlinevirtual

Callback for when the connection has finished.

Parameters
successwhether the connection was made or that we failed to make it

Definition at line 34 of file network_content.h.

◆ OnDownloadComplete()

virtual void ContentCallback::OnDownloadComplete ( [[maybe_unused] ] ContentID  cid)
inlinevirtual

We have finished downloading a file.

Parameters
cidthe ContentID of the downloaded file

Definition at line 58 of file network_content.h.

◆ OnDownloadProgress()

virtual void ContentCallback::OnDownloadProgress ( [[maybe_unused] ] const ContentInfo ci,
[[maybe_unused] ] int  bytes 
)
inlinevirtual

We have progress in the download of a file.

Parameters
cithe content info of the file
bytesthe number of bytes downloaded since the previous call

Definition at line 52 of file network_content.h.

◆ OnReceiveContentInfo()

virtual void ContentCallback::OnReceiveContentInfo ( [[maybe_unused] ] const ContentInfo ci)
inlinevirtual

We received a content info.

Parameters
cithe content info

Definition at line 45 of file network_content.h.


The documentation for this struct was generated from the following file: