• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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  * @addtogroup InputMethod
17  * @{
18  *
19  * @brief InputMethod provides functions to use input methods and develop input methods.
20  *
21  * @since 12
22  */
23 
24 /**
25  * @file inputmethod_attach_options_capi.h
26  *
27  * @brief Provides the input method attach options.
28  *
29  * @library libohinputmethod.so
30  * @kit IMEKit
31  * @syscap SystemCapability.MiscServices.InputMethodFramework
32  * @since 12
33  * @version 1.0
34  */
35 #ifndef OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H
36 #define OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H
37 #include "inputmethod_types_capi.h"
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41 /**
42  * @brief Define the InputMethod_AttachOptions structure type.
43  *
44  * The options when attaching input method.
45  *
46  * @since 12
47  */
48 typedef struct InputMethod_AttachOptions InputMethod_AttachOptions;
49 
50 /**
51  * @brief Create a new {@link InputMethod_AttachOptions} instance.
52  *
53  * @param showKeyboard Represents whether to show the keyboard.
54  * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_AttachOptions}
55  * instance is returned. If the creation fails, NULL is returned, possible cause is insufficient memory.
56  * @since 12
57  */
58 InputMethod_AttachOptions *OH_AttachOptions_Create(bool showKeyboard);
59 /**
60  * @brief Create a new {@link InputMethod_AttachOptions} instance.
61  *
62  * @param showKeyboard Represents whether to show the keyboard.
63  * @param requestKeyboardReason  the reason for showKeyboard.
64  * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_AttachOptions}
65  * instance is returned. If the creation fails, NULL is returned, possible cause is insufficient memory.
66  * @since 15
67  */
68 InputMethod_AttachOptions *OH_AttachOptions_CreateWithRequestKeyboardReason(
69     bool showKeyboard, InputMethod_RequestKeyboardReason requestKeyboardReason);
70 /**
71  * @brief Delete a {@link InputMethod_AttachOptions} instance.
72  *
73  * @param options Represents a pointer to an {@link InputMethod_AttachOptions} instance which will be destroyed.
74  * @since 12
75  */
76 void OH_AttachOptions_Destroy(InputMethod_AttachOptions *options);
77 /**
78  * @brief Get showKeyboard value from {@link InputMethod_AttachOptions}.
79  *
80  * @param options Represents a pointer to an {@link InputMethod_AttachOptions} instance which will be get value from.
81  * @param showKeyboard  Represents showKeyboard value.
82  *     true - need to show keyboard.
83  *     false - no need to show keyboard.
84  * @return Returns a specific error code.
85  *     {@link IME_ERR_OK} - success.
86  *     {@link IME_ERR_NULL_POINTER} - unexpected null pointer.
87  * Specific error codes can be referenced {@link InputMethod_ErrorCode}.
88  * @since 12
89  */
90 InputMethod_ErrorCode OH_AttachOptions_IsShowKeyboard(InputMethod_AttachOptions *options, bool *showKeyboard);
91 /**
92  * @brief Get showKeyboard value from {@link InputMethod_AttachOptions}.
93  *
94  * @param options Represents a pointer to an {@link InputMethod_AttachOptions} instance which will be get value from.
95  * @param requestKeyboardReason  Represents a pointer to an {@link InputMethodRequestKeyboardReason} instance which will
96  * be get value from.
97  * @return Returns a specific error code.
98  *     {@link IME_ERR_OK} - success.
99  *     {@link IME_ERR_NULL_POINTER} - unexpected null pointer. If options is NULL, or requestKeyboardReason is NULL.
100  * Specific error codes can be referenced {@link InputMethod_ErrorCode}.
101  * @since 15
102  */
103 InputMethod_ErrorCode OH_AttachOptions_GetRequestKeyboardReason(
104     InputMethod_AttachOptions *options, int *requestKeyboardReason);
105 #ifdef __cplusplus
106 }
107 #endif /* __cplusplus */
108 /** @} */
109 #endif // OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H