Static metadata describing one registered action type. More...
#include <PhosphorRules/RuleAction.h>
Public Types | |
| using | SlotResolver = std::function<QString(const QJsonObject& params)> |
| Function shape that resolves the slot for a concrete action's params. | |
| using | Validator = std::function<bool(const QJsonObject& params)> |
Public Attributes | |
| QString | type |
| the action type id | |
| SlotResolver | slotFor |
| Resolves the slot for a concrete action's params. | |
| Validator | validate |
Returns true if params is a well-formed payload for this type. | |
| bool | terminal = false |
| Terminal actions (the Exclude family: Exclude / ExcludePlacement / ExcludeAnimations / ExcludeDecorations) stop evaluation once their rule matches — within the evaluator's terminal-action scope, see RuleEvaluator::setTerminalActionScope. | |
| QStringList | allowedKeys {} |
| The complete set of param keys this action type accepts. | |
| ActionDomain | domain = ActionDomain::Window |
| Which evaluation pass the action contributes to — see ActionDomain. | |
| QList< ParamSchema > | params {} |
| Structural per-param schema consumed by the editor UI. | |
| bool | userAuthorable = true |
| True when the action should appear in the editor's "add rule" type picker. | |
| QString | category {} |
| UI grouping category for the action-type picker. | |
| int | displayOrder = 0 |
| Intended sort key within a category (lower = earlier). | |
| QStringList | tags {} |
| Behavioural tags for consumer-side filtering. | |
Static metadata describing one registered action type.
Adding a future rule type is registering one of these — no new matcher, no new file, no new UI page. The descriptor owns:
| using PhosphorRules::ActionDescriptor::SlotResolver = std::function<QString(const QJsonObject& params)> |
Function shape that resolves the slot for a concrete action's params.
Hoisted to a type alias so the registry initialiser body stays readable (the std::function template is verbose enough that inlining it at every descriptor pushes the literal off-screen).
| using PhosphorRules::ActionDescriptor::Validator = std::function<bool(const QJsonObject& params)> |
| QStringList PhosphorRules::ActionDescriptor::allowedKeys {} |
The complete set of param keys this action type accepts.
The strict loader (RuleAction::fromJson) rejects an action whose params carries any key outside this set. An empty set disables the strict-key check — used for free-form / future-extensible action types whose params payload is deliberately open.
| QString PhosphorRules::ActionDescriptor::category {} |
UI grouping category for the action-type picker.
Actions with the same category are clustered together; empty means uncategorized.
| int PhosphorRules::ActionDescriptor::displayOrder = 0 |
Intended sort key within a category (lower = earlier).
Advisory only today: the shipped picker sorts within a category alphabetically by label and no consumer reads this field.
| ActionDomain PhosphorRules::ActionDescriptor::domain = ActionDomain::Window |
Which evaluation pass the action contributes to — see ActionDomain.
The validator combines this with the rule's match expression to detect rules that silently never fire (a context action against a match that pins window properties).
| QList<ParamSchema> PhosphorRules::ActionDescriptor::params {} |
Structural per-param schema consumed by the editor UI.
Order is the order the editor renders the param widgets in. An action with no params (e.g. Float, Exclude) leaves this empty.
| SlotResolver PhosphorRules::ActionDescriptor::slotFor |
Resolves the slot for a concrete action's params.
Returning an empty string means the action contributes no slot (treated as invalid).
| QStringList PhosphorRules::ActionDescriptor::tags {} |
Behavioural tags for consumer-side filtering.
Values are from the Tag:: namespace constants. Use ActionRegistry::hasTag() / typesWithTag() for queries.
| bool PhosphorRules::ActionDescriptor::terminal = false |
Terminal actions (the Exclude family: Exclude / ExcludePlacement / ExcludeAnimations / ExcludeDecorations) stop evaluation once their rule matches — within the evaluator's terminal-action scope, see RuleEvaluator::setTerminalActionScope.
| QString PhosphorRules::ActionDescriptor::type |
the action type id
| bool PhosphorRules::ActionDescriptor::userAuthorable = true |
True when the action should appear in the editor's "add rule" type picker.
Set to false on actions that are registered for loader / back-compat completeness but whose semantics aren't authorable through the standard wizard (e.g. an action whose runtime consumer hasn't shipped yet).
| Validator PhosphorRules::ActionDescriptor::validate |
Returns true if params is a well-formed payload for this type.