1f857971dSopenharmony_ci/*
2f857971dSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
3f857971dSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4f857971dSopenharmony_ci * you may not use this file except in compliance with the License.
5f857971dSopenharmony_ci * You may obtain a copy of the License at
6f857971dSopenharmony_ci *
7f857971dSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8f857971dSopenharmony_ci *
9f857971dSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10f857971dSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11f857971dSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12f857971dSopenharmony_ci * See the License for the specific language governing permissions and
13f857971dSopenharmony_ci * limitations under the License.
14f857971dSopenharmony_ci */
15f857971dSopenharmony_ci
16f857971dSopenharmony_ci#ifndef DRAG_SERVER_H
17f857971dSopenharmony_ci#define DRAG_SERVER_H
18f857971dSopenharmony_ci
19f857971dSopenharmony_ci#include "nocopyable.h"
20f857971dSopenharmony_ci
21f857971dSopenharmony_ci#include "accesstoken_kit.h"
22f857971dSopenharmony_ci#include "i_context.h"
23f857971dSopenharmony_ci#include "i_plugin.h"
24f857971dSopenharmony_ci
25f857971dSopenharmony_cinamespace OHOS {
26f857971dSopenharmony_cinamespace Msdp {
27f857971dSopenharmony_cinamespace DeviceStatus {
28f857971dSopenharmony_ciclass DragServer final : public IPlugin {
29f857971dSopenharmony_cipublic:
30f857971dSopenharmony_ci    DragServer(IContext *env);
31f857971dSopenharmony_ci    ~DragServer() = default;
32f857971dSopenharmony_ci    DISALLOW_COPY_AND_MOVE(DragServer);
33f857971dSopenharmony_ci
34f857971dSopenharmony_ci    int32_t Enable(CallingContext &context, MessageParcel &data, MessageParcel &reply) override;
35f857971dSopenharmony_ci    int32_t Disable(CallingContext &context, MessageParcel &data, MessageParcel &reply) override;
36f857971dSopenharmony_ci    int32_t Start(CallingContext &context, MessageParcel &data, MessageParcel &reply) override;
37f857971dSopenharmony_ci    int32_t Stop(CallingContext &context, MessageParcel &data, MessageParcel &reply) override;
38f857971dSopenharmony_ci    int32_t AddWatch(CallingContext &context, uint32_t id, MessageParcel &data, MessageParcel &reply) override;
39f857971dSopenharmony_ci    int32_t RemoveWatch(CallingContext &context, uint32_t id, MessageParcel &data, MessageParcel &reply) override;
40f857971dSopenharmony_ci    int32_t SetParam(CallingContext &context, uint32_t id, MessageParcel &data, MessageParcel &reply) override;
41f857971dSopenharmony_ci    int32_t GetParam(CallingContext &context, uint32_t id, MessageParcel &data, MessageParcel &reply) override;
42f857971dSopenharmony_ci    int32_t Control(CallingContext &context, uint32_t id, MessageParcel &data, MessageParcel &reply) override;
43f857971dSopenharmony_ci    bool IsSystemServiceCalling(CallingContext &context);
44f857971dSopenharmony_ci    bool IsSystemHAPCalling(CallingContext &context);
45f857971dSopenharmony_ci
46f857971dSopenharmony_ciprivate:
47f857971dSopenharmony_ci    int32_t SetDragWindowVisible(CallingContext &context, MessageParcel &data, MessageParcel &reply);
48f857971dSopenharmony_ci    int32_t UpdateDragStyle(CallingContext &context, MessageParcel &data, MessageParcel &reply);
49f857971dSopenharmony_ci    int32_t UpdateShadowPic(CallingContext &context, MessageParcel &data, MessageParcel &reply);
50f857971dSopenharmony_ci    int32_t UpdatePreviewStyle(CallingContext &context, MessageParcel &data, MessageParcel &reply);
51f857971dSopenharmony_ci    int32_t UpdatePreviewAnimation(CallingContext &context, MessageParcel &data, MessageParcel &reply);
52f857971dSopenharmony_ci    int32_t RotateDragWindowSync(CallingContext &context, MessageParcel &data, MessageParcel &reply);
53f857971dSopenharmony_ci    int32_t GetDragTargetPid(CallingContext &context, MessageParcel &data, MessageParcel &reply);
54f857971dSopenharmony_ci    int32_t GetUdKey(CallingContext &context, MessageParcel &data, MessageParcel &reply);
55f857971dSopenharmony_ci    int32_t GetShadowOffset(CallingContext &context, MessageParcel &data, MessageParcel &reply);
56f857971dSopenharmony_ci    int32_t GetDragData(CallingContext &context, MessageParcel &data, MessageParcel &reply);
57f857971dSopenharmony_ci    int32_t GetDragState(CallingContext &context, MessageParcel &data, MessageParcel &reply);
58f857971dSopenharmony_ci    __attribute__((no_sanitize("cfi"))) int32_t GetDragSummary(CallingContext &context,
59f857971dSopenharmony_ci        MessageParcel &data, MessageParcel &reply);
60f857971dSopenharmony_ci    int32_t GetDragAction(CallingContext &context, MessageParcel &data, MessageParcel &reply);
61f857971dSopenharmony_ci    int32_t GetExtraInfo(CallingContext &context, MessageParcel &data, MessageParcel &reply);
62f857971dSopenharmony_ci    int32_t EnterTextEditorArea(CallingContext &context, MessageParcel &data, MessageParcel &reply);
63f857971dSopenharmony_ci    int32_t SetDragWindowScreenId(CallingContext &context, MessageParcel &data, MessageParcel &reply);
64f857971dSopenharmony_ci    std::string GetPackageName(Security::AccessToken::AccessTokenID tokenId);
65f857971dSopenharmony_ci    int32_t AddSelectedPixelMap(CallingContext &context, MessageParcel &data, MessageParcel &reply);
66f857971dSopenharmony_ci    int32_t RemoveListener(CallingContext &context, MessageParcel &data);
67f857971dSopenharmony_ci    int32_t AddListener(CallingContext &context, MessageParcel &data);
68f857971dSopenharmony_ci    int32_t SetMouseDragMonitorState(CallingContext &context, MessageParcel &data, MessageParcel &reply);
69f857971dSopenharmony_ci
70f857971dSopenharmony_ci    IContext *env_ { nullptr };
71f857971dSopenharmony_ci};
72f857971dSopenharmony_ci} // namespace DeviceStatus
73f857971dSopenharmony_ci} // namespace Msdp
74f857971dSopenharmony_ci} // namespace OHOS
75f857971dSopenharmony_ci#endif // DRAG_SERVER_H