librime: rime_levers_api.h Source File

| librime 1.2 Rime Input Method Engine, the core library

rime_levers_api.h
Go to the documentation of this file.
1/*
2 * Copyright RIME Developers
3 * Distributed under the BSD License
4 *
5 * 2013-10-21 GONG Chen <chen.sst@gmail.com>
6 */
7#ifndef RIME_LEVERS_API_H_
8#define RIME_LEVERS_API_H_
9
10#include "rime_api.h"
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16 typedef struct {
17 char placeholder;
18} RimeCustomSettings;
19
20 typedef struct {
21 char placeholder;
22} RimeSwitcherSettings;
23
24 typedef struct {
25 char placeholder;
26} RimeSchemaInfo;
27
28 typedef struct {
29 void* ptr;
30 size_t i;
31} RimeUserDictIterator;
32
33typedef struct RIME_FLAVORED(rime_levers_api_t) {
34 int data_size;
35
36 RimeCustomSettings* (*custom_settings_init)(const char* config_id,
37 const char* generator_id);
38 void (*custom_settings_destroy)(RimeCustomSettings* settings);
39 Bool (*load_settings)(RimeCustomSettings* settings);
40 Bool (*save_settings)(RimeCustomSettings* settings);
41 Bool (*customize_bool)(RimeCustomSettings* settings,
42 const char* key,
43 Bool value);
44 Bool (*customize_int)(RimeCustomSettings* settings,
45 const char* key,
46 int value);
47 Bool (*customize_double)(RimeCustomSettings* settings,
48 const char* key,
49 double value);
50 Bool (*customize_string)(RimeCustomSettings* settings,
51 const char* key,
52 const char* value);
53 Bool (*is_first_run)(RimeCustomSettings* settings);
54 Bool (*settings_is_modified)(RimeCustomSettings* settings);
55 Bool (*settings_get_config)(RimeCustomSettings* settings, RimeConfig* config);
56
57 RimeSwitcherSettings* (*switcher_settings_init)();
58 Bool (*get_available_schema_list)(RimeSwitcherSettings* settings,
59 RimeSchemaList* list);
60 Bool (*get_selected_schema_list)(RimeSwitcherSettings* settings,
61 RimeSchemaList* list);
62 void (*schema_list_destroy)(RimeSchemaList* list);
63 const char* (*get_schema_id)(RimeSchemaInfo* info);
64 const char* (*get_schema_name)(RimeSchemaInfo* info);
65 const char* (*get_schema_version)(RimeSchemaInfo* info);
66 const char* (*get_schema_author)(RimeSchemaInfo* info);
67 const char* (*get_schema_description)(RimeSchemaInfo* info);
68 const char* (*get_schema_file_path)(RimeSchemaInfo* info);
69 Bool (*select_schemas)(RimeSwitcherSettings* settings,
70 const char* schema_id_list[],
71 int count);
72 const char* (*get_hotkeys)(RimeSwitcherSettings* settings);
73 Bool (*set_hotkeys)(RimeSwitcherSettings* settings, const char* hotkeys);
74
75 Bool (*user_dict_iterator_init)(RimeUserDictIterator* iter);
76 void (*user_dict_iterator_destroy)(RimeUserDictIterator* iter);
77 const char* (*next_user_dict)(RimeUserDictIterator* iter);
78 Bool (*backup_user_dict)(const char* dict_name);
79 Bool (*restore_user_dict)(const char* snapshot_file);
80 int (*export_user_dict)(const char* dict_name, const char* text_file);
81 int (*import_user_dict)(const char* dict_name, const char* text_file);
82
83 // patch a list or a map
84 Bool (*customize_item)(RimeCustomSettings* settings,
85 const char* key,
86 RimeConfig* value);
87
88} RIME_FLAVORED(RimeLeversApi);
89
90#ifdef __cplusplus
91}
92#endif
93
94#endif // RIME_LEVERS_API_H_
rime_api.h
RimeSchemaList
struct rime_schema_list_t RimeSchemaList
RimeConfig
struct rime_config_t RimeConfig
Bool
#define Bool
Definition rime_api.h:46
RIME_FLAVORED
#define RIME_FLAVORED(name)
Definition rime_api.h:42
RimeCustomSettings
Definition rime_levers_api.h:16
RimeCustomSettings::placeholder
char placeholder
Definition rime_levers_api.h:17
RimeSwitcherSettings
Definition rime_levers_api.h:20
RimeSwitcherSettings::placeholder
char placeholder
Definition rime_levers_api.h:21
RimeSchemaInfo
Definition rime_levers_api.h:24
RimeSchemaInfo::placeholder
char placeholder
Definition rime_levers_api.h:25
RimeUserDictIterator
Definition rime_levers_api.h:28
RimeUserDictIterator::ptr
void * ptr
Definition rime_levers_api.h:29
RimeUserDictIterator::i
size_t i
Definition rime_levers_api.h:30