- /**
- * Download and install Add-on
- */
- void install(Addon* addon);
-
- /**
- * Physically delete Add-on
- */
- void remove(Addon* addon);
-
- /**
- * Unload Add-on and mark as not to be loaded automatically
- */
- void disable(Addon* addon);
-
- /**
- * Load Add-on and mark as to be loaded automatically
- */
- void enable(Addon* addon);
-
- /**
- * Remove Add-on from search path
- */
- void unload(Addon* addon);
-
- /**
- * Add Add-on to search path
- */
- void load(Addon* addon);
-
- /**
- * Loads all enabled Add-ons, i.e. adds them to the search path
- */
- void load_addons();
-
- /**
- * Returns the shared AddonManager instance
- */
- static AddonManager& get_instance();
-
- /**
- * Write AddonManager configuration to Lisp
- */
- void write(lisp::Writer& writer);
-
- /**
- * Read AddonManager configuration from Lisp
- */
- void read(const Reader& lisp);
-
-protected:
- std::vector<Addon*> addons;
- std::vector<std::string> ignored_addon_filenames;
-
- AddonManager();
- ~AddonManager();
+ std::vector<AddonId> get_repository_addons() const;
+ std::vector<AddonId> get_installed_addons() const;
+
+ Addon& get_repository_addon(const AddonId& addon);
+ Addon& get_installed_addon(const AddonId& addon);
+
+ TransferStatusPtr request_install_addon(const AddonId& addon_id);
+ void install_addon(const AddonId& addon_id);
+ void uninstall_addon(const AddonId& addon_id);
+
+ void enable_addon(const AddonId& addon_id);
+ void disable_addon(const AddonId& addon_id);
+
+ void update();
+
+private:
+ std::vector<std::string> scan_for_archives() const;
+ void add_installed_addons();
+ AddonList parse_addon_infos(const std::string& filename) const;
+
+ /** add \a archive, given as physfs path, to the list of installed
+ archives */
+ void add_installed_archive(const std::string& archive, const std::string& md5);
+
+ /** search for an .nfo file in the top level directory that
+ originates from \a archive, \a archive is a OS path */
+ std::string scan_for_info(const std::string& archive) const;
+
+private:
+ AddonManager(const AddonManager&) = delete;
+ AddonManager& operator=(const AddonManager&) = delete;