Add source code.
This commit is contained in:
1 parent
dab19ace02
commit
0b8a7b3cdc
31 files changed
+2809
No files matched your search
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include <ctime>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
#include "Database.h"
|
||||
#include "Status.h"
|
||||
|
||||
enum class AccountLevel { Busy, 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<StatusKind> hiddenTaskLevels;
|
||||
std::set<AccountLevel> 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_;
|
||||
};
|
||||
Reference in new issue
Block a user