KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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)
 
TOOL_ACTION_ARGSToolbarState (TOOLBAR_STATE aState)
 
TOOL_ACTION_ARGSToolbarState (std::initializer_list< TOOLBAR_STATE > aState)
 

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::optional< TOOLBAR_STATE_FLAGSm_toolbarState
 
ki::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 117 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 151 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 160 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 198 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 216 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 133 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 241 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 207 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 171 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 180 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 127 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 226 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 142 of file tool_action.h.

References m_scope.

◆ ToolbarState() [1/2]

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::ToolbarState ( std::initializer_list< TOOLBAR_STATE aState)
inline

Definition at line 254 of file tool_action.h.

References flag, and m_toolbarState.

◆ ToolbarState() [2/2]

TOOL_ACTION_ARGS & TOOL_ACTION_ARGS::ToolbarState ( TOOLBAR_STATE  aState)
inline

Definition at line 247 of file tool_action.h.

References m_toolbarState.

◆ 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 189 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 235 of file tool_action.h.

References m_uiid.

Friends And Related Function Documentation

◆ TOOL_ACTION

friend class TOOL_ACTION
friend

Definition at line 266 of file tool_action.h.

Member Data Documentation

◆ m_defaultHotKey

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

Definition at line 275 of file tool_action.h.

Referenced by DefaultHotkey().

◆ m_defaultHotKeyAlt

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

Definition at line 276 of file tool_action.h.

Referenced by DefaultHotkeyAlt().

◆ m_description

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

Definition at line 281 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 271 of file tool_action.h.

Referenced by Flags().

◆ m_friendlyName

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

Definition at line 269 of file tool_action.h.

Referenced by FriendlyName().

◆ m_group

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

Definition at line 285 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 283 of file tool_action.h.

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

◆ m_legacyName

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

Definition at line 277 of file tool_action.h.

Referenced by LegacyHotkeyName().

◆ m_menuText

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

Definition at line 279 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 268 of file tool_action.h.

Referenced by Name().

◆ m_param

ki::any TOOL_ACTION_ARGS::m_param
protected

Definition at line 289 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 270 of file tool_action.h.

Referenced by Scope().

◆ m_toolbarState

std::optional<TOOLBAR_STATE_FLAGS> TOOL_ACTION_ARGS::m_toolbarState
protected

Definition at line 287 of file tool_action.h.

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

◆ m_tooltip

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

Definition at line 280 of file tool_action.h.

Referenced by Tooltip().

◆ m_uiid

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

Definition at line 273 of file tool_action.h.

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


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