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_IWINDOW_H 1762b8cbc9Sopenharmony_ci#define GRAPHIC_LITE_IWINDOW_H 1862b8cbc9Sopenharmony_ci 1962b8cbc9Sopenharmony_ci#include "isurface.h" 2062b8cbc9Sopenharmony_ci#include "lite_wm_type.h" 2162b8cbc9Sopenharmony_ci#include "gfx_utils/geometry2d.h" 2262b8cbc9Sopenharmony_ci 2362b8cbc9Sopenharmony_cinamespace OHOS { 2462b8cbc9Sopenharmony_ci/** 2562b8cbc9Sopenharmony_ci * @brief The IWindow class is an abstract definition of window. Each IWindow has a ISurface. 2662b8cbc9Sopenharmony_ci */ 2762b8cbc9Sopenharmony_ciclass IWindow { 2862b8cbc9Sopenharmony_cipublic: 2962b8cbc9Sopenharmony_ci IWindow() {} 3062b8cbc9Sopenharmony_ci 3162b8cbc9Sopenharmony_ci virtual ~IWindow() {} 3262b8cbc9Sopenharmony_ci 3362b8cbc9Sopenharmony_ci /** 3462b8cbc9Sopenharmony_ci * @brief Do some initialization after creating the window. 3562b8cbc9Sopenharmony_ci * @return The result of initialize. 3662b8cbc9Sopenharmony_ci */ 3762b8cbc9Sopenharmony_ci virtual int Init() = 0; 3862b8cbc9Sopenharmony_ci 3962b8cbc9Sopenharmony_ci /** 4062b8cbc9Sopenharmony_ci * @brief Destroy the window. 4162b8cbc9Sopenharmony_ci */ 4262b8cbc9Sopenharmony_ci virtual void Destroy() = 0; 4362b8cbc9Sopenharmony_ci 4462b8cbc9Sopenharmony_ci /** 4562b8cbc9Sopenharmony_ci * @brief Show the window. 4662b8cbc9Sopenharmony_ci */ 4762b8cbc9Sopenharmony_ci virtual void Show() = 0; 4862b8cbc9Sopenharmony_ci 4962b8cbc9Sopenharmony_ci /** 5062b8cbc9Sopenharmony_ci * @brief Hide the window. 5162b8cbc9Sopenharmony_ci */ 5262b8cbc9Sopenharmony_ci virtual void Hide() = 0; 5362b8cbc9Sopenharmony_ci 5462b8cbc9Sopenharmony_ci /** 5562b8cbc9Sopenharmony_ci * @brief Resize the window. 5662b8cbc9Sopenharmony_ci */ 5762b8cbc9Sopenharmony_ci virtual void Resize(int16_t width, int16_t height) = 0; 5862b8cbc9Sopenharmony_ci 5962b8cbc9Sopenharmony_ci /** 6062b8cbc9Sopenharmony_ci * @brief Move the window to the specified coordinates. 6162b8cbc9Sopenharmony_ci */ 6262b8cbc9Sopenharmony_ci virtual void MoveTo(int16_t x, int16_t y) = 0; 6362b8cbc9Sopenharmony_ci 6462b8cbc9Sopenharmony_ci /** 6562b8cbc9Sopenharmony_ci * @brief Put the window on the top of the window stack. 6662b8cbc9Sopenharmony_ci */ 6762b8cbc9Sopenharmony_ci virtual void RaiseToTop() = 0; 6862b8cbc9Sopenharmony_ci 6962b8cbc9Sopenharmony_ci /** 7062b8cbc9Sopenharmony_ci * @brief Send a window to the bottom of the window stack. 7162b8cbc9Sopenharmony_ci */ 7262b8cbc9Sopenharmony_ci virtual void LowerToBottom() = 0; 7362b8cbc9Sopenharmony_ci 7462b8cbc9Sopenharmony_ci /** 7562b8cbc9Sopenharmony_ci * @brief Get surface of the window. 7662b8cbc9Sopenharmony_ci * @return Pointer of surface 7762b8cbc9Sopenharmony_ci */ 7862b8cbc9Sopenharmony_ci virtual ISurface* GetSurface() = 0; 7962b8cbc9Sopenharmony_ci 8062b8cbc9Sopenharmony_ci /** 8162b8cbc9Sopenharmony_ci * @brief Get identification of the window. 8262b8cbc9Sopenharmony_ci * @return Identification of the window 8362b8cbc9Sopenharmony_ci */ 8462b8cbc9Sopenharmony_ci virtual int32_t GetWindowId() = 0; 8562b8cbc9Sopenharmony_ci 8662b8cbc9Sopenharmony_ci /** 8762b8cbc9Sopenharmony_ci * @brief Update window. 8862b8cbc9Sopenharmony_ci */ 8962b8cbc9Sopenharmony_ci virtual void Update() = 0; 9062b8cbc9Sopenharmony_ci}; 9162b8cbc9Sopenharmony_ci} 9262b8cbc9Sopenharmony_ci#endif // GRAPHIC_LITE_IWINDOW_H 9362b8cbc9Sopenharmony_ci 94