presentation/MentionRule.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <QString> | ||
| 4 | |||
| 5 | // When "@" opens the people picker in the compose body (Sprint 103 S103.6.6, | ||
| 6 | // interaction.md §10.1, user decision 2026-10-05). Pure. | ||
| 7 | // | ||
| 8 | // The "@" must stand at the start of a line or after a space, tab, "(", "[" | ||
| 9 | // or '"' and be followed by a letter — "ana@example.org" never triggers. A | ||
| 10 | // quoted line (starting with ">") and everything below the signature | ||
| 11 | // separator ("-- " on its own line) never trigger. The fragment is the text | ||
| 12 | // between "@" and the cursor (letters, digits, "-", "." and "'", no space). | ||
| 13 | namespace MentionRule { | ||
| 14 | |||
| 15 | struct Mention { | ||
| 16 | int start = -1; // index of the "@"; -1 when there is no mention here | ||
| 17 | QString fragment; // typed after the "@" | ||
| 18 | 94 | bool valid() const { return start >= 0; } | |
| 19 | }; | ||
| 20 | |||
| 21 | Mention at(const QString &text, int cursor); | ||
| 22 | |||
| 23 | } // namespace MentionRule | ||
| 24 |