#pragma once #include #include #include #include "Database.h" #include "Status.h" // How taken an account is, judged by its tasks: // Free - only Done, Frozen or Uploading tasks, or no tasks // Taken - has a Prompt task (and nothing Busy) // Busy - has a Testing, Limit reset or Wait task enum class AccountLevel { Busy, Taken, Free }; std::string accountLevelName(AccountLevel level); // "busy", "taken", "free" struct DisplaySettings { bool showTasks = true; // auto-print the task table after each change bool showAccounts = true; // auto-print the account table after each change std::set hiddenTaskLevels; std::set hiddenAccountLevels; }; // Builds the computed views. The status shown is derived from the stored // status and the current time, never copied straight from the database. class Display { public: explicit Display(const Database& db); DisplaySettings& settings(); const DisplaySettings& settings() const; std::string renderTasks(std::time_t now) const; std::string renderAccounts(std::time_t now) const; private: const Database& db_; DisplaySettings settings_; };