#pragma once // Spec: FR-CLI-02. Screen ids reachable with --screen. Each area registers its screens. #include #include #include #include #include "ui/Navigation.hpp" namespace dp { class ScreenRegistry { public: using Factory = std::function; // `needsLogin`: the harness signs in with the mock user first. void add(const std::string& id, Factory factory, bool needsLogin = false); ui::ScreenPtr make(const std::string& id) const; bool needsLogin(const std::string& id) const; std::vector ids() const; static ScreenRegistry& instance(); private: struct Entry { Factory factory; bool needsLogin = false; }; std::map entries_; }; // Implemented by the owners of each area (see src/screens/*/Register.cpp). void registerFeedScreens(ScreenRegistry& registry); void registerComposeScreens(ScreenRegistry& registry); void registerSocialScreens(ScreenRegistry& registry); void registerAppScreens(ScreenRegistry& registry); } // namespace dp