aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/status_manager.hpp
blob: 9c7234e694db96eddf3185b034c27ff094d50dc4 (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
#pragma once

#include "interfaces/statusline.hpp"

#include <yacppdic/factory.hpp>

#include <memory>
#include <string_view>

// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
class IStatusManager
{
public:
	virtual ~IStatusManager() = default;

	virtual void initialize() noexcept = 0;

	virtual void set_section_title(
		const StatusLineSection &section,
		const std::string_view &title) noexcept = 0;

	virtual void set_section_body(
		const StatusLineSection &section,
		const std::string_view &body) noexcept = 0;

	[[nodiscard]] virtual auto get_statusline() const noexcept
		-> std::shared_ptr<IStatusLine> = 0;
};

using IStatusManagerFactory = yacppdic::Factory<std::unique_ptr<IStatusManager>(
	const std::shared_ptr<IStatusLine> &statusline)>;