• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef I_DRAG_MANAGER_H
17 #define I_DRAG_MANAGER_H
18 
19 #include <cstdint>
20 #include <functional>
21 
22 #include <input_manager.h>
23 
24 #include "drag_data.h"
25 #include "stream_session.h"
26 
27 namespace OHOS {
28 namespace Msdp {
29 namespace DeviceStatus {
30 class IDragManager {
31 public:
32     IDragManager() = default;
33     virtual ~IDragManager() = default;
34 
35     virtual void Dump(int32_t fd) const = 0;
36     virtual void RegisterStateChange(std::function<void(DragState)> callback) = 0;
37     virtual int32_t StartDrag(const DragData &dragData, SessionPtr sess) = 0;
38     virtual int32_t StopDrag(DragResult result, bool hasCustomAnimation) = 0;
39     virtual DragState GetDragState() const = 0;
40     virtual void SetDragState(DragState state) = 0;
41     virtual DragResult GetDragResult() const = 0;
42     virtual int32_t OnSetDragWindowVisible(bool visible) = 0;
43     virtual OHOS::MMI::ExtraData GetExtraData(bool appended) const = 0;
44     virtual void RegisterNotifyPullUp(std::function<void(void)> callback) = 0;
45 };
46 } // namespace DeviceStatus
47 } // namespace Msdp
48 } // namespace OHOS
49 #endif // I_DRAG_MANAGER_H