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_SCREEN_CLIENT_H 1766f3657fSopenharmony_ci#define OHOS_SCREEN_CLIENT_H 1866f3657fSopenharmony_ci 1966f3657fSopenharmony_ci#include <atomic> 2066f3657fSopenharmony_ci#include <cstdint> 2166f3657fSopenharmony_ci#include <list> 2266f3657fSopenharmony_ci#include <map> 2366f3657fSopenharmony_ci#include <memory> 2466f3657fSopenharmony_ci#include <mutex> 2566f3657fSopenharmony_ci#include <string> 2666f3657fSopenharmony_ci 2766f3657fSopenharmony_ci#include "single_instance.h" 2866f3657fSopenharmony_ci#include "surface.h" 2966f3657fSopenharmony_ci 3066f3657fSopenharmony_ci#include "dscreen_constants.h" 3166f3657fSopenharmony_ci#include "screen_client_common.h" 3266f3657fSopenharmony_ci 3366f3657fSopenharmony_cinamespace OHOS { 3466f3657fSopenharmony_cinamespace DistributedHardware { 3566f3657fSopenharmony_ciclass ScreenClient { 3666f3657fSopenharmony_ciDECLARE_SINGLE_INSTANCE_BASE(ScreenClient); 3766f3657fSopenharmony_cipublic: 3866f3657fSopenharmony_ci int32_t AddWindow(std::shared_ptr<WindowProperty> &windowProperty); 3966f3657fSopenharmony_ci sptr<Surface> GetSurface(int32_t windowId); 4066f3657fSopenharmony_ci int32_t ShowWindow(int32_t windowId); 4166f3657fSopenharmony_ci int32_t MoveWindow(int32_t windowId, int32_t startX, int32_t startY); 4266f3657fSopenharmony_ci int32_t RemoveWindow(int32_t windowId); 4366f3657fSopenharmony_ci int32_t HideWindow(int32_t windowId); 4466f3657fSopenharmony_ci int32_t DestroyAllWindow(); 4566f3657fSopenharmony_ciprivate: 4666f3657fSopenharmony_ci ScreenClient() = default; 4766f3657fSopenharmony_ci ~ScreenClient() = default; 4866f3657fSopenharmony_ci std::map<int32_t, sptr<Surface>> surfaceMap_; 4966f3657fSopenharmony_ci std::atomic<int32_t> windowId_ = INVALID_WINDOW_ID; 5066f3657fSopenharmony_ci std::mutex surfaceMapMutex_; 5166f3657fSopenharmony_ci}; 5266f3657fSopenharmony_ci} // namespace DistributedHardware 5366f3657fSopenharmony_ci} // namespace OHOS 5466f3657fSopenharmony_ci#endif