162b8cbc9Sopenharmony_ci/* 262b8cbc9Sopenharmony_ci * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 362b8cbc9Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 462b8cbc9Sopenharmony_ci * you may not use this file except in compliance with the License. 562b8cbc9Sopenharmony_ci * You may obtain a copy of the License at 662b8cbc9Sopenharmony_ci * 762b8cbc9Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 862b8cbc9Sopenharmony_ci * 962b8cbc9Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1062b8cbc9Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1162b8cbc9Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1262b8cbc9Sopenharmony_ci * See the License for the specific language governing permissions and 1362b8cbc9Sopenharmony_ci * limitations under the License. 1462b8cbc9Sopenharmony_ci */ 1562b8cbc9Sopenharmony_ci 1662b8cbc9Sopenharmony_ci#ifndef GRAPHIC_LITE_IWINDOWS_MANAGER_H 1762b8cbc9Sopenharmony_ci#define GRAPHIC_LITE_IWINDOWS_MANAGER_H 1862b8cbc9Sopenharmony_ci 1962b8cbc9Sopenharmony_ci#include "iwindow.h" 2062b8cbc9Sopenharmony_ci#include "gfx_utils/geometry2d.h" 2162b8cbc9Sopenharmony_ci#include "gfx_utils/input_event_info.h" 2262b8cbc9Sopenharmony_ci#include "gfx_utils/list.h" 2362b8cbc9Sopenharmony_ci 2462b8cbc9Sopenharmony_cinamespace OHOS { 2562b8cbc9Sopenharmony_ci/** 2662b8cbc9Sopenharmony_ci * @brief The IWindowsManager class is an abstract definition of windows manager. 2762b8cbc9Sopenharmony_ci * Provides a series of client/interfaces for window management, event processing, etc. 2862b8cbc9Sopenharmony_ci */ 2962b8cbc9Sopenharmony_ciclass IWindowsManager { 3062b8cbc9Sopenharmony_cipublic: 3162b8cbc9Sopenharmony_ci class ScreenshotListener { 3262b8cbc9Sopenharmony_ci public: 3362b8cbc9Sopenharmony_ci virtual void OnScreenshotEnd(uint8_t* virAddr, uint32_t width, uint32_t height, 3462b8cbc9Sopenharmony_ci ImagePixelFormat format, uint32_t stride) = 0; 3562b8cbc9Sopenharmony_ci }; 3662b8cbc9Sopenharmony_ci 3762b8cbc9Sopenharmony_ci IWindowsManager() {} 3862b8cbc9Sopenharmony_ci 3962b8cbc9Sopenharmony_ci virtual ~IWindowsManager() {} 4062b8cbc9Sopenharmony_ci 4162b8cbc9Sopenharmony_ci /** 4262b8cbc9Sopenharmony_ci * @brief Get the IWindowsManager's singleton. 4362b8cbc9Sopenharmony_ci * @return IWindowsManager's singleton 4462b8cbc9Sopenharmony_ci */ 4562b8cbc9Sopenharmony_ci static IWindowsManager* GetInstance(); 4662b8cbc9Sopenharmony_ci 4762b8cbc9Sopenharmony_ci /** 4862b8cbc9Sopenharmony_ci * @brief Do some initialization after creating the windows manager object. 4962b8cbc9Sopenharmony_ci * @return The result of initialize. 5062b8cbc9Sopenharmony_ci */ 5162b8cbc9Sopenharmony_ci virtual int Init() = 0; 5262b8cbc9Sopenharmony_ci 5362b8cbc9Sopenharmony_ci virtual IWindow* CreateWindow(const LiteWinConfig& config) = 0; 5462b8cbc9Sopenharmony_ci 5562b8cbc9Sopenharmony_ci virtual void RemoveWindow(IWindow* win) = 0; 5662b8cbc9Sopenharmony_ci 5762b8cbc9Sopenharmony_ci virtual void GetEventData(DeviceData* data) = 0; 5862b8cbc9Sopenharmony_ci 5962b8cbc9Sopenharmony_ci virtual void Screenshot() = 0; 6062b8cbc9Sopenharmony_ci 6162b8cbc9Sopenharmony_ci virtual void SetScreenshotListener(ScreenshotListener* listener) = 0; 6262b8cbc9Sopenharmony_ci}; 6362b8cbc9Sopenharmony_ci} 6462b8cbc9Sopenharmony_ci#endif // GRAPHIC_LITE_IWINDOWS_MANAGER_H 65