• 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 <display_manager.h>
23 #include <input_manager.h>
24 
25 #include "drag_data.h"
26 #include "stream_session.h"
27 
28 namespace OHOS {
29 namespace Msdp {
30 namespace DeviceStatus {
31 class IDragManager {
32 public:
33     IDragManager() = default;
34     virtual ~IDragManager() = default;
35 
36     virtual void Dump(int32_t fd) const = 0;
37     virtual void RegisterStateChange(std::function<void(DragState)> callback) = 0;
38     virtual int32_t StartDrag(const DragData &dragData, SessionPtr sess) = 0;
39     virtual int32_t StopDrag(const DragDropResult &dropResult) = 0;
40     virtual DragState GetDragState() const = 0;
41     virtual void SetDragState(DragState state) = 0;
42     virtual DragResult GetDragResult() const = 0;
43     virtual int32_t OnSetDragWindowVisible(bool visible, bool isForce = false) = 0;
44     virtual OHOS::MMI::ExtraData GetExtraData(bool appended) const = 0;
45     virtual void RegisterNotifyPullUp(std::function<void(bool)> callback) = 0;
46     virtual void SetPointerEventFilterTime(int64_t filterTime) = 0;
47     virtual void MoveTo(int32_t x, int32_t y) = 0;
48     virtual int32_t UpdatePreviewStyle(const PreviewStyle &previewStyle) = 0;
49     virtual int32_t UpdatePreviewStyleWithAnimation(const PreviewStyle &previewStyle,
50         const PreviewAnimation &animation) = 0;
51     virtual void GetAllowDragState(bool &isAllowDrag) = 0;
52     virtual int32_t RotateDragWindow(Rosen::Rotation rotation) = 0;
53 };
54 } // namespace DeviceStatus
55 } // namespace Msdp
56 } // namespace OHOS
57 #endif // I_DRAG_MANAGER_H