1 /* 2 * Copyright (c) 2023 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 "drag_event.h" 17 18 #if defined(ACE_STATIC) 19 #include "frameworks/core/components_ng/event/gesture_event_hub.h" 20 #endif 21 22 namespace OHOS::Ace { SetData(const RefPtr<UnifiedData> & unifiedData)23void DragEvent::SetData(const RefPtr<UnifiedData>& unifiedData) 24 { 25 unifiedData_ = unifiedData; 26 } 27 GetData()28RefPtr<UnifiedData>& DragEvent::GetData() 29 { 30 return unifiedData_; 31 } 32 SetDragInfo(const RefPtr<UnifiedData> & dragInfo)33void DragEvent::SetDragInfo(const RefPtr<UnifiedData>& dragInfo) 34 { 35 dragInfo_ = dragInfo; 36 } 37 GetDragInfo()38RefPtr<UnifiedData>& DragEvent::GetDragInfo() 39 { 40 return dragInfo_; 41 } 42 43 #if defined(ACE_STATIC) GetDragDropInfoPixelMap() const44RefPtr<PixelMap> DragEvent::GetDragDropInfoPixelMap() const 45 { 46 return dragDropInfoPixelMap_; 47 } 48 GetDragDropInfoCustomNode() const49void* DragEvent::GetDragDropInfoCustomNode() const 50 { 51 return dragDropInfoCustomNode_; 52 } 53 GetDragDropInfoExtraInfo() const54std::string DragEvent::GetDragDropInfoExtraInfo() const 55 { 56 return dragDropInfoExtraInfo_; 57 } 58 SetDragDropInfoPixelMap(RefPtr<PixelMap> pixelMap)59void DragEvent::SetDragDropInfoPixelMap(RefPtr<PixelMap> pixelMap) 60 { 61 dragDropInfoPixelMap_ = pixelMap; 62 } 63 SetDragDropInfoExtraInfo(std::string & extraInfo)64void DragEvent::SetDragDropInfoExtraInfo(std::string& extraInfo) 65 { 66 dragDropInfoExtraInfo_ = extraInfo; 67 } 68 SetDragDropInfoCustomNode(void * customNode)69void DragEvent::SetDragDropInfoCustomNode(void* customNode) 70 { 71 dragDropInfoCustomNode_ = customNode; 72 } 73 #endif 74 75 } // namespace OHOS::Ace