OpenTTD Source 20261112-master-gbcbec5e63f
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 (bool success)
 Callback for when the connection has finished.
virtual void OnDisconnect ()
 Callback for when the connection got disconnected.
virtual void OnReceiveContentInfo (const ContentInfo &ci)
 We received a content info.
virtual void OnDownloadProgress (const ContentInfo &ci, int64_t bytes)
 We have progress in the download of a file.
virtual void OnDownloadComplete (ContentID cid)
 We have finished downloading a file.
virtual ~ContentCallback ()=default
 Ensure the destructor of the sub classes are called as well.

Detailed Description

Callbacks for notifying others about incoming data.

Definition at line 27 of file network_content.h.

Member Function Documentation

◆ OnConnect()

virtual void ContentCallback::OnConnect ( bool success)
inlinevirtual

Callback for when the connection has finished.

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

Reimplemented in BootstrapAskForDownloadWindow, ClientNetworkContentSocketHandler, ConsoleContentCallback, and NetworkContentListWindow.

Definition at line 32 of file network_content.h.

Referenced by ClientNetworkContentSocketHandler::OnConnect().

◆ OnDisconnect()

virtual void ContentCallback::OnDisconnect ( )
inlinevirtual

Callback for when the connection got disconnected.

Reimplemented in ClientNetworkContentSocketHandler, and ConsoleContentCallback.

Definition at line 37 of file network_content.h.

Referenced by ClientNetworkContentSocketHandler::OnDisconnect().

◆ OnDownloadComplete()

virtual void ContentCallback::OnDownloadComplete ( ContentID cid)
inlinevirtual

We have finished downloading a file.

Parameters
cidthe ContentID of the downloaded file

Reimplemented in BootstrapContentDownloadStatusWindow, ClientNetworkContentSocketHandler, ConsoleContentCallback, and NetworkContentListWindow.

Definition at line 56 of file network_content.h.

Referenced by ClientNetworkContentSocketHandler::OnDownloadComplete().

◆ OnDownloadProgress()

virtual void ContentCallback::OnDownloadProgress ( const ContentInfo & ci,
int64_t 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

Reimplemented in BaseNetworkContentDownloadStatusWindow, ClientNetworkContentSocketHandler, and NetworkContentDownloadStatusWindow.

Definition at line 50 of file network_content.h.

Referenced by ClientNetworkContentSocketHandler::OnDownloadProgress().

◆ OnReceiveContentInfo()

virtual void ContentCallback::OnReceiveContentInfo ( const ContentInfo & ci)
inlinevirtual

We received a content info.

Parameters
cithe content info

Reimplemented in BootstrapAskForDownloadWindow, ClientNetworkContentSocketHandler, and NetworkContentListWindow.

Definition at line 43 of file network_content.h.

Referenced by ClientNetworkContentSocketHandler::OnReceiveContentInfo().


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