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_IWINDOW_H 17 #define GRAPHIC_LITE_IWINDOW_H 18 19 #include "isurface.h" 20 #include "lite_wm_type.h" 21 #include "gfx_utils/geometry2d.h" 22 23 namespace OHOS { 24 /** 25 * @brief The IWindow class is an abstract definition of window. Each IWindow has a ISurface. 26 */ 27 class IWindow { 28 public: IWindow()29 IWindow() {} 30 ~IWindow()31 virtual ~IWindow() {} 32 33 /** 34 * @brief Do some initialization after creating the window. 35 * @return The result of initialize. 36 */ 37 virtual int Init() = 0; 38 39 /** 40 * @brief Destroy the window. 41 */ 42 virtual void Destroy() = 0; 43 44 /** 45 * @brief Show the window. 46 */ 47 virtual void Show() = 0; 48 49 /** 50 * @brief Hide the window. 51 */ 52 virtual void Hide() = 0; 53 54 /** 55 * @brief Resize the window. 56 */ 57 virtual void Resize(int16_t width, int16_t height) = 0; 58 59 /** 60 * @brief Move the window to the specified coordinates. 61 */ 62 virtual void MoveTo(int16_t x, int16_t y) = 0; 63 64 /** 65 * @brief Put the window on the top of the window stack. 66 */ 67 virtual void RaiseToTop() = 0; 68 69 /** 70 * @brief Send a window to the bottom of the window stack. 71 */ 72 virtual void LowerToBottom() = 0; 73 74 /** 75 * @brief Get surface of the window. 76 * @return Pointer of surface 77 */ 78 virtual ISurface* GetSurface() = 0; 79 80 /** 81 * @brief Get identification of the window. 82 * @return Identification of the window 83 */ 84 virtual int32_t GetWindowId() = 0; 85 86 /** 87 * @brief Update window. 88 */ 89 virtual void Update() = 0; 90 }; 91 } 92 #endif // GRAPHIC_LITE_IWINDOW_H 93 94