122736c2fSopenharmony_ci/*
222736c2fSopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd.
322736c2fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
422736c2fSopenharmony_ci * you may not use this file except in compliance with the License.
522736c2fSopenharmony_ci * You may obtain a copy of the License at
622736c2fSopenharmony_ci *
722736c2fSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
822736c2fSopenharmony_ci *
922736c2fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1022736c2fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1122736c2fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1222736c2fSopenharmony_ci * See the License for the specific language governing permissions and
1322736c2fSopenharmony_ci * limitations under the License.
1422736c2fSopenharmony_ci */
1522736c2fSopenharmony_ci
1622736c2fSopenharmony_ci#ifndef SERVICES_INCLUDE_I_INPUT_METHOD_SYSTEM_ABILITY_H
1722736c2fSopenharmony_ci#define SERVICES_INCLUDE_I_INPUT_METHOD_SYSTEM_ABILITY_H
1822736c2fSopenharmony_ci
1922736c2fSopenharmony_ci#include <errors.h>
2022736c2fSopenharmony_ci#include <memory>
2122736c2fSopenharmony_ci#include <vector>
2222736c2fSopenharmony_ci
2322736c2fSopenharmony_ci#include "element_name.h"
2422736c2fSopenharmony_ci#include "event_status_manager.h"
2522736c2fSopenharmony_ci#include "global.h"
2622736c2fSopenharmony_ci#include "i_input_client.h"
2722736c2fSopenharmony_ci#include "i_input_method_core.h"
2822736c2fSopenharmony_ci#include "i_system_cmd_channel.h"
2922736c2fSopenharmony_ci#include "input_attribute.h"
3022736c2fSopenharmony_ci#include "input_client_info.h"
3122736c2fSopenharmony_ci#include "input_method_property.h"
3222736c2fSopenharmony_ci#include "input_method_status.h"
3322736c2fSopenharmony_ci#include "input_window_info.h"
3422736c2fSopenharmony_ci#include "iremote_broker.h"
3522736c2fSopenharmony_ci#include "message_parcel.h"
3622736c2fSopenharmony_ci#include "panel_info.h"
3722736c2fSopenharmony_ci#include "input_method_types.h"
3822736c2fSopenharmony_ci
3922736c2fSopenharmony_cinamespace OHOS {
4022736c2fSopenharmony_cinamespace MiscServices {
4122736c2fSopenharmony_ciclass IInputMethodSystemAbility : public IRemoteBroker {
4222736c2fSopenharmony_cipublic:
4322736c2fSopenharmony_ci    DECLARE_INTERFACE_DESCRIPTOR(u"ohos.miscservices.inputmethod.IInputMethodSystemAbility");
4422736c2fSopenharmony_ci
4522736c2fSopenharmony_ci    virtual int32_t StartInput(InputClientInfo &inputClientInfo, sptr<IRemoteObject> &agent) = 0;
4622736c2fSopenharmony_ci    virtual int32_t ShowCurrentInput() = 0;
4722736c2fSopenharmony_ci    virtual int32_t HideCurrentInput() = 0;
4822736c2fSopenharmony_ci    virtual int32_t StopInputSession() = 0;
4922736c2fSopenharmony_ci    virtual int32_t ShowInput(sptr<IInputClient> client) = 0;
5022736c2fSopenharmony_ci    virtual int32_t HideInput(sptr<IInputClient> client) = 0;
5122736c2fSopenharmony_ci    virtual int32_t ReleaseInput(sptr<IInputClient> client) = 0;
5222736c2fSopenharmony_ci    virtual int32_t RequestShowInput() = 0;
5322736c2fSopenharmony_ci    virtual int32_t RequestHideInput() = 0;
5422736c2fSopenharmony_ci    virtual int32_t GetDefaultInputMethod(std::shared_ptr<Property> &prop, bool isBrief) = 0;
5522736c2fSopenharmony_ci    virtual int32_t GetInputMethodConfig(AppExecFwk::ElementName &inputMethodConfig) = 0;
5622736c2fSopenharmony_ci    virtual std::shared_ptr<Property> GetCurrentInputMethod() = 0;
5722736c2fSopenharmony_ci    virtual std::shared_ptr<SubProperty> GetCurrentInputMethodSubtype() = 0;
5822736c2fSopenharmony_ci    virtual int32_t ListInputMethod(InputMethodStatus status, std::vector<Property> &props) = 0;
5922736c2fSopenharmony_ci    virtual int32_t DisplayOptionalInputMethod() = 0;
6022736c2fSopenharmony_ci    virtual int32_t SetCoreAndAgent(const sptr<IInputMethodCore> &core, const sptr<IRemoteObject> &agent) = 0;
6122736c2fSopenharmony_ci    virtual int32_t InitConnect() = 0;
6222736c2fSopenharmony_ci    virtual int32_t UnRegisteredProxyIme(UnRegisteredType type, const sptr<IInputMethodCore> &core) = 0;
6322736c2fSopenharmony_ci    virtual int32_t ListCurrentInputMethodSubtype(std::vector<SubProperty> &subProps) = 0;
6422736c2fSopenharmony_ci    virtual int32_t ListInputMethodSubtype(const std::string &name, std::vector<SubProperty> &subProps) = 0;
6522736c2fSopenharmony_ci    virtual int32_t SwitchInputMethod(const std::string &bundleName, const std::string &name,
6622736c2fSopenharmony_ci        SwitchTrigger trigger) = 0;
6722736c2fSopenharmony_ci    virtual int32_t PanelStatusChange(const InputWindowStatus &status, const ImeWindowInfo &info) = 0;
6822736c2fSopenharmony_ci    virtual int32_t UpdateListenEventFlag(InputClientInfo &clientInfo, uint32_t eventFlag) = 0;
6922736c2fSopenharmony_ci    virtual bool IsCurrentIme() = 0;
7022736c2fSopenharmony_ci    virtual bool IsInputTypeSupported(InputType type) = 0;
7122736c2fSopenharmony_ci    virtual bool IsCurrentImeByPid(int32_t pid) = 0;
7222736c2fSopenharmony_ci    virtual int32_t StartInputType(InputType type) = 0;
7322736c2fSopenharmony_ci    virtual int32_t ExitCurrentInputType() = 0;
7422736c2fSopenharmony_ci    virtual int32_t IsPanelShown(const PanelInfo &panelInfo, bool &isShown) = 0;
7522736c2fSopenharmony_ci    virtual int32_t GetSecurityMode(int32_t &security) = 0;
7622736c2fSopenharmony_ci    virtual int32_t IsDefaultIme() = 0;
7722736c2fSopenharmony_ci    virtual bool IsDefaultImeSet() = 0;
7822736c2fSopenharmony_ci    virtual bool EnableIme(const std::string &bundleName) = 0;
7922736c2fSopenharmony_ci    virtual int32_t ConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent) = 0;
8022736c2fSopenharmony_ci
8122736c2fSopenharmony_ci    // Deprecated because of no permission check, and keep for compatibility
8222736c2fSopenharmony_ci    virtual int32_t HideCurrentInputDeprecated() = 0;
8322736c2fSopenharmony_ci    virtual int32_t ShowCurrentInputDeprecated() = 0;
8422736c2fSopenharmony_ci};
8522736c2fSopenharmony_ci} // namespace MiscServices
8622736c2fSopenharmony_ci} // namespace OHOS
8722736c2fSopenharmony_ci#endif // SERVICES_INCLUDE_I_INPUT_METHOD_SYSTEM_ABILITY_H
88