SuperTuxKart
Loading...
Searching...
No Matches
addons_pack.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_ADDONS_PACK_HPP
19#define HEADER_ADDONS_PACK_HPP
20
21#include "guiengine/widgets.hpp"
22#include "guiengine/modaldialog.hpp"
23#include "utils/cpp2011.hpp"
24
26
31{
32private:
34
36
37 void stopDownload();
38
41 std::shared_ptr<AddonsPackRequest> m_download_request;
42 AddonsPack(const std::string& url);
44public:
45 virtual GUIEngine::EventPropagation processEvent(const std::string& event_source) OVERRIDE;
46 virtual void beforeAddingWidgets() OVERRIDE;
47 virtual void init() OVERRIDE;
48 void onUpdate(float delta) OVERRIDE;
49 virtual bool onEscapePressed() OVERRIDE;
50 static void install(const std::string& name);
51 static void uninstall(const std::string& name, bool force_remove_skin = false);
52 static void uninstallByName(const std::string& name, bool force_clear = false);
53}; // DownloadAssets
54
55#endif
Definition: addons_pack.cpp:46
Definition: addons_pack.hpp:31
void onUpdate(float delta) OVERRIDE
Override to be notified of updates.
Definition: addons_pack.cpp:199
virtual GUIEngine::EventPropagation processEvent(const std::string &event_source) OVERRIDE
Returns whether to block event propagation (usually, you will want to block events you processed)
Definition: addons_pack.cpp:172
void stopDownload()
This function is called when the user click on 'Back', 'Cancel' or press escape.
Definition: addons_pack.cpp:240
std::shared_ptr< AddonsPackRequest > m_download_request
A pointer to the download request, which gives access to the progress of a download.
Definition: addons_pack.hpp:41
virtual void init() OVERRIDE
Optional callback invoked after widgets have been add()ed.
Definition: addons_pack.cpp:159
virtual bool onEscapePressed() OVERRIDE
Override to change what happens on escape pressed.
Definition: addons_pack.cpp:165
virtual void beforeAddingWidgets() OVERRIDE
Optional callback invoked very early, before widgets have been added (contrast with init(),...
Definition: addons_pack.cpp:153
A simple label widget.
Definition: label_widget.hpp:36
Abstract base class representing a modal dialog.
Definition: modaldialog.hpp:56
A progress bar widget.
Definition: progress_bar_widget.hpp:36