SuperTuxKart
download_assets.hpp
1 // SuperTuxKart - a fun racing game with go-kart
2 // Copyright (C) 2019 SuperTuxKart-Team
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 3
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 
18 #ifndef HEADER_DOWNLOAD_ASSETS_HPP
19 #define HEADER_DOWNLOAD_ASSETS_HPP
20 
21 #ifdef MOBILE_STK
22 
23 #include "guiengine/modaldialog.hpp"
24 #include "utils/cpp2011.hpp"
25 
26 class DownloadAssetsRequest;
27 namespace GUIEngine { class IconButtonWidget; class ProgressBarWidget; }
28 
32 class DownloadAssets : public GUIEngine::ModalDialog
33 {
34 private:
35  GUIEngine::ProgressBarWidget *m_progress;
36  GUIEngine::IconButtonWidget *m_install_button;
37 
38  void startDownload();
39  void stopDownload();
40  void doInstall();
41 
44  std::shared_ptr<DownloadAssetsRequest> m_download_request;
45 
46 public:
47  DownloadAssets();
48  ~DownloadAssets();
49 
50  virtual GUIEngine::EventPropagation processEvent(const std::string& event_source) OVERRIDE;
51  virtual void beforeAddingWidgets() OVERRIDE;
52  virtual void init() OVERRIDE;
53  void onUpdate(float delta) OVERRIDE;
54  virtual bool onEscapePressed() OVERRIDE;
55 }; // DownloadAssets
56 
57 #endif
58 
59 #endif
A button widget with an icon and optionnaly a label beneath.
Definition: icon_button_widget.hpp:44
Abstract base class representing a modal dialog.
Definition: modaldialog.hpp:56
virtual void beforeAddingWidgets()
Optional callback invoked very early, before widgets have been added (contrast with init(),...
Definition: modaldialog.hpp:126
virtual EventPropagation processEvent(const std::string &eventSource)
Returns whether to block event propagation (usually, you will want to block events you processed)
Definition: modaldialog.hpp:101
A progress bar widget.
Definition: progress_bar_widget.hpp:36
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33