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

#include <cpp-terminal/mouse.hpp>

Public Types

enum class  Type : std::int8_t {
  None = -1 , Left , Wheel , Right ,
  Button1 , Button2 , Button3 , Button4 ,
  Button5 , Button6 , Button7 , Button8
}
 
enum class  Action : std::int8_t {
  None = 0 , Pressed , Released , DoubleClicked ,
  RolledUp , RolledDown , ToRight , ToLeft
}
 

Public Member Functions

 Button ()=default
 
 Button (const Term::Button::Type &type, const Term::Button::Action &action)
 
Term::Button::Action action () const noexcept
 
Term::Button::Type type () const noexcept
 
bool operator== (const Term::Button &button) const
 
bool operator!= (const Term::Button &button) const
 

Private Attributes

Term::Button::Type m_type {Term::Button::Type::None}
 
Term::Button::Action m_action {Term::Button::Action::None}
 

Detailed Description

Definition at line 18 of file mouse.hpp.

Member Enumeration Documentation

◆ Action

enum class Term::Button::Action : std::int8_t
strong
Enumerator
None 
Pressed 
Released 
DoubleClicked 
RolledUp 
RolledDown 
ToRight 
ToLeft 

Definition at line 36 of file mouse.hpp.

◆ Type

enum class Term::Button::Type : std::int8_t
strong
Enumerator
None 
Left 
Wheel 
Right 
Button1 
Button2 
Button3 
Button4 
Button5 
Button6 
Button7 
Button8 

Definition at line 21 of file mouse.hpp.

Constructor & Destructor Documentation

◆ Button() [1/2]

Term::Button::Button ( )
default

◆ Button() [2/2]

Term::Button::Button ( const Term::Button::Type & type,
const Term::Button::Action & action )
inline

Definition at line 48 of file mouse.hpp.

Term::Button::Action m_action
Definition mouse.hpp:56
Term::Button::Type m_type
Definition mouse.hpp:55
Term::Button::Type type() const noexcept
Definition mouse.cpp:14
Term::Button::Action action() const noexcept
Definition mouse.cpp:12

Member Function Documentation

◆ action()

Term::Button::Action Term::Button::action ( ) const
noexcept

Definition at line 12 of file mouse.cpp.

12{ return m_action; }

◆ operator!=()

bool Term::Button::operator!= ( const Term::Button & button) const

Definition at line 18 of file mouse.cpp.

18{ return !(*this == button); }

◆ operator==()

bool Term::Button::operator== ( const Term::Button & button) const

Definition at line 16 of file mouse.cpp.

16{ return (m_action == button.m_action) && (m_type == button.m_type); }

◆ type()

Term::Button::Type Term::Button::type ( ) const
noexcept

Definition at line 14 of file mouse.cpp.

14{ return m_type; }

Member Data Documentation

◆ m_action

Term::Button::Action Term::Button::m_action {Term::Button::Action::None}
private

Definition at line 56 of file mouse.hpp.

◆ m_type

Term::Button::Type Term::Button::m_type {Term::Button::Type::None}
private

Definition at line 55 of file mouse.hpp.


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