Skip to content

Commit 116154b

Browse files
committed
Support TextEnableSuggestions
Signed-off-by: swan.seo <swan.seo@samsung.com>
1 parent eb1278f commit 116154b

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

flutter/shell/platform/tizen/channels/text_input_channel.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ constexpr char kUpdateEditingStateMethod[] =
2525
constexpr char kPerformActionMethod[] = "TextInputClient.performAction";
2626
constexpr char kSetPlatformViewClient[] = "TextInput.setPlatformViewClient";
2727
constexpr char kTextCapitalization[] = "textCapitalization";
28+
constexpr char kTextEnableSuggestions[] = "enableSuggestions";
2829
constexpr char kTextInputAction[] = "inputAction";
2930
constexpr char kTextInputType[] = "inputType";
3031
constexpr char kTextInputTypeName[] = "name";
@@ -162,6 +163,15 @@ void TextInputChannel::HandleMethodCall(
162163
}
163164

164165
client_id_ = client_id_json.GetInt();
166+
167+
auto enable_suggestions_iter =
168+
client_config.FindMember(kTextEnableSuggestions);
169+
if (enable_suggestions_iter != client_config.MemberEnd() &&
170+
enable_suggestions_iter->value.IsBool()) {
171+
bool enable = enable_suggestions_iter->value.GetBool();
172+
input_method_context_->SetEnableSuggestions(enable);
173+
}
174+
165175
input_action_ = "";
166176
auto input_action_iter = client_config.FindMember(kTextInputAction);
167177
if (input_action_iter != client_config.MemberEnd() &&

flutter/shell/platform/tizen/tizen_input_method_context.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,13 @@ bool TizenInputMethodContext::IsInputPanelShown() {
273273
return state == ECORE_IMF_INPUT_PANEL_STATE_SHOW;
274274
}
275275

276+
void TizenInputMethodContext::SetEnableSuggestions(bool enable) {
277+
FT_ASSERT(imf_context_);
278+
279+
ecore_imf_context_prediction_allow_set(imf_context_,
280+
enable ? EINA_TRUE : EINA_FALSE);
281+
}
282+
276283
void TizenInputMethodContext::SetInputAction(const std::string& input_action) {
277284
FT_ASSERT(imf_context_);
278285
Ecore_IMF_Input_Panel_Return_Key_Type return_key_type =

flutter/shell/platform/tizen/tizen_input_method_context.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class TizenInputMethodContext {
5757

5858
bool IsInputPanelShown();
5959

60+
void SetEnableSuggestions(bool enable);
61+
6062
void SetInputAction(const std::string& input_action);
6163

6264
void SetInputPanelLayout(const std::string& layout);

0 commit comments

Comments
 (0)