cpp-terminal 1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
focus.hpp
Go to the documentation of this file.
1/*
2* cpp-terminal
3* C++ library for writing multi-platform terminal applications.
4*
5* SPDX-FileCopyrightText: 2019-2024 cpp-terminal
6*
7* SPDX-License-Identifier: MIT
8*/
9
10#pragma once
11
12#include <cstdint>
13
14namespace Term
15{
16
21class Focus
22{
23public:
24 enum class Type : std::int8_t
25 {
26 Unknown = -1,
27 Out = 0,
28 In = 1,
29 };
30
31 Focus() = default;
32
33 explicit Focus(const Term::Focus::Type& type);
34
40 Term::Focus::Type type() const;
41
48 bool in() const;
49
56 bool out() const;
57
58 bool operator==(const Term::Focus& focus) const;
59 bool operator!=(const Term::Focus& focus) const;
60
61private:
63};
64
65} // namespace Term
Class to return the focus of the terminal.
Definition focus.hpp:22
Term::Focus::Type m_focus
Definition focus.hpp:62
Focus()=default
bool in() const
Check is the focus is in.
Definition focus.cpp:19
bool operator!=(const Term::Focus &focus) const
Definition focus.cpp:25
@ Out
The terminal focus is out.
@ Unknown
The terminal focus is unknown.
@ In
The terminal focus is in.
bool operator==(const Term::Focus &focus) const
Definition focus.cpp:23
Term::Focus::Type type() const
Get the type of focus.
Definition focus.cpp:17
bool out() const
Check is the focus is out.
Definition focus.cpp:21
Definition args.cpp:13