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 FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_I_INPUT_METHOD_CORE_H 17 #define FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_I_INPUT_METHOD_CORE_H 18 19 #include "global.h" 20 #include "i_input_control_channel.h" 21 #include "input_attribute.h" 22 #include "input_client_info.h" 23 #include "input_method_property.h" 24 #include "ipc_types.h" 25 #include "iremote_broker.h" 26 #include "panel_info.h" 27 28 /** 29 * brief Definition of interface IInputMethodCore 30 * It defines the remote calls from input method management service to input method service 31 */ 32 namespace OHOS { 33 namespace MiscServices { 34 class IInputMethodCore : public IRemoteBroker { 35 public: 36 enum { 37 CORE_CMD_BEGIN, 38 SHOW_KEYBOARD = CORE_CMD_BEGIN, 39 STOP_INPUT_SERVICE, 40 HIDE_KEYBOARD, 41 INIT_INPUT_CONTROL_CHANNEL, 42 SET_SUBTYPE, 43 START_INPUT, 44 STOP_INPUT, 45 IS_ENABLE, 46 IS_PANEL_SHOWN, 47 SECURITY_CHANGE, 48 ON_CLIENT_INACTIVE, 49 ON_CONNECT_SYSTEM_CMD, 50 CORE_CMD_END, 51 }; 52 53 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.miscservices.inputmethod.IInputMethodCore"); 54 55 virtual int32_t StartInput(const InputClientInfo &clientInfo, bool isBindFromClient) = 0; 56 virtual int32_t StopInput(const sptr<IRemoteObject> &channel) = 0; 57 virtual int32_t ShowKeyboard() = 0; 58 virtual int32_t HideKeyboard() = 0; 59 virtual int32_t InitInputControlChannel(const sptr<IInputControlChannel> &inputControlChannel) = 0; 60 virtual int32_t StopInputService(bool isTerminateIme) = 0; 61 virtual int32_t SetSubtype(const SubProperty &property) = 0; 62 virtual bool IsEnable() = 0; 63 virtual int32_t IsPanelShown(const PanelInfo &panelInfo, bool &isShown) = 0; 64 virtual int32_t OnSecurityChange(int32_t security) = 0 ; 65 virtual int32_t OnConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent) = 0 ; 66 virtual void OnClientInactive(const sptr<IRemoteObject> &channel) = 0; 67 }; 68 } // namespace MiscServices 69 } // namespace OHOS 70 #endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_I_INPUT_METHOD_CORE_H 71