• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (c) 2025 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_CONTROLLER_INCLUDE_INPUT_DATA_CHANNEL_IMPL_H
17 #define FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_DATA_CHANNEL_IMPL_H
18 
19 #include "iinput_data_channel.h"
20 #include "input_data_channel_stub.h"
21 #include "iremote_object.h"
22 #include "inputmethod_message_handler.h"
23 
24 namespace OHOS {
25 namespace MiscServices {
26 class InputDataChannelServiceImpl final : public InputDataChannelStub,
27     public std::enable_shared_from_this<InputDataChannelServiceImpl> {
28     DISALLOW_COPY_AND_MOVE(InputDataChannelServiceImpl);
29 
30 public:
31     InputDataChannelServiceImpl();
32     ~InputDataChannelServiceImpl();
33 
34     ErrCode InsertText(const std::string &text, uint64_t msgId, const sptr<IRemoteObject> &agent) override;
35     ErrCode DeleteForward(int32_t length, uint64_t msgId, const sptr<IRemoteObject> &agent) override;
36     ErrCode DeleteBackward(int32_t length, uint64_t msgId, const sptr<IRemoteObject> &agent) override;
37     ErrCode GetTextBeforeCursor(int32_t number, uint64_t msgId, const sptr<IRemoteObject> &agent) override;
38     ErrCode GetTextAfterCursor(int32_t number, uint64_t msgId, const sptr<IRemoteObject> &agent) override;
39     ErrCode GetTextConfig(TextTotalConfigInner &textConfigInner) override;
40     ErrCode SendKeyboardStatus(int32_t status) override;
41     ErrCode SendFunctionKey(int32_t funcKey, uint64_t msgId, const sptr<IRemoteObject> &agent) override;
42     ErrCode MoveCursor(int32_t keyCode, uint64_t msgId, const sptr<IRemoteObject> &agent) override;
43     ErrCode GetEnterKeyType(int32_t &keyType) override;
44     ErrCode GetInputPattern(int32_t &inputPattern) override;
45     ErrCode SelectByRange(int32_t start, int32_t end, uint64_t msgId, const sptr<IRemoteObject> &agent) override;
46     ErrCode SelectByMovement(
47         int32_t direction, int32_t cursorMoveSkip, uint64_t msgId, const sptr<IRemoteObject> &agent) override;
48     ErrCode HandleExtendAction(int32_t action, uint64_t msgId, const sptr<IRemoteObject> &agent) override;
49     ErrCode GetTextIndexAtCursor(uint64_t msgId, const sptr<IRemoteObject> &agent) override;
50     ErrCode NotifyPanelStatusInfo(const PanelStatusInfoInner &info) override;
51     ErrCode NotifyKeyboardHeight(uint32_t height) override;
52     ErrCode SendPrivateCommand(const Value &value) override;
53     ErrCode SetPreviewText(const std::string &text, const RangeInner &rangeInner, uint64_t msgId,
54         const sptr<IRemoteObject> &agent) override;
55     ErrCode FinishTextPreview(uint64_t msgId, const sptr<IRemoteObject> &agent) override;
56     ErrCode SendMessage(const ArrayBuffer &arraybuffer) override;
57     ErrCode HandleKeyEventResult(uint64_t cbId, bool consumeResult) override;
58 };
59 }  // namespace MiscServices
60 }  // namespace OHOS
61 #endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_DATA_CHANNEL_IMPL_H