6 #ifndef _FCITX_LIBIME_TABLE_TABLECONTEXT_H_ 7 #define _FCITX_LIBIME_TABLE_TABLECONTEXT_H_ 13 #include <boost/type_traits/add_const.hpp> 19 #include <string_view> 22 #include <boost/iterator/iterator_categories.hpp> 23 #include <boost/range/any_range.hpp> 24 #include <fcitx-utils/macros.h> 25 #include <libime/core/inputbuffer.h> 26 #include <libime/table/libimetable_export.h> 27 #include <libime/table/tablebaseddictionary.h> 28 #include "libime/core/lattice.h" 32 class TableContextPrivate;
33 class TableBasedDictionary;
34 class UserLanguageModel;
40 boost::random_access_traversal_tag>;
45 void erase(
size_t from,
size_t to)
override;
47 void select(
size_t idx);
49 bool isValidInput(uint32_t c)
const;
51 CandidateRange candidates()
const;
53 std::string candidateHint(
size_t idx,
bool custom =
false)
const;
55 static std::string code(
const SentenceResult &sentence);
56 static PhraseFlag flag(
const SentenceResult &sentence);
57 static bool isPinyin(
const SentenceResult &sentence);
58 static bool isAuto(
const SentenceResult &sentence);
60 bool selected()
const;
61 size_t selectedSize()
const;
62 std::tuple<std::string, bool> selectedSegment(
size_t idx)
const;
63 std::string selectedCode(
size_t idx)
const;
64 size_t selectedSegmentLength(
size_t idx)
const;
68 std::string preedit()
const;
71 const std::string ¤tCode()
const;
74 std::string selectedSentence()
const;
75 size_t selectedLength()
const;
86 void learnAutoPhrase(std::string_view history);
91 void learnAutoPhrase(std::string_view history,
92 const std::vector<std::string> &hints);
104 void setAutoSelectIndex(
size_t index);
107 bool typeImpl(
const char *s,
size_t length)
override;
111 bool typeOneChar(std::string_view chr);
113 std::unique_ptr<TableContextPrivate> d_ptr;
118 #endif // _FCITX_LIBIME_TABLE_TABLECONTEXT_H_
Input context for table input method.