From ed5f795869b2f63b8f7e164239e4afcf9f13bb77 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 3 Aug 2026 20:51:18 +0200 Subject: feat(completion): add the prefix, date and mimetype vocabularies Keywords are syntax and stay untranslated; the descriptions beside them are prose and go through tr(). The tables are free functions with no QObject to inherit tr() from, so the file declares a VocabularyStrings context with Q_DECLARE_TR_FUNCTIONS rather than borrowing QObject::tr, which would file every string under the QObject context. --- src/querycompleter.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/querycompleter.h') diff --git a/src/querycompleter.h b/src/querycompleter.h index e2a983b..7c00ce2 100644 --- a/src/querycompleter.h +++ b/src/querycompleter.h @@ -18,8 +18,11 @@ #pragma once +#include #include +#include "completionentry.h" + /// Where the cursor sits in a query, and therefore what should be offered. /// /// A plain value type produced by a pure function so the parsing rules can be @@ -57,3 +60,15 @@ struct CompletionContext /// /// `cursor` is an offset into `text`, as QLineEdit::cursorPosition() returns. CompletionContext completionContext(const QString &text, int cursor); + +/// The notmuch query keywords, with descriptions. Hardcoded: notmuch exposes +/// no way to enumerate its own prefixes, so this list must track releases by +/// hand. See the spec's Consequences section. +QList prefixVocabulary(); + +/// Symbolic and relative date values. Absolute dates are not enumerable and +/// are covered by the free-form hint in the popup footer instead. +QList dateVocabulary(); + +/// The built-in mimetypes, before the user's extra_mimetypes are appended. +QList mimetypeVocabulary(); -- cgit v1.2.3