#pragma once #include "main/NekoGui.hpp" #include "ProxyEntity.hpp" #include "Group.hpp" namespace NekoGui { class ProfileManager : public JsonStore { public: // Manager QMap> profiles; QMap> groups; // JSON QList _profiles; QList _groups; // with order ProfileManager(); [[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: void LoadManager(); void SaveManager(); [[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