The Battle for Wesnoth  1.19.0-dev
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
hotkey::hotkey_command Struct Reference

Stores all information related to functions that can be bound to hotkeys. More...

#include <hotkey_command.hpp>

Public Member Functions

 hotkey_command ()=delete
 
 hotkey_command (const hotkey_command_temp &temp_command)
 Constructs a new command from a temporary static hotkey object. More...
 
 hotkey_command (HOTKEY_COMMAND cmd, const std::string &id, const t_string &desc, bool hidden, bool toggle, hk_scopes scope, HOTKEY_CATEGORY category, const t_string &tooltip)
 
 hotkey_command (const hotkey_command &)=default
 
hotkey_commandoperator= (const hotkey_command &)=default
 
bool null () const
 checks weather this is the null hotkey_command More...
 

Static Public Member Functions

static const hotkey_commandnull_command ()
 returns the command that is treated as null More...
 
static const hotkey_commandget_command_by_command (HOTKEY_COMMAND command)
 the execute_command argument was changed from HOTKEY_COMMAND to hotkey_command, to be able to call it with HOTKEY_COMMAND, this function was created More...
 

Public Attributes

HOTKEY_COMMAND command
 The command associated with this hotkey. More...
 
std::string id
 The unique ID. More...
 
t_string description
 
bool hidden
 If hidden then don't show the command in the hotkey preferences. More...
 
bool toggle
 Toggle hotkeys have some restrictions on what can be bound to them. More...
 
hk_scopes scope
 The visibility scope of the command. More...
 
HOTKEY_CATEGORY category
 The category of the command. More...
 
t_string tooltip
 

Detailed Description

Stores all information related to functions that can be bound to hotkeys.

this is currently a semi struct: it haves a constructor, but only const-public members.

Definition at line 238 of file hotkey_command.hpp.

Constructor & Destructor Documentation

◆ hotkey_command() [1/4]

hotkey::hotkey_command::hotkey_command ( )
delete

◆ hotkey_command() [2/4]

hotkey::hotkey_command::hotkey_command ( const hotkey_command_temp temp_command)

Constructs a new command from a temporary static hotkey object.

Definition at line 420 of file hotkey_command.cpp.

◆ hotkey_command() [3/4]

hotkey::hotkey_command::hotkey_command ( hotkey::HOTKEY_COMMAND  cmd,
const std::string &  id,
const t_string desc,
bool  hidden,
bool  toggle,
hotkey::hk_scopes  scop,
hotkey::HOTKEY_CATEGORY  cat,
const t_string tooltip 
)
Todo:
: see if we can remove this with c++20.

Aggregate initialization with try_emplace?

Definition at line 432 of file hotkey_command.cpp.

◆ hotkey_command() [4/4]

hotkey::hotkey_command::hotkey_command ( const hotkey_command )
default

Member Function Documentation

◆ get_command_by_command()

const hotkey_command & hotkey::hotkey_command::get_command_by_command ( hotkey::HOTKEY_COMMAND  command)
static

the execute_command argument was changed from HOTKEY_COMMAND to hotkey_command, to be able to call it with HOTKEY_COMMAND, this function was created

Definition at line 473 of file hotkey_command.cpp.

References command, ERR_G, and null_command().

Referenced by hotkey::command_executor::execute_quit_command(), gui2::styled_widget::signal_handler_show_tooltip(), play_controller::hotkey_handler::toggle_accelerated_speed(), and playsingle_controller::hotkey_handler::whiteboard_toggle().

◆ null()

bool hotkey::hotkey_command::null ( ) const

checks weather this is the null hotkey_command

Definition at line 456 of file hotkey_command.cpp.

References command, description, ERR_G, hotkey::HOTKEY_NULL, id, null_command(), and scope.

◆ null_command()

const hotkey_command & hotkey::hotkey_command::null_command ( )
static

returns the command that is treated as null

Definition at line 451 of file hotkey_command.cpp.

Referenced by get_command_by_command(), hotkey::get_hotkey_command(), and null().

◆ operator=()

hotkey_command& hotkey::hotkey_command::operator= ( const hotkey_command )
default

Member Data Documentation

◆ category

HOTKEY_CATEGORY hotkey::hotkey_command::category

The category of the command.

Definition at line 273 of file hotkey_command.hpp.

◆ command

HOTKEY_COMMAND hotkey::hotkey_command::command

◆ description

t_string hotkey::hotkey_command::description

◆ hidden

bool hotkey::hotkey_command::hidden

If hidden then don't show the command in the hotkey preferences.

Definition at line 261 of file hotkey_command.hpp.

◆ id

std::string hotkey::hotkey_command::id

◆ scope

hk_scopes hotkey::hotkey_command::scope

The visibility scope of the command.

Definition at line 270 of file hotkey_command.hpp.

Referenced by hotkey::hotkey_base::bindings_equal(), and null().

◆ toggle

bool hotkey::hotkey_command::toggle

Toggle hotkeys have some restrictions on what can be bound to them.

They require a binding that has two states, "pressed" and "released"

Definition at line 267 of file hotkey_command.hpp.

Referenced by hotkey::create_hotkey(), and hotkey::hotkey_keyboard::matches_helper().

◆ tooltip

t_string hotkey::hotkey_command::tooltip

Definition at line 275 of file hotkey_command.hpp.


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