KiCad PCB EDA Suite
Loading...
Searching...
No Matches
TOOL_ACTION_ARGS Class Reference

Build up the properties of a TOOL_ACTION in an incremental manner that is static-construction safe. More...

#include <tool_action.h>

Public Member Functions

 TOOL_ACTION_ARGS ()=default
 
TOOL_ACTION_ARGSName (const std::string_view &aName)
 The name of the action, the convention is "app.tool.actionName".
 
TOOL_ACTION_ARGSFriendlyName (const std::string_view &aName)
 
TOOL_ACTION_ARGSScope (TOOL_ACTION_SCOPE aScope)
 The scope of the action.
 
TOOL_ACTION_ARGSDefaultHotkey (int aDefaultHotkey)
 The default hotkey to assign to the action.
 
TOOL_ACTION_ARGSDefaultHotkeyAlt (int aDefaultHotkeyAlt)
 The default alternate hotkey to assign to the action.
 
TOOL_ACTION_ARGSLegacyHotkeyName (const std::string_view &aLegacyName)
 The legacy hotkey name from the old system.
 
TOOL_ACTION_ARGSMenuText (const std::string_view &aMenuText)
 The string to use when displaying the action in a menu.
 
TOOL_ACTION_ARGSTooltip (const std::string_view &aTooltip)
 The string to use as a tooltip for the action in menus and toolbars.
 
TOOL_ACTION_ARGSDescription (const std::string_view &aDescription)
 The description of the action.
 
TOOL_ACTION_ARGSIcon (BITMAPS aIcon)
 The bitmap to use as the icon for the action in toolbars and menus.
 
TOOL_ACTION_ARGSFlags (TOOL_ACTION_FLAGS aFlags)
 Flags describing the type of the action.
 
template<typename T >
TOOL_ACTION_ARGSParameter (T aParam)
 Custom parameter to pass information to the tool.
 
TOOL_ACTION_ARGSUIId (int aUIId)
 The ID number to use for the action when interacting with any UI elements.
 
TOOL_ACTION_ARGSGroup (const TOOL_ACTION_GROUP &aGroup)
 

Protected Attributes

std::optional< std::string_view > m_name
 
std::optional< std::string_view > m_friendlyName
 
std::optional< TOOL_ACTION_SCOPEm_scope
 
std::optional< TOOL_ACTION_FLAGSm_flags
 
std::optional< int > m_uiid
 
std::optional< int > m_defaultHotKey
 
std::optional< int > m_defaultHotKeyAlt
 
std::optional< std::string_view > m_legacyName
 
std::optional< std::string_view > m_menuText
 
std::optional< std::string_view > m_tooltip
 
std::optional< std::string_view > m_description
 
std::optional< BITMAPSm_icon
 
std::optional< TOOL_ACTION_GROUPm_group
 
std::any m_param
 

Friends

class TOOL_ACTION
 

Detailed Description

Build up the properties of a TOOL_ACTION in an incremental manner that is static-construction safe.

Note: This is meant to be constructed and immediately passed into the TOOL_ACTION constructor. Construction should not be delayed, since this only retains pointers to the strings used.

Definition at line 101 of file tool_action.h.

Constructor & Destructor Documentation

◆ TOOL_ACTION_ARGS()

TOOL_ACTION_ARGS::TOOL_ACTION_ARGS ( )
default

Member Function Documentation

◆ DefaultHotkey()

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::DefaultHotkey ( int  aDefaultHotkey)
inline

The default hotkey to assign to the action.

Definition at line 135 of file tool_action.h.

References m_defaultHotKey.

◆ DefaultHotkeyAlt()

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::DefaultHotkeyAlt ( int  aDefaultHotkeyAlt)
inline

The default alternate hotkey to assign to the action.

Definition at line 144 of file tool_action.h.

References m_defaultHotKeyAlt.

◆ Description()

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::Description ( const std::string_view &  aDescription)
inline

The description of the action.

Definition at line 182 of file tool_action.h.

References m_description.

◆ Flags()

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::Flags ( TOOL_ACTION_FLAGS  aFlags)
inline

Flags describing the type of the action.

Definition at line 200 of file tool_action.h.

References m_flags.

◆ FriendlyName()

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::FriendlyName ( const std::string_view &  aName)
inline

Definition at line 117 of file tool_action.h.

References m_friendlyName.

◆ Group()

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::Group ( const TOOL_ACTION_GROUP aGroup)
inline

Definition at line 225 of file tool_action.h.

References m_group.

◆ Icon()

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::Icon ( BITMAPS  aIcon)
inline

The bitmap to use as the icon for the action in toolbars and menus.

Definition at line 191 of file tool_action.h.

References m_icon.

◆ LegacyHotkeyName()

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::LegacyHotkeyName ( const std::string_view &  aLegacyName)
inline

The legacy hotkey name from the old system.

This property is only needed for existing actions and shouldn't be used in new actions.

Definition at line 155 of file tool_action.h.

References m_legacyName.

◆ MenuText()

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::MenuText ( const std::string_view &  aMenuText)
inline

The string to use when displaying the action in a menu.

Definition at line 164 of file tool_action.h.

References m_menuText.

◆ Name()

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::Name ( const std::string_view &  aName)
inline

The name of the action, the convention is "app.tool.actionName".

This is a required property.

Definition at line 111 of file tool_action.h.

References m_name.

◆ Parameter()

template<typename T >
TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::Parameter ( aParam)
inline

Custom parameter to pass information to the tool.

Definition at line 210 of file tool_action.h.

References m_param.

◆ Scope()

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::Scope ( TOOL_ACTION_SCOPE  aScope)
inline

The scope of the action.

Definition at line 126 of file tool_action.h.

References m_scope.

◆ Tooltip()

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::Tooltip ( const std::string_view &  aTooltip)
inline

The string to use as a tooltip for the action in menus and toolbars.

Definition at line 173 of file tool_action.h.

References m_tooltip.

◆ UIId()

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::UIId ( int  aUIId)
inline

The ID number to use for the action when interacting with any UI elements.

Definition at line 219 of file tool_action.h.

References m_uiid.

Friends And Related Function Documentation

◆ TOOL_ACTION

friend class TOOL_ACTION
friend

Definition at line 233 of file tool_action.h.

Member Data Documentation

◆ m_defaultHotKey

std::optional<int> TOOL_ACTION_ARGS::m_defaultHotKey
protected

Definition at line 242 of file tool_action.h.

Referenced by DefaultHotkey().

◆ m_defaultHotKeyAlt

std::optional<int> TOOL_ACTION_ARGS::m_defaultHotKeyAlt
protected

Definition at line 243 of file tool_action.h.

Referenced by DefaultHotkeyAlt().

◆ m_description

std::optional<std::string_view> TOOL_ACTION_ARGS::m_description
protected

Definition at line 248 of file tool_action.h.

Referenced by Description(), and TOOL_ACTION::TOOL_ACTION().

◆ m_flags

std::optional<TOOL_ACTION_FLAGS> TOOL_ACTION_ARGS::m_flags
protected

Definition at line 238 of file tool_action.h.

Referenced by Flags().

◆ m_friendlyName

std::optional<std::string_view> TOOL_ACTION_ARGS::m_friendlyName
protected

Definition at line 236 of file tool_action.h.

Referenced by FriendlyName().

◆ m_group

std::optional<TOOL_ACTION_GROUP> TOOL_ACTION_ARGS::m_group
protected

Definition at line 252 of file tool_action.h.

Referenced by Group(), and TOOL_ACTION::TOOL_ACTION().

◆ m_icon

std::optional<BITMAPS> TOOL_ACTION_ARGS::m_icon
protected

Definition at line 250 of file tool_action.h.

Referenced by Icon().

◆ m_legacyName

std::optional<std::string_view> TOOL_ACTION_ARGS::m_legacyName
protected

Definition at line 244 of file tool_action.h.

Referenced by LegacyHotkeyName().

◆ m_menuText

std::optional<std::string_view> TOOL_ACTION_ARGS::m_menuText
protected

Definition at line 246 of file tool_action.h.

Referenced by MenuText(), and TOOL_ACTION::TOOL_ACTION().

◆ m_name

std::optional<std::string_view> TOOL_ACTION_ARGS::m_name
protected

Definition at line 235 of file tool_action.h.

Referenced by Name().

◆ m_param

std::any TOOL_ACTION_ARGS::m_param
protected

Definition at line 254 of file tool_action.h.

Referenced by Parameter(), and TOOL_ACTION::TOOL_ACTION().

◆ m_scope

std::optional<TOOL_ACTION_SCOPE> TOOL_ACTION_ARGS::m_scope
protected

Definition at line 237 of file tool_action.h.

Referenced by Scope().

◆ m_tooltip

std::optional<std::string_view> TOOL_ACTION_ARGS::m_tooltip
protected

Definition at line 247 of file tool_action.h.

Referenced by Tooltip().

◆ m_uiid

std::optional<int> TOOL_ACTION_ARGS::m_uiid
protected

Definition at line 240 of file tool_action.h.

Referenced by TOOL_ACTION::TOOL_ACTION(), and UIId().


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