OpenTTD

network_content_gui.h
Go to the documentation of this file.
1 /* $Id: network_content_gui.h 27288 2015-05-17 19:49:35Z michi_cc $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9
12 #ifndef NETWORK_CONTENT_GUI_H
13 #define NETWORK_CONTENT_GUI_H
14
15 #include "network_content.h"
16 #include "../window_gui.h"
17 #include "../widgets/network_content_widget.h"
18
20 class BaseNetworkContentDownloadStatusWindow : public Window, ContentCallback {
21 protected:
22 uint total_bytes;
23 uint downloaded_bytes;
24 uint total_files;
25 uint downloaded_files;
26
27 uint32 cur_id;
28 char name[48];
29
30 public:
35 BaseNetworkContentDownloadStatusWindow(WindowDesc *desc);
36
40 ~BaseNetworkContentDownloadStatusWindow();
41
42 virtual void DrawWidget(const Rect &r, int widget) const;
43 virtual void OnDownloadProgress(const ContentInfo *ci, int bytes);
44 };
45
46 void BuildContentTypeStringList();
47
48 #endif /* NETWORK_CONTENT_GUI_H */
BuildContentTypeStringList
void BuildContentTypeStringList()
Build array of all strings corresponding to the content types.
Definition: network_content_gui.cpp:1045
BaseNetworkContentDownloadStatusWindow::~BaseNetworkContentDownloadStatusWindow
~BaseNetworkContentDownloadStatusWindow()
Free everything associated with this window.
Definition: network_content_gui.cpp:114
WindowDesc
High level window description.
Definition: window_gui.h:168
ContentCallback
Callbacks for notifying others about incoming data.
Definition: network_content.h:31
Window
Data structure for an opened window.
Definition: window_gui.h:271
BaseNetworkContentDownloadStatusWindow::DrawWidget
virtual void DrawWidget(const Rect &r, int widget) const
Draw the contents of a nested widget.
Definition: network_content_gui.cpp:119
network_content.h
Part of the network protocol handling content distribution.
BaseNetworkContentDownloadStatusWindow::OnDownloadProgress
virtual void OnDownloadProgress(const ContentInfo *ci, int bytes)
We have progress in the download of a file.
Definition: network_content_gui.cpp:148
BaseNetworkContentDownloadStatusWindow::total_bytes
uint total_bytes
Number of bytes to download.
Definition: network_content_gui.h:22
BaseNetworkContentDownloadStatusWindow::name
char name[48]
The current name of the downloaded file.
Definition: network_content_gui.h:28
BaseNetworkContentDownloadStatusWindow::downloaded_files
uint downloaded_files
Number of files downloaded.
Definition: network_content_gui.h:25
BaseNetworkContentDownloadStatusWindow::total_files
uint total_files
Number of files to download.
Definition: network_content_gui.h:24
BaseNetworkContentDownloadStatusWindow::downloaded_bytes
uint downloaded_bytes
Number of bytes downloaded.
Definition: network_content_gui.h:23
Rect
Specification of a rectangle with absolute coordinates of all edges.
Definition: geometry_type.hpp:40
BaseNetworkContentDownloadStatusWindow::BaseNetworkContentDownloadStatusWindow
BaseNetworkContentDownloadStatusWindow(WindowDesc *desc)
Create the window with the given description.
Definition: network_content_gui.cpp:105
BaseNetworkContentDownloadStatusWindow
Base window for showing the download status of content.
Definition: network_content_gui.h:20
BaseNetworkContentDownloadStatusWindow::cur_id
uint32 cur_id
The current ID of the downloaded file.
Definition: network_content_gui.h:27
ContentInfo
Container for all important information about a piece of content.
Definition: tcp_content.h:58