1/*
2 * Copyright (c) 2020-2021 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 GRAPHIC_LITE_LITE_WMS_H
17#define GRAPHIC_LITE_LITE_WMS_H
18
19#include "gfx_utils/geometry2d.h"
20#include "lite_wm_type.h"
21#include "ipc_skeleton.h"
22
23namespace OHOS {
24class LiteWMS {
25public:
26    struct DeathCallbackArg {
27        pid_t pid;
28        SvcIdentity sid;
29    };
30
31    static LiteWMS* GetInstance();
32
33    static void WMSRequestHandle(int funcId, void* origin, IpcIo* req, IpcIo* reply);
34
35private:
36    LiteWMS(){};
37    ~LiteWMS() {}
38    static int32_t SurfaceRequestHandler(uint32_t code, IpcIo *data, IpcIo *reply, MessageOption option);
39    static void DeathCallback(void* arg);
40
41    static void GetSurface(IpcIo* req, IpcIo* reply);
42    static void Show(IpcIo* req, IpcIo* reply);
43    static void Hide(IpcIo* req, IpcIo* reply);
44    static void RaiseToTop(IpcIo* req, IpcIo* reply);
45    static void LowerToBottom(IpcIo* req, IpcIo* reply);
46    static void MoveTo(IpcIo* req, IpcIo* reply);
47    static void Resize(IpcIo* req, IpcIo* reply);
48    static void Update(IpcIo* req, IpcIo* reply);
49    static void CreateWindow(IpcIo* req, IpcIo* reply);
50    static void RemoveWindow(IpcIo* req, IpcIo* reply);
51    static void GetEventData(IpcIo* req, IpcIo* reply);
52    static void Screenshot(IpcIo* req, IpcIo* reply);
53    static void ClientRegister(IpcIo* req, IpcIo* reply);
54    static void GetLayerInfo(IpcIo* req, IpcIo* reply);
55};
56} // namespace OHOS
57#endif
58