15#include "phosphorrules_export.h"
44 ContextActionWithWindowMatch = 0,
57 TerminalActionWithEffectActions = 1,
66 DuplicateSlotActions = 2,
78 IncompleteActionPayload = 3,
105struct PHOSPHORRULES_EXPORT
Rule
158 return !(*
this == other);
166 static std::optional<Rule>
fromJson(
const QJsonObject& obj);
A composable predicate tree evaluated against a WindowQuery.
Definition MatchExpression.h:50
Definition ActionParams.h:25
One rule — { id, name, enabled, priority, match, actions, managed }.
Definition Rule.h:106
QList< ValidationIssue > validationIssues() const
Semantic compatibility issues between match and each action.
bool operator==(const Rule &other) const
QUuid id
Definition Rule.h:107
bool hasTerminalAction() const
True if any of this rule's actions is terminal (one of the Exclude family — Exclude / ExcludePlacemen...
QJsonObject toJson() const
QList< RuleAction > actions
Definition Rule.h:112
bool managed
True for built-in rules the application owns rather than the user (currently the baseline appearance ...
Definition Rule.h:119
QString name
Definition Rule.h:108
bool isValid() const
True if the rule has a non-null id, a valid match expression, and every action validates against the ...
static std::optional< Rule > fromJson(const QJsonObject &obj)
Strict loader — drops the rule (returns nullopt) on a missing/invalid id, a malformed match expressio...
MatchExpression match
default-constructs to the catch-all All{}
Definition Rule.h:111
int priority
Definition Rule.h:110
bool operator!=(const Rule &other) const
Definition Rule.h:156
bool enabled
Definition Rule.h:109
One semantic compatibility issue between a rule's match and an action.
Definition Rule.h:35
Code code
Definition Rule.h:81
Code
Wire-stable code so callers can localise the message themselves without string-matching the diagnosti...
Definition Rule.h:38
@ ContextActionWithWindowMatch
A context-domain action (e.g.
Definition Rule.h:44
QString actionType
Action type id for diagnostics (avoids the caller re-indexing actions).
Definition Rule.h:85
bool operator==(const ValidationIssue &other) const
Definition Rule.h:90
QString message
English diagnostic suitable for logging.
Definition Rule.h:88
int actionIndex
Index into the rule's actions list — points at the offending action.
Definition Rule.h:83