/* * SPDX-FileCopyrightText: 2017-2017 CSSlayer * * SPDX-License-Identifier: LGPL-2.1-or-later * */ #ifndef _PINYINHELPER_PINYINHELPER_H_ #define _PINYINHELPER_PINYINHELPER_H_ #include "pinyinhelper_public.h" #include "pinyinlookup.h" #include "stroke.h" #include #include #include #include #include #include #include namespace fcitx { class PinyinHelper final : public AddonInstance { public: PinyinHelper(Instance *instance); std::vector lookup(uint32_t); std::vector> fullLookup(uint32_t); std::vector> lookupStroke(const std::string &input, int limit); std::string reverseLookupStroke(const std::string &input); std::string prettyStrokeString(const std::string &input); void loadStroke(); FCITX_ADDON_EXPORT_FUNCTION(PinyinHelper, lookup); FCITX_ADDON_EXPORT_FUNCTION(PinyinHelper, fullLookup); FCITX_ADDON_EXPORT_FUNCTION(PinyinHelper, lookupStroke); FCITX_ADDON_EXPORT_FUNCTION(PinyinHelper, loadStroke); FCITX_ADDON_EXPORT_FUNCTION(PinyinHelper, reverseLookupStroke); FCITX_ADDON_EXPORT_FUNCTION(PinyinHelper, prettyStrokeString); FCITX_ADDON_DEPENDENCY_LOADER(quickphrase, instance_->addonManager()); FCITX_ADDON_DEPENDENCY_LOADER(clipboard, instance_->addonManager()); private: void initQuickPhrase(); Instance *instance_; PinyinLookup lookup_; Stroke stroke_; std::unique_ptr deferEvent_; std::unique_ptr> handler_; }; } // namespace fcitx #endif // _PINYINHELPER_PINYINHELPER_H_