Public Member Functions | Private Attributes

NetworkContentDownloadStatusWindow Struct Reference

Window for showing the download status of content. More...

Inheritance diagram for NetworkContentDownloadStatusWindow:
Window ContentCallback ZeroedMemoryAllocator

Public Member Functions

 NetworkContentDownloadStatusWindow ()
 Create a new download window based on a list of content information with flags whether to download them or not.
 ~NetworkContentDownloadStatusWindow ()
 Free whatever we've allocated.
virtual void DrawWidget (const Rect &r, int widget) const
virtual void OnClick (Point pt, int widget, int click_count)
virtual void OnDownloadProgress (const ContentInfo *ci, int bytes)
 We have progress in the download of a file.

Private Attributes

ClientNetworkContentSocketHandlerconnection
 Our connection with the content server.
SmallVector< ContentType, 4 > receivedTypes
 Types we received so we can update their cache.
uint total_files
 Number of files to download.
uint downloaded_files
 Number of files downloaded.
uint total_bytes
 Number of bytes to download.
uint downloaded_bytes
 Number of bytes downloaded.
uint32 cur_id
 The current ID of the downloaded file.
char name [48]
 The current name of the downloaded file.

Detailed Description

Window for showing the download status of content.

Definition at line 57 of file network_content_gui.cpp.


Constructor & Destructor Documentation

NetworkContentDownloadStatusWindow::NetworkContentDownloadStatusWindow (  )  [inline]

Create a new download window based on a list of content information with flags whether to download them or not.

Parameters:
infos the list to search in

Definition at line 76 of file network_content_gui.cpp.

References _network_content_download_status_window_desc, ClientNetworkContentSocketHandler::AddCallback(), FindWindowById(), Window::InitNested(), Window::parent, total_bytes, and total_files.


Member Function Documentation

virtual void NetworkContentDownloadStatusWindow::OnDownloadProgress ( const ContentInfo ci,
int  bytes 
) [inline, virtual]

We have progress in the download of a file.

Parameters:
ci the content info of the file
bytes the number of bytes downloaded since the previous call

Reimplemented from ContentCallback.

Definition at line 178 of file network_content_gui.cpp.

References cur_id, downloaded_bytes, downloaded_files, ContentInfo::filename, ContentInfo::id, SmallVector< T, S >::Include(), lastof, name, receivedTypes, Window::SetDirty(), strecpy(), total_bytes, and ContentInfo::type.


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