1 /* 2 * Copyright (C) 2022 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 SERVICES_INCLUDE_I_INPUT_METHOD_SYSTEM_ABILITY_H 17 #define SERVICES_INCLUDE_I_INPUT_METHOD_SYSTEM_ABILITY_H 18 19 #include "element_name.h" 20 #include "event_status_manager.h" 21 #include "i_input_method_core.h" 22 #include "i_system_cmd_channel.h" 23 #include "input_method_status.h" 24 #include "input_method_types.h" 25 26 namespace OHOS { 27 namespace MiscServices { 28 class IInputMethodSystemAbility : public IRemoteBroker { 29 public: 30 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.miscservices.inputmethod.IInputMethodSystemAbility"); 31 32 virtual int32_t StartInput(InputClientInfo &inputClientInfo, sptr<IRemoteObject> &agent, 33 std::pair<int64_t, std::string> &imeInfo) = 0; 34 virtual int32_t ShowCurrentInput(ClientType type = ClientType::INNER_KIT) = 0; 35 virtual int32_t HideCurrentInput() = 0; 36 virtual int32_t StopInputSession() = 0; 37 virtual int32_t ShowInput( 38 sptr<IInputClient> client, ClientType type = ClientType::INNER_KIT, int32_t requestKeyboardReason = 0) = 0; 39 virtual int32_t HideInput(sptr<IInputClient> client) = 0; 40 virtual int32_t ReleaseInput(sptr<IInputClient> client) = 0; 41 virtual int32_t RequestShowInput() = 0; 42 virtual int32_t RequestHideInput(bool isFocusTriggered) = 0; 43 virtual int32_t GetDefaultInputMethod(std::shared_ptr<Property> &prop, bool isBrief) = 0; 44 virtual int32_t GetInputMethodConfig(AppExecFwk::ElementName &inputMethodConfig) = 0; 45 virtual std::shared_ptr<Property> GetCurrentInputMethod() = 0; 46 virtual std::shared_ptr<SubProperty> GetCurrentInputMethodSubtype() = 0; 47 virtual int32_t ListInputMethod(InputMethodStatus status, std::vector<Property> &props) = 0; 48 virtual int32_t DisplayOptionalInputMethod() = 0; 49 virtual int32_t SetCoreAndAgent(const sptr<IInputMethodCore> &core, const sptr<IRemoteObject> &agent) = 0; 50 virtual int32_t InitConnect() = 0; 51 virtual int32_t UnRegisteredProxyIme(UnRegisteredType type, const sptr<IInputMethodCore> &core) = 0; 52 virtual int32_t ListCurrentInputMethodSubtype(std::vector<SubProperty> &subProps) = 0; 53 virtual int32_t ListInputMethodSubtype(const std::string &name, std::vector<SubProperty> &subProps) = 0; 54 virtual int32_t SwitchInputMethod(const std::string &bundleName, const std::string &name, 55 SwitchTrigger trigger) = 0; 56 virtual int32_t PanelStatusChange(const InputWindowStatus &status, const ImeWindowInfo &info) = 0; 57 virtual int32_t UpdateListenEventFlag(InputClientInfo &clientInfo, uint32_t eventFlag) = 0; 58 virtual bool IsCurrentIme() = 0; 59 virtual bool IsInputTypeSupported(InputType type) = 0; 60 virtual bool IsCurrentImeByPid(int32_t pid) = 0; 61 virtual int32_t StartInputType(InputType type) = 0; 62 virtual int32_t ExitCurrentInputType() = 0; 63 virtual int32_t IsPanelShown(const PanelInfo &panelInfo, bool &isShown) = 0; 64 virtual int32_t GetSecurityMode(int32_t &security) = 0; 65 virtual int32_t IsDefaultIme() = 0; 66 virtual bool IsDefaultImeSet() = 0; 67 virtual bool EnableIme(const std::string &bundleName) = 0; 68 virtual int32_t ConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent) = 0; 69 virtual int32_t GetInputMethodState(EnabledStatus &status) = 0; 70 virtual bool IsSystemApp() = 0; 71 72 // Deprecated because of no permission check, and keep for compatibility 73 virtual int32_t HideCurrentInputDeprecated() = 0; 74 virtual int32_t ShowCurrentInputDeprecated() = 0; 75 76 virtual int32_t SetCallingWindow(uint32_t windowId, sptr<IInputClient> client) = 0; 77 virtual int32_t GetInputStartInfo(bool& isInputStart, uint32_t& callingWndId, int32_t& requestKeyboardReason) = 0; 78 }; 79 } // namespace MiscServices 80 } // namespace OHOS 81 #endif // SERVICES_INCLUDE_I_INPUT_METHOD_SYSTEM_ABILITY_H 82