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 25namespace OHOS { 26namespace MMI { 27 28AncoChannel::AncoChannel(std::shared_ptr<IAncoConsumer> consumer) 29 : consumer_(consumer) 30{} 31 32int32_t AncoChannel::SyncInputEvent(std::shared_ptr<PointerEvent> pointerEvent) 33{ 34 CHKPR(consumer_, RET_ERR); 35 return consumer_->SyncInputEvent(pointerEvent); 36} 37 38int32_t AncoChannel::SyncInputEvent(std::shared_ptr<KeyEvent> keyEvent) 39{ 40 CHKPR(consumer_, RET_ERR); 41 return consumer_->SyncInputEvent(keyEvent); 42} 43 44int32_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