1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_IME_TEXT_INPUT_CONFIGURATION_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_IME_TEXT_INPUT_CONFIGURATION_H
18 
19 #include <string>
20 
21 #include "core/common/ime/text_input_action.h"
22 #include "core/common/ime/text_input_type.h"
23 
24 namespace OHOS::Ace {
25 
26 struct TextInputConfiguration {
27     std::string ToJsonString() const;
28 
29     // Currently this is which only supported.
30     TextInputType type = TextInputType::TEXT;
31     // Obscure support for password and so on.
32     bool obscureText = false;
33     // What label to show on action button. For e.g. GO / Search!
34     std::string actionLabel;
35     TextInputAction action = TextInputAction::UNSPECIFIED;
36     std::string inputFilter;
37     uint32_t maxLength;
38     // Below maybe supported in the future. Just keep for placeholder.
39     bool autoCorrect = false;
40     std::string capitalization;
41     std::string keyboardAppearance;
42 };
43 
44 } // namespace OHOS::Ace
45 
46 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMMON_IME_TEXT_INPUT_CONFIGURATION_H
47