The Battle for Wesnoth  1.19.0-dev
Public Member Functions | Protected Member Functions | List of all members
hotkey::hotkey_void Class Reference

This class is used to return non-valid results in order to save other people from null checks. More...

#include <hotkey_item.hpp>

Inheritance diagram for hotkey::hotkey_void:

Public Member Functions

 hotkey_void ()
 
virtual bool valid () const
 Evaluates whether the hotkey bindings are valid. More...
 
- Public Member Functions inherited from hotkey::hotkey_base
 hotkey_base ()
 Initialises a new empty hotkey that will be disabled. More...
 
void set_command (const std::string &command)
 
void set_mods (unsigned int mods)
 Set keyboard modifiers. More...
 
const std::string & get_command () const
 Returns the string name of the HOTKEY_COMMAND. More...
 
const std::string get_description () const
 Returns the translated description. More...
 
virtual bool hidden () const
 This controls whether the item should appear in the hotkey preferences. More...
 
bool is_default () const
 This indicates whether a hotkey is from the default config or if it's from the user preferences. More...
 
void unset_default ()
 Used to indicate that a hotkey is overridden and should be treated as a user-set hotkey. More...
 
bool is_disabled () const
 
void disable ()
 
void enable ()
 
void clear ()
 Unbind this hotkey by linking it to the null-command. More...
 
bool null () const
 Returns whether this hotkey points to the null-command. More...
 
bool active () const
 
void save (config &cfg) const
 Save the hotkey into the configuration object. More...
 
const std::string get_name () const
 Return "name" of hotkey. More...
 
bool matches (const SDL_Event &event) const
 Used to evaluate whether: More...
 
virtual bool bindings_equal (hotkey_ptr other)
 Checks whether the hotkey bindings and scope are equal. More...
 
virtual ~hotkey_base ()
 

Protected Member Functions

virtual void save_helper (config &) const
 
virtual const std::string get_name_helper () const
 This is invoked by hotkey_base::get_name and must be implemented by subclasses. More...
 
virtual bool matches_helper (const SDL_Event &) const
 This is invoked by hotkey_base::matches as a helper for the concrete classes. More...
 
virtual bool bindings_equal_helper (hotkey_ptr) const
 This is invoked by hotkey_base::bindings_equal as a helper for the concrete classes. More...
 

Additional Inherited Members

- Protected Attributes inherited from hotkey::hotkey_base
std::string command_
 The command that should be executed, or "null". More...
 
bool is_default_
 is_default_ is true if the hot-key is part of the default hot-key list defined in data/core/hotkeys.cfg. More...
 
bool is_disabled_
 
unsigned int mod_
 

Detailed Description

This class is used to return non-valid results in order to save other people from null checks.

Definition at line 274 of file hotkey_item.hpp.

Constructor & Destructor Documentation

◆ hotkey_void()

hotkey::hotkey_void::hotkey_void ( )
inline

Definition at line 277 of file hotkey_item.hpp.

Member Function Documentation

◆ bindings_equal_helper()

virtual bool hotkey::hotkey_void::bindings_equal_helper ( hotkey_ptr  other) const
inlineprotectedvirtual

This is invoked by hotkey_base::bindings_equal as a helper for the concrete classes.

Implementing classes should only check their parts of the hotkey.

Parameters
otherThe other hotkey the check against. Not guaranteed to be the same subclass.
Returns
true if they match, false otherwise.

Implements hotkey::hotkey_base.

Definition at line 294 of file hotkey_item.hpp.

◆ get_name_helper()

virtual const std::string hotkey::hotkey_void::get_name_helper ( ) const
inlineprotectedvirtual

This is invoked by hotkey_base::get_name and must be implemented by subclasses.

Keyboard modifiers are handled in this class, other hotkeys in the respective classes

Implements hotkey::hotkey_base.

Definition at line 286 of file hotkey_item.hpp.

◆ matches_helper()

virtual bool hotkey::hotkey_void::matches_helper ( const SDL_Event &  event) const
inlineprotectedvirtual

This is invoked by hotkey_base::matches as a helper for the concrete classes.

Implementing classes should only check their parts of the hotkey.

Parameters
eventThe SDL_Event being generated.
Returns
true if they match, false otherwise.

Implements hotkey::hotkey_base.

Definition at line 290 of file hotkey_item.hpp.

◆ save_helper()

virtual void hotkey::hotkey_void::save_helper ( config ) const
inlineprotectedvirtual

Implements hotkey::hotkey_base.

Definition at line 284 of file hotkey_item.hpp.

◆ valid()

virtual bool hotkey::hotkey_void::valid ( ) const
inlinevirtual

Evaluates whether the hotkey bindings are valid.

Returns
true if they are valid, false otherwise.

Implements hotkey::hotkey_base.

Definition at line 279 of file hotkey_item.hpp.


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