1 /*
2  * Copyright (c) 2024 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 #include "anco_channel.h"
17 
18 #include "define_multimodal.h"
19 
20 #undef MMI_LOG_DOMAIN
21 #define MMI_LOG_DOMAIN MMI_LOG_HANDLER
22 #undef MMI_LOG_TAG
23 #define MMI_LOG_TAG "AncoChannel"
24 
25 namespace OHOS {
26 namespace MMI {
27 
AncoChannel(std::shared_ptr<IAncoConsumer> consumer)28 AncoChannel::AncoChannel(std::shared_ptr<IAncoConsumer> consumer)
29     : consumer_(consumer)
30 {}
31 
SyncInputEvent(std::shared_ptr<PointerEvent> pointerEvent)32 int32_t AncoChannel::SyncInputEvent(std::shared_ptr<PointerEvent> pointerEvent)
33 {
34     CHKPR(consumer_, RET_ERR);
35     return consumer_->SyncInputEvent(pointerEvent);
36 }
37 
SyncInputEvent(std::shared_ptr<KeyEvent> keyEvent)38 int32_t AncoChannel::SyncInputEvent(std::shared_ptr<KeyEvent> keyEvent)
39 {
40     CHKPR(consumer_, RET_ERR);
41     return consumer_->SyncInputEvent(keyEvent);
42 }
43 
UpdateWindowInfo(std::shared_ptr<AncoWindows> windows)44 int32_t AncoChannel::UpdateWindowInfo(std::shared_ptr<AncoWindows> windows)
45 {
46     CHKPR(consumer_, RET_ERR);
47     return consumer_->UpdateWindowInfo(windows);
48 }
49 } // namespace MMI
50 } // namespace OHOS
51