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_IMC_PROJECT_INPUTDATACHANNELPROXY_H 17 #define FM_IMC_PROJECT_INPUTDATACHANNELPROXY_H 18 19 #include "iremote_proxy.h" 20 #include "i_input_data_channel.h" 21 #include "input_method_utils.h" 22 23 namespace OHOS { 24 namespace MiscServices { 25 class InputDataChannelProxy : public IRemoteProxy<IInputDataChannel> { 26 public: 27 explicit InputDataChannelProxy(const sptr<IRemoteObject> &object); 28 ~InputDataChannelProxy() = default; 29 DISALLOW_COPY_AND_MOVE(InputDataChannelProxy); 30 31 bool InsertText(const std::u16string& text) override; 32 bool DeleteForward(int32_t length) override; 33 bool DeleteBackward(int32_t length) override; 34 void Close() override; 35 std::u16string GetTextBeforeCursor(int32_t number) override; 36 std::u16string GetTextAfterCursor(int32_t number) override; 37 void SendKeyboardStatus(int32_t status) override; 38 void SendFunctionKey(int32_t funcKey) override; 39 void MoveCursor(int32_t keyCode) override; 40 int32_t GetEnterKeyType() override; 41 int32_t GetInputPattern() override; 42 void StopInput() override; 43 44 private: 45 static inline BrokerDelegator<InputDataChannelProxy> delegator_; 46 }; 47 } 48 } 49 #endif