File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 11#pragma once
22
3- #define DSPELLCHECK_SETLANG_MSG 1
3+ #define DSPELLCHECK_SETLANG_MSG 1 // See DSpellCheckSetLangMsgInfo
4+ #define DSPELLCHECK_GETLANGUAGELIST_MSG 2 // See DSpellCheckGetLanguageListMsgInfo
45
5- struct DSpellCheckSetLangMsgInfo
6- {
6+ // Set language to lang_name, if was_success non-zero, it will be set to true in case of success and fales in case of failure
7+ struct DSpellCheckSetLangMsgInfo {
78 const wchar_t * lang_name ;
89 bool * was_success ; // optional out param, pointed bool set to true if language was switched
910};
11+
12+ // language_callback will be called once for each language with payload provided as a second struct element
13+ struct DSpellCheckGetLanguageListMsgInfo {
14+ void (* language_callback )(void * payload , const wchar_t * lang_name );
15+ void * payload ;
16+ };
Original file line number Diff line number Diff line change @@ -898,6 +898,15 @@ bool process_internal_msg(const CommunicationInfo& communication_info) {
898898 }
899899 }
900900 break ;
901+ case DSPELLCHECK_GETLANGUAGELIST_MSG: {
902+ if (const auto info = reinterpret_cast <DSpellCheckGetLanguageListMsgInfo *>(communication_info.info )) {
903+ const auto lang_list = speller_container->active_speller ().get_language_list ();
904+ for (auto &lang : lang_list) {
905+ info->language_callback (info->payload , lang.orig_name .c_str ());
906+ }
907+ }
908+ }
909+ return true ;
901910 }
902911 return false ;
903912}
You can’t perform that action at this time.
0 commit comments