00001 // SuperTux - Add-on Manager 00002 // Copyright (C) 2007 Christoph Sommer <christoph.sommer@2007.expires.deltadevelopment.de> 00003 // 00004 // This program is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 00017 #ifndef HEADER_SUPERTUX_ADDON_ADDON_MANAGER_HPP 00018 #define HEADER_SUPERTUX_ADDON_ADDON_MANAGER_HPP 00019 00020 #include <string> 00021 #include <vector> 00022 00023 #include "util/reader_fwd.hpp" 00024 #include "util/writer_fwd.hpp" 00025 00026 class Addon; 00027 00031 class AddonManager 00032 { 00033 public: 00037 std::vector<Addon*> get_addons(); 00038 00042 void check_online(); 00043 00047 void install(Addon* addon); 00048 00052 void remove(Addon* addon); 00053 00057 void disable(Addon* addon); 00058 00062 void enable(Addon* addon); 00063 00067 void unload(Addon* addon); 00068 00072 void load(Addon* addon); 00073 00077 void load_addons(); 00078 00082 static AddonManager& get_instance(); 00083 00087 void write(Writer& writer); 00088 00092 void read(const Reader& lisp); 00093 00094 protected: 00095 std::vector<Addon*> addons; 00096 std::vector<std::string> ignored_addon_filenames; 00097 00098 AddonManager(); 00099 ~AddonManager(); 00100 }; 00101 00102 #endif 00103 00104 /* EOF */