| 1 |
#ifndef _FCITX5_VARNAM_CONFIG_H_ |
| 2 |
#define _FCITX5_VARNAM_CONFIG_H_ |
| 3 |
|
| 4 |
#include <fcitx-config/configuration.h> |
| 5 |
#include <fcitx-config/enum.h> |
| 6 |
#include <fcitx-utils/i18n.h> |
| 7 |
#include <fcitx/candidatelist.h> |
| 8 |
|
| 9 |
namespace fcitx { |
| 10 |
|
| 11 |
enum class ChooseModifier { NoModifier, Alt, Control, Super }; |
| 12 |
|
| 13 |
FCITX_CONFIG_ENUM_NAME_WITH_I18N(ChooseModifier, N_("None"), N_("Alt"), |
| 14 |
N_("Control"), N_("Super")); |
| 15 |
|
| 16 |
FCITX_CONFIG_ENUM_NAME_WITH_I18N(CandidateLayoutHint, N_("Not Set"), |
| 17 |
N_("Vertical"), N_("Horizontal")); |
| 18 |
|
| 19 |
FCITX_CONFIGURATION( |
| 20 |
VarnamEngineConfig, |
| 21 |
|
| 22 |
// Candidate List Layout |
| 23 |
OptionWithAnnotation<CandidateLayoutHint, CandidateLayoutHintI18NAnnotation> |
| 24 |
candidateLayout{this, "CandidateLayout", _("Candidate List Layout"), |
| 25 |
fcitx::CandidateLayoutHint::Vertical}; |
| 26 |
|
| 27 |
// Page Size |
| 28 |
Option<int, IntConstrain> pageSize{this, "PageSize", _("Page size"), 5, |
| 29 |
IntConstrain(3, 10)}; |
| 30 |
|
| 31 |
// Enable Learning Words on commit |
| 32 |
Option<bool> shouldLearnWords{this, "Learn Words", _("Learn New Words"), |
| 33 |
true}; |
| 34 |
// Strictly Follow Schema |
| 35 |
Option<bool> strictlyFollowScheme{ |
| 36 |
this, "Strictly Follow Scheme", |
| 37 |
_("Strictly Follow Scheme For Dictionary Results"), false}; |
| 38 |
|
| 39 |
// Dictionary Suggestions Limit |
| 40 |
Option<int, IntConstrain> dictionarySuggestionsLimit{ |
| 41 |
this, "Dictionary Suggestions Limit", _("Dictionary Suggestions Limit"), |
| 42 |
4, IntConstrain(0, 10)}; |
| 43 |
|
| 44 |
// Pattern Dictionary Suggestions Limit |
| 45 |
Option<int, IntConstrain> patternDictionarySuggestionsLimit{ |
| 46 |
this, "Pattern Dictionary Suggestions Limit", |
| 47 |
_("Pattern Dictionary Suggestions Limit"), 3, IntConstrain(0, 10)}; |
| 48 |
|
| 49 |
// Tokenizer Suggestions Limit |
| 50 |
Option<int, IntConstrain> tokenizerSuggestionsLimit{ |
| 51 |
this, "Tokenizer Suggestions Limit", _("Tokenizer Suggestions Limit"), |
| 52 |
10, IntConstrain(0, 10)}; |
| 53 |
|
| 54 |
// Previous Candidate Shortcut |
| 55 |
KeyListOption prevCandidate{ |
| 56 |
this, |
| 57 |
"PrevCandidate", |
| 58 |
_("Previous Candidate"), |
| 59 |
{Key("Up")}, |
| 60 |
KeyListConstrain(KeyConstrainFlag::AllowModifierLess)}; |
| 61 |
|
| 62 |
// Next Candidate Shortcut |
| 63 |
KeyListOption nextCandidate{ |
| 64 |
this, |
| 65 |
"NextCandidate", |
| 66 |
_("Next Candidate"), |
| 67 |
{Key("Down")}, |
| 68 |
KeyListConstrain(KeyConstrainFlag::AllowModifierLess)}; |
| 69 |
|
| 70 |
// Previous Page |
| 71 |
KeyListOption prevPage{ |
| 72 |
this, |
| 73 |
"PrevPage", |
| 74 |
_("Previous Page"), |
| 75 |
{Key("Alt+Up")}, |
| 76 |
KeyListConstrain(KeyConstrainFlag::AllowModifierOnly)}; |
| 77 |
|
| 78 |
// Next Page |
| 79 |
KeyListOption nextPage{ |
| 80 |
this, |
| 81 |
"NextPage", |
| 82 |
_("Next Page"), |
| 83 |
{Key("Alt+Down")}, |
| 84 |
KeyListConstrain(KeyConstrainFlag::AllowModifierOnly)};); |
| 85 |
|
| 86 |
} // namespace fcitx |
| 87 |
#endif |