1 /* 2 * Copyright (c) 2023 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 FOUNDATION_DM_DISPLAY_LITE_H 17 #define FOUNDATION_DM_DISPLAY_LITE_H 18 19 #include <string> 20 #include "dm_common.h" 21 #include "noncopyable.h" 22 23 namespace OHOS::Rosen { 24 class DisplayInfo; 25 class CutoutInfo; 26 27 class DisplayLite : public RefBase { 28 friend class DisplayManagerLite; 29 public: 30 ~DisplayLite(); 31 DisplayLite(const DisplayLite&) = delete; 32 DisplayLite(DisplayLite&&) = delete; 33 DisplayLite& operator=(const DisplayLite&) = delete; 34 DisplayLite& operator=(DisplayLite&&) = delete; 35 36 /** 37 * @brief Get id of the display. 38 * 39 * @return Display id. 40 */ 41 DisplayId GetId() const; 42 43 /** 44 * @brief Get info of the display. 45 * 46 * @return Info of the display. 47 */ 48 sptr<DisplayInfo> GetDisplayInfo() const; 49 50 /** 51 * @brief Get width of the display. 52 * 53 * @return Width of the display. 54 */ 55 int32_t GetWidth() const; 56 57 /** 58 * @brief Get height of the display. 59 * 60 * @return Height of the display. 61 */ 62 int32_t GetHeight() const; 63 64 /** 65 * @brief Get cutout info of the display. 66 * 67 * @return Cutout info of the display. 68 */ 69 sptr<CutoutInfo> GetCutoutInfo() const; 70 71 /** 72 * @brief Get the rotation of the display. 73 * 74 * @return Rotation of the display.. 75 */ 76 Rotation GetRotation() const; 77 protected: 78 // No more methods or variables can be defined here. 79 DisplayLite(const std::string& name, sptr<DisplayInfo> info); 80 private: 81 // No more methods or variables can be defined here. 82 void UpdateDisplayInfo(sptr<DisplayInfo>) const; 83 void UpdateDisplayInfo() const; 84 class Impl; 85 sptr<Impl> pImpl_; 86 }; 87 } // namespace OHOS::Rosen 88 89 #endif // FOUNDATION_DM_DISPLAY_LITE_H