modstatemodel.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * modstatemodel.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "modstate.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. class JsonNode;
  14. class ModManager;
  15. VCMI_LIB_NAMESPACE_END
  16. /// Class that represent current state of available mods
  17. /// Provides Qt-based interface to library class ModManager
  18. class ModStateModel
  19. {
  20. std::unique_ptr<JsonNode> repositoryData;
  21. std::unique_ptr<ModManager> modManager;
  22. public:
  23. ModStateModel();
  24. ~ModStateModel();
  25. void appendRepositories(const JsonNode & repositoriesList);
  26. const JsonNode & getRepositoryData() const;
  27. ModState getMod(QString modName) const;
  28. QStringList getAllMods() const;
  29. QStringList getSubmods(QString modName) const;
  30. bool isModExists(QString modName) const;
  31. bool isModInstalled(QString modName) const;
  32. bool isModEnabled(QString modName) const;
  33. bool isModUpdateAvailable(QString modName) const;
  34. bool isModVisible(QString modName) const;
  35. };