summaryrefslogtreecommitdiffstats
path: root/src/querycompleter.h
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-03 20:51:18 +0200
committerDanilo M. <danix@danix.xyz>2026-08-04 12:54:14 +0200
commited5f795869b2f63b8f7e164239e4afcf9f13bb77 (patch)
treeb18130e7915884d11da876ff68ba161589c3a3cf /src/querycompleter.h
parent8e65d8f5eba78acc9558e26f9b728521f323b1a6 (diff)
downloadqtmaildir-ed5f795869b2f63b8f7e164239e4afcf9f13bb77.tar.gz
qtmaildir-ed5f795869b2f63b8f7e164239e4afcf9f13bb77.zip
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.
Diffstat (limited to 'src/querycompleter.h')
-rw-r--r--src/querycompleter.h15
1 files changed, 15 insertions, 0 deletions
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 <QList>
#include <QString>
+#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<CompletionEntry> 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<CompletionEntry> dateVocabulary();
+
+/// The built-in mimetypes, before the user's extra_mimetypes are appended.
+QList<CompletionEntry> mimetypeVocabulary();