#pragma once #include "main/NekoGui.hpp" #include "ProxyEntity.hpp" #include "Group.hpp" namespace NekoGui { class ProfileManager : private JsonStore { public: // JsonStore // order -> id QList groupsTabOrder; // Manager std::map> profiles; std::map> groups; ProfileManager(); // LoadManager Reset and loads profiles & groups void LoadManager(); void SaveManager(); [[nodiscard]] static std::shared_ptr NewProxyEntity(const QString &type); [[nodiscard]] static std::shared_ptr NewGroup(); bool AddProfile(const std::shared_ptr &ent, int gid = -1); void DeleteProfile(int id); void MoveProfile(const std::shared_ptr &ent, int gid); std::shared_ptr GetProfile(int id); bool AddGroup(const std::shared_ptr &ent); void DeleteGroup(int gid); std::shared_ptr GetGroup(int id); std::shared_ptr CurrentGroup(); private: // sort by id QList profilesIdOrder; QList groupsIdOrder; [[nodiscard]] int NewProfileID() const; [[nodiscard]] int NewGroupID() const; static std::shared_ptr LoadProxyEntity(const QString &jsonPath); static std::shared_ptr LoadGroup(const QString &jsonPath); }; extern ProfileManager *profileManager; } // namespace NekoGui