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 #include "multimodal_event.h" 17 18 namespace OHOS { Initialize(MultimodalProperty & multimodalProperty)19void MultimodalEvent::Initialize(MultimodalProperty &multimodalProperty) 20 { 21 multiProperty_.uuid = multimodalProperty.uuid; 22 multiProperty_.occurredTime = multimodalProperty.occurredTime; 23 multiProperty_.sourceType = multimodalProperty.sourceType; 24 multiProperty_.highLevelEvent = multimodalProperty.highLevelEvent; 25 multiProperty_.deviceId = multimodalProperty.deviceId; 26 multiProperty_.inputDeviceId = multimodalProperty.inputDeviceId; 27 multiProperty_.isHighLevelEvent = multimodalProperty.isHighLevelEvent; 28 } 29 Marshalling(Parcel & parcel) const30bool MultimodalEvent::Marshalling(Parcel &parcel) const 31 { 32 return false; 33 } 34 Unmarshalling(Parcel & parcel)35MultimodalEvent *MultimodalEvent::Unmarshalling(Parcel &parcel) 36 { 37 MultimodalEvent *event = new (std::nothrow) MultimodalEvent(); 38 if (event == nullptr) { 39 return nullptr; 40 } 41 return event; 42 } 43 IsSameEvent(const std::string & id)44bool MultimodalEvent::IsSameEvent(const std::string &id) 45 { 46 return multiProperty_.uuid == id; 47 } 48 IsHighLevelInput()49bool MultimodalEvent::IsHighLevelInput() 50 { 51 return multiProperty_.isHighLevelEvent; 52 } 53 GetHighLevelEvent()54int MultimodalEvent::GetHighLevelEvent() 55 { 56 return multiProperty_.highLevelEvent; 57 } 58 GetSourceDevice()59int MultimodalEvent::GetSourceDevice() 60 { 61 return multiProperty_.sourceType; 62 } 63 GetDeviceId()64std::string MultimodalEvent::GetDeviceId() 65 { 66 return multiProperty_.deviceId; 67 } 68 GetInputDeviceId()69int MultimodalEvent::GetInputDeviceId() 70 { 71 return multiProperty_.inputDeviceId; 72 } 73 GetOccurredTime()74int MultimodalEvent::GetOccurredTime() 75 { 76 return multiProperty_.occurredTime; 77 } 78 GetUuid()79std::string MultimodalEvent::GetUuid() 80 { 81 return multiProperty_.uuid; 82 } 83 } // namespace OHOS 84