aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/statusline.hpp
blob: 0634d2e1feded52f2f996c42b396a5c773a202e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once

#include "interfaces/component.hpp"

#include "engine/data/bounds.hpp"
#include "engine/data/style.hpp"

#include <yacppdic/factory.hpp>

#include <memory>
#include <optional>
#include <string_view>

enum StatusLineSection
{
	A = 0,
	B = 1,
	C = 2,
	D = 3,
	E = 4,
	F = 5,
	G = 6,
	H = 7
};

// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
class IStatusLine : public IComponent
{
public:
	// NOLINTNEXTLINE(google-default-arguments)
	virtual void set_section_status(
		StatusLineSection section,
		const std::string_view &status,
		int32_t start = 1) noexcept = 0;

	virtual void
	set_section_length(StatusLineSection section, int32_t length) noexcept = 0;

	virtual void
	set_section_style(StatusLineSection section, const Style &style) noexcept = 0;
};

using IStatusLineFactory =
	yacppdic::Factory<std::unique_ptr<IStatusLine>(const Bounds &size)>;