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 FM_IMMS_PROJECT_IPLATFORMAPI_H 17 #define FM_IMMS_PROJECT_IPLATFORMAPI_H 18 19 #include <vector> 20 #include <string> 21 #include "iremote_broker.h" 22 #include "ipc_types.h" 23 24 #include "i_platform_callback.h" 25 #include "input_method_property.h" 26 #include "input_method_setting.h" 27 #include "i_input_method_core.h" 28 #include "global.h" 29 30 namespace OHOS { 31 namespace MiscServices { 32 class IPlatformApi : public IRemoteBroker { 33 public: 34 enum { 35 REGISTER_CALLBACK = FIRST_CALL_TRANSACTION, 36 BIND_IMS, 37 UNBIND_IMS, 38 CREATE_WINDOW_TOKEN, 39 DESTROY_WINDOW_TOKEN, 40 LIST_INPUT_METHOD, 41 GET_INPUT_METHOD_PROPERTY, 42 GET_INPUT_METHOD_SETTING, 43 SET_INPUT_METHOD_SETTING, 44 }; 45 46 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.miscservices.inputmethod.IPlatformApi"); 47 48 virtual int32_t registerCallback(const sptr<IPlatformCallback>& cb) = 0; 49 virtual sptr<IInputMethodCore> bindInputMethodService(const std::u16string& packageName, 50 const std::u16string& intention, int userId) = 0; 51 virtual int32_t unbindInputMethodService(int userId, const std::u16string& packageName) = 0; 52 virtual sptr<IRemoteObject> createWindowToken(int userId, int displayId, const std::u16string& packageName) = 0; 53 virtual int32_t destroyWindowToken(int userId, const std::u16string& packageName) = 0; 54 virtual int32_t listInputMethod(int userId, std::vector<InputMethodProperty*> *properties) = 0; 55 virtual int32_t getInputMethodProperty(int userId, const std::u16string& packageName, 56 InputMethodProperty *inputMethodProperty) = 0; 57 virtual int32_t getInputMethodSetting(int userId, InputMethodSetting *inputMethodSetting) = 0; 58 virtual int32_t setInputMethodSetting(int userId, const InputMethodSetting& inputMethodSetting) = 0; 59 }; 60 } 61 } 62 #endif // FM_IMMS_PROJECT_IPLATFORMAPI_H 63