2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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 /** @file network_content_gui.h User interface for downloading files. */
10 #ifndef NETWORK_CONTENT_GUI_H
11 #define NETWORK_CONTENT_GUI_H
13 #include "network_content.h"
14 #include "../window_gui.h"
15 #include "../widgets/network_content_widget.h"
17 /** Base window for showing the download status of content */
18 class BaseNetworkContentDownloadStatusWindow
: public Window
, ContentCallback
{
20 uint total_bytes
; ///< Number of bytes to download
21 uint downloaded_bytes
; ///< Number of bytes downloaded
22 uint total_files
; ///< Number of files to download
23 uint downloaded_files
; ///< Number of files downloaded
25 uint32_t cur_id
; ///< The current ID of the downloaded file
26 std::string name
; ///< The current name of the downloaded file
30 * Create the window with the given description.
31 * @param desc The description of the window.
33 BaseNetworkContentDownloadStatusWindow(WindowDesc
&desc
);
35 void Close([[maybe_unused
]] int data
= 0) override
;
36 void UpdateWidgetSize(WidgetID widget
, Dimension
&size
, [[maybe_unused
]] const Dimension
&padding
, [[maybe_unused
]] Dimension
&fill
, [[maybe_unused
]] Dimension
&resize
) override
;
37 void DrawWidget(const Rect
&r
, WidgetID widget
) const override
;
38 void OnDownloadProgress(const ContentInfo
*ci
, int bytes
) override
;
41 void BuildContentTypeStringList();
43 #endif /* NETWORK_CONTENT_GUI_H */