34 lines
870 B
C++
34 lines
870 B
C++
#pragma once
|
|
|
|
#include <ctime>
|
|
#include <set>
|
|
#include <string>
|
|
|
|
#include "Database.h"
|
|
#include "Status.h"
|
|
#include "Views.h"
|
|
|
|
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<StatusKind> hiddenTaskLevels;
|
|
std::set<AccountLevel> hiddenAccountLevels;
|
|
};
|
|
|
|
// Renders the task and account panels as text tables, from the computed views
|
|
// (see Views.h), honouring the hidden levels in the settings.
|
|
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_;
|
|
};
|