summaryrefslogtreecommitdiffstats
path: root/autocorrect.h
blob: bfa3ba20a4fb73e20fe3a13ac11d6ca258fb65ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef AUTOCORRECT_H
#define AUTOCORRECT_H

enum autocorrect_mode {
	AUTOCORRECT_HINT,
	AUTOCORRECT_NEVER,
	AUTOCORRECT_PROMPT,
	AUTOCORRECT_IMMEDIATELY,
	AUTOCORRECT_DELAY,
};

/**
 * `mode` indicates which action will be performed by autocorrect_confirm().
 * `delay` is the timeout before autocorrect_confirm() returns, in tenths of a
 * second. Use it only with AUTOCORRECT_DELAY.
 */
struct autocorrect {
	enum autocorrect_mode mode;
	int delay;
};

/**
 * Resolve the autocorrect configuration into `conf`.
 */
void autocorrect_resolve(struct autocorrect *conf);

/**
 * Interact with the user in different ways depending on `conf->mode`.
 */
void autocorrect_confirm(struct autocorrect *conf, const char *assumed);

#endif /* AUTOCORRECT_H */