The Battle for Wesnoth  1.19.13+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 (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)
 
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...
 

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 247 of file hotkey_command.hpp.

Constructor & Destructor Documentation

◆ hotkey_command() [1/2]

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

Constructs a new command from a temporary static hotkey object.

Definition at line 440 of file hotkey_command.cpp.

◆ hotkey_command() [2/2]

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 452 of file hotkey_command.cpp.

Member Function Documentation

◆ null()

bool hotkey::hotkey_command::null ( ) const

checks weather this is the null hotkey_command

Definition at line 476 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 471 of file hotkey_command.cpp.

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

Member Data Documentation

◆ category

HOTKEY_CATEGORY hotkey::hotkey_command::category

The category of the command.

Definition at line 277 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 265 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 274 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 271 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 279 of file hotkey_command.hpp.


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