• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 /*
3  * Copyright (c) 2023 Huawei Device Co., Ltd.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef FOUNDATION_ACE_ACE_ENGINE_ADAPTER_OHOS_CAPABILITY_INTERACTION_START_DRAG_LISTENER_IMPL_H
18 #define FOUNDATION_ACE_ACE_ENGINE_ADAPTER_OHOS_CAPABILITY_INTERACTION_START_DRAG_LISTENER_IMPL_H
19 
20 #include <functional>
21 
22 #include "i_start_drag_listener.h"
23 
24 using DragingCallback = std::function<void(const OHOS::Msdp::DeviceStatus::DragNotifyMsg&)>;
25 
26 namespace OHOS::Ace {
27 class StartDragListenerImpl : public OHOS::Msdp::DeviceStatus::IStartDragListener {
28 public:
29     StartDragListenerImpl() = default;
StartDragListenerImpl(DragingCallback callback)30     StartDragListenerImpl(DragingCallback callback) : callback_(callback) { }
31 
OnDragEndMessage(const OHOS::Msdp::DeviceStatus::DragNotifyMsg & msg)32     void OnDragEndMessage(const OHOS::Msdp::DeviceStatus::DragNotifyMsg &msg) override
33     {
34         if (callback_) {
35             callback_(msg);
36         }
37     }
OnHideIconMessage()38     void OnHideIconMessage() override
39     {
40     }
41 private:
42     DragingCallback callback_;
43 };
44 } // namespace OHOS::Ace
45 #endif // FOUNDATION_ACE_ACE_ENGINE_ADAPTER_OHOS_CAPABILITY_INTERACTION_START_DRAG_LISTENER_IMPL_H
46 
47