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#ifndef OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H
16#define OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H
17/**
18 * @addtogroup InputMethod
19 * @{
20 *
21 * @brief InputMethod provides functions to use input methods and develop input methods.
22 *
23 * @since 12
24 */
25
26/**
27 * @file inputmethod_attach_options_capi.h
28 *
29 * @brief Provides the input method attach options.
30 *
31 * @library libohinputmethod.so
32 * @kit IMEKit
33 * @syscap SystemCapability.MiscServices.InputMethodFramework
34 * @since 12
35 * @version 1.0
36 */
37#include "inputmethod_types_capi.h"
38#ifdef __cplusplus
39extern "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 */
48typedef 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 */
58InputMethod_AttachOptions *OH_AttachOptions_Create(bool showKeyboard);
59/**
60 * @brief Delete a {@link InputMethod_AttachOptions} instance.
61 *
62 * @param options Represents a pointer to an {@link InputMethod_AttachOptions} instance which will be destroyed.
63 * @since 12
64 */
65void OH_AttachOptions_Destroy(InputMethod_AttachOptions *options);
66/**
67 * @brief Get showKeyboard value from {@link InputMethod_AttachOptions}.
68 *
69 * @param options Represents a pointer to an {@link InputMethod_AttachOptions} instance which will be get value from.
70 * @param showKeyboard  Represents showKeyboard value.
71 *     true - need to show keyboard.
72 *     false - no need to show keyboard.
73 * @return Returns a specific error code.
74 *     {@link IME_ERR_OK} - success.
75 *     {@link IME_ERR_NULL_POINTER} - unexpected null pointer.
76 * Specific error codes can be referenced {@link InputMethod_ErrorCode}.
77 * @since 12
78 */
79InputMethod_ErrorCode OH_AttachOptions_IsShowKeyboard(InputMethod_AttachOptions *options, bool *showKeyboard);
80#ifdef __cplusplus
81}
82#endif /* __cplusplus */
83/** @} */
84#endif // OHOS_INPUTMETHOD_ATTACH_OPTIONS_CAPI_H