cpp-terminal 1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
Term::Focus Class Reference

Class to return the focus of the terminal. More...

#include <cpp-terminal/focus.hpp>

Public Types

enum class  Type : std::int8_t { Unknown = -1 , Out = 0 , In = 1 }
 

Public Member Functions

 Focus ()=default
 
 Focus (const Term::Focus::Type &type)
 
Term::Focus::Type type () const
 Get the type of focus.
 
bool in () const
 Check is the focus is in.
 
bool out () const
 Check is the focus is out.
 
bool operator== (const Term::Focus &focus) const
 
bool operator!= (const Term::Focus &focus) const
 

Private Attributes

Term::Focus::Type m_focus {Term::Focus::Type::Unknown}
 

Detailed Description

Class to return the focus of the terminal.

Definition at line 21 of file focus.hpp.

Member Enumeration Documentation

◆ Type

enum class Term::Focus::Type : std::int8_t
strong
Enumerator
Unknown 

The terminal focus is unknown.

Out 

The terminal focus is out.

In 

The terminal focus is in.

Definition at line 24 of file focus.hpp.

25 {
26 Unknown = -1,
27 Out = 0,
28 In = 1,
29 };
@ Out
The terminal focus is out.
@ Unknown
The terminal focus is unknown.
@ In
The terminal focus is in.

Constructor & Destructor Documentation

◆ Focus() [1/2]

Term::Focus::Focus ( )
default

◆ Focus() [2/2]

Term::Focus::Focus ( const Term::Focus::Type & type)
explicit

Definition at line 15 of file focus.cpp.

15: m_focus(type) {}
Term::Focus::Type m_focus
Definition focus.hpp:62
Term::Focus::Type type() const
Get the type of focus.
Definition focus.cpp:17

Member Function Documentation

◆ in()

bool Term::Focus::in ( ) const

Check is the focus is in.

Returns
true : The terminal has focus in.
false : The terminal has focus out.

Definition at line 19 of file focus.cpp.

19{ return m_focus == Term::Focus::Type::In; }

◆ operator!=()

bool Term::Focus::operator!= ( const Term::Focus & focus) const

Definition at line 25 of file focus.cpp.

25{ return !(*this == focus); }

◆ operator==()

bool Term::Focus::operator== ( const Term::Focus & focus) const

Definition at line 23 of file focus.cpp.

23{ return m_focus == focus.m_focus; }

◆ out()

bool Term::Focus::out ( ) const

Check is the focus is out.

Returns
true : The terminal has focus out.
false : The terminal has focus in.

Definition at line 21 of file focus.cpp.

◆ type()

Term::Focus::Type Term::Focus::type ( ) const

Get the type of focus.

Returns
Term::Focus::Type

Definition at line 17 of file focus.cpp.

17{ return m_focus; }

Member Data Documentation

◆ m_focus

Term::Focus::Type Term::Focus::m_focus {Term::Focus::Type::Unknown}
private

Definition at line 62 of file focus.hpp.


The documentation for this class was generated from the following files: