166f3657fSopenharmony_ci/*
266f3657fSopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
366f3657fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
466f3657fSopenharmony_ci * you may not use this file except in compliance with the License.
566f3657fSopenharmony_ci * You may obtain a copy of the License at
666f3657fSopenharmony_ci *
766f3657fSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
866f3657fSopenharmony_ci *
966f3657fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1066f3657fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1166f3657fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1266f3657fSopenharmony_ci * See the License for the specific language governing permissions and
1366f3657fSopenharmony_ci * limitations under the License.
1466f3657fSopenharmony_ci */
1566f3657fSopenharmony_ci
1666f3657fSopenharmony_ci#ifndef OHOS_DSCREEN_MAP_RELATION_H
1766f3657fSopenharmony_ci#define OHOS_DSCREEN_MAP_RELATION_H
1866f3657fSopenharmony_ci
1966f3657fSopenharmony_ci#include "nlohmann/json.hpp"
2066f3657fSopenharmony_ci
2166f3657fSopenharmony_ciusing json = nlohmann::json;
2266f3657fSopenharmony_ci
2366f3657fSopenharmony_cinamespace OHOS {
2466f3657fSopenharmony_cinamespace DistributedHardware {
2566f3657fSopenharmony_cistruct ScreenRect {
2666f3657fSopenharmony_ci    int32_t startX;
2766f3657fSopenharmony_ci    int32_t startY;
2866f3657fSopenharmony_ci    uint32_t width;
2966f3657fSopenharmony_ci    uint32_t height;
3066f3657fSopenharmony_ci};
3166f3657fSopenharmony_cistruct DisplayRect {
3266f3657fSopenharmony_ci    int32_t startX;
3366f3657fSopenharmony_ci    int32_t startY;
3466f3657fSopenharmony_ci    int32_t width;
3566f3657fSopenharmony_ci    int32_t height;
3666f3657fSopenharmony_ci};
3766f3657fSopenharmony_ci
3866f3657fSopenharmony_ciclass DScreenMapRelation {
3966f3657fSopenharmony_cipublic:
4066f3657fSopenharmony_ci    void SetDisplayId(uint64_t displayId);
4166f3657fSopenharmony_ci    uint64_t GetDisplayId() const;
4266f3657fSopenharmony_ci    void SetScreenId(uint64_t screenId);
4366f3657fSopenharmony_ci    uint64_t GetScreenId() const;
4466f3657fSopenharmony_ci    void SetDisplayRect(const DisplayRect &displayRect);
4566f3657fSopenharmony_ci    DisplayRect& GetDisplayRect();
4666f3657fSopenharmony_ci    void SetScreenRect(const ScreenRect &screenRect);
4766f3657fSopenharmony_ci    ScreenRect& GetScreenRect();
4866f3657fSopenharmony_ciprivate:
4966f3657fSopenharmony_ci    friend void to_json(json &j, const DScreenMapRelation &dScreenMapRelation);
5066f3657fSopenharmony_ci    friend void from_json(const json &j, DScreenMapRelation &dScreenMapRelation);
5166f3657fSopenharmony_ci
5266f3657fSopenharmony_ci    uint64_t displayId_;
5366f3657fSopenharmony_ci    uint64_t screenId_;
5466f3657fSopenharmony_ci    DisplayRect displayRect_;
5566f3657fSopenharmony_ci    ScreenRect screenRect_;
5666f3657fSopenharmony_ci};
5766f3657fSopenharmony_civoid to_json(const json &j, const DScreenMapRelation &dScreenMapRelation);
5866f3657fSopenharmony_civoid from_json(const json &j, DScreenMapRelation &dScreenMapRelation);
5966f3657fSopenharmony_civoid to_json(json &j, const DisplayRect &rect);
6066f3657fSopenharmony_civoid to_json(json &j, const ScreenRect &rect);
6166f3657fSopenharmony_civoid from_json(const json &j, DisplayRect &rect);
6266f3657fSopenharmony_civoid from_json(const json &j, ScreenRect &rect);
6366f3657fSopenharmony_ci} // namespace DistributedHardware
6466f3657fSopenharmony_ci} // namespace OHOS
6566f3657fSopenharmony_ci#endif