The Battle for Wesnoth  1.15.11+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)
 Constuct 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 id
 the names are strange: the "hotkey::HOTKEY_COMMAND" is named id, and the string to identify the object is called "command" there is some inconstancy with that names in this file. More...
 
std::string command
 The command is unique. 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 252 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)

Constuct a new command from a temporary static hotkey object.

Definition at line 444 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 
)

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

References command, ERR_G, and hotkey::get_hotkey_null().

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

References hotkey::get_hotkey_null().

Referenced by 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 290 of file hotkey_command.hpp.

Referenced by hotkey::get_hotkeys_by_category().

◆ command

std::string hotkey::hotkey_command::command

◆ description

t_string hotkey::hotkey_command::description

Definition at line 275 of file hotkey_command.hpp.

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

◆ hidden

bool hotkey::hotkey_command::hidden

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

Definition at line 278 of file hotkey_command.hpp.

◆ id

HOTKEY_COMMAND hotkey::hotkey_command::id

◆ scope

hk_scopes hotkey::hotkey_command::scope

The visibility scope of the command.

Definition at line 287 of file hotkey_command.hpp.

Referenced by gui2::dialogs::preferences_dialog::add_hotkey_callback(), 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 284 of file hotkey_command.hpp.

Referenced by hotkey::hotkey_keyboard::matches_helper().

◆ tooltip

t_string hotkey::hotkey_command::tooltip

Definition at line 292 of file hotkey_command.hpp.

Referenced by hotkey::get_tooltip().


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