2 // Copyright (C) 2007 Christoph Sommer <christoph.sommer@2007.expires.deltadevelopment.de>
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
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.
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef HEADER_SUPERTUX_ADDON_ADDON_HPP
18 #define HEADER_SUPERTUX_ADDON_ADDON_HPP
24 #include "util/reader_fwd.hpp"
29 static std::unique_ptr<Addon> parse(const Reader& lisp);
30 static std::unique_ptr<Addon> parse(const std::string& fname);
32 enum Type { WORLD, WORLDMAP, LEVELSET };
35 // fields provided by the addon.zip itself
41 std::string m_license;
43 // additional fields provided for addons from an addon repository
44 std::string m_http_url;
47 // fields filled by the AddonManager
48 std::string m_install_filename;
55 std::string get_id() const { return m_id; }
57 Type get_type() const { return m_type; }
58 std::string get_title() const { return m_title; }
59 std::string get_author() const { return m_author; }
60 std::string get_license() const { return m_license; }
62 std::string get_http_url() const { return m_http_url; }
63 std::string get_md5() const { return m_md5; }
65 std::string get_filename() const;
66 std::string get_install_filename() const;
68 bool is_installed() const;
69 bool is_enabled() const;
71 void set_install_filename(const std::string& absolute_filename);
72 void set_enabled(bool v);
75 Addon(const Addon&) = delete;
76 Addon& operator=(const Addon&) = delete;