ScummVM API documentation
downloaddialog.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GUI_DOWNLOADDIALOG_H
23 #define GUI_DOWNLOADDIALOG_H
24 
25 #include "gui/dialog.h"
26 #include "common/str.h"
27 #include "common/ustr.h"
28 
29 namespace GUI {
30 class LauncherDialog;
31 
32 class CommandSender;
33 class EditTextWidget;
34 class StaticTextWidget;
35 class ButtonWidget;
36 class SliderWidget;
37 class BrowserDialog;
38 class RemoteBrowserDialog;
39 
40 enum DownloadProgress {
41  kDownloadProgressCmd = 'DLPR',
42  kDownloadEndedCmd = 'DLEN'
43 };
44 
45 class DownloadDialog : public Dialog {
46  LauncherDialog *_launcher;
47  BrowserDialog *_browser;
48  RemoteBrowserDialog *_remoteBrowser;
49 
50  StaticTextWidget *_remoteDirectoryLabel;
51  StaticTextWidget *_localDirectoryLabel;
52  StaticTextWidget *_percentLabel;
53  StaticTextWidget *_downloadSizeLabel;
54  StaticTextWidget *_downloadSpeedLabel;
55  SliderWidget *_progressBar;
56  ButtonWidget *_cancelButton;
57  ButtonWidget *_closeButton;
58 
59  Common::Path _localDirectory;
60  bool _close;
61 
62  Common::U32String getSizeLabelText();
63  Common::U32String getSpeedLabelText();
64 
65  void refreshWidgets();
66  bool selectDirectories();
67 
68 public:
69  DownloadDialog(uint32 storageId, LauncherDialog *launcher);
70  ~DownloadDialog() override;
71 
72  void open() override;
73  void close() override;
74  void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
75  void handleTickle() override;
76  void reflowLayout() override;
77 };
78 
79 } // End of namespace GUI
80 
81 #endif
Definition: launcher.h:107
Definition: path.h:52
Definition: widget.h:205
Definition: widget.h:405
Definition: system.h:46
Definition: downloaddialog.h:45
Definition: ustr.h:57
Definition: browser.h:36
Definition: dialog.h:49
Definition: remotebrowser.h:38
Definition: widget.h:233
Definition: object.h:40