1 /* 2 * Copyright (c) 2021-2022 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_H 17 #define FOUNDATION_DM_DISPLAY_H 18 19 #include <string> 20 #include "dm_common.h" 21 #include "noncopyable.h" 22 23 namespace OHOS::Rosen { 24 class DisplayInfo; 25 26 typedef enum DisplayType { 27 DEFAULT = 0, 28 } DisplayType; 29 30 class Display : public RefBase { 31 friend class DisplayManager; 32 public: 33 ~Display(); 34 Display(const Display&) = delete; 35 Display(Display&&) = delete; 36 Display& operator=(const Display&) = delete; 37 Display& operator=(Display&&) = delete; 38 DisplayId GetId() const; 39 std::string GetName() const; 40 int32_t GetWidth() const; 41 int32_t GetHeight() const; 42 uint32_t GetFreshRate() const; 43 uint32_t GetRefreshRate() const; 44 ScreenId GetScreenId() const; 45 float GetVirtualPixelRatio() const; 46 Rotation GetRotation() const; 47 Orientation GetOrientation() const; 48 DisplayState GetDisplayState() const; 49 50 protected: 51 // No more methods or variables can be defined here. 52 Display(const std::string& name, sptr<DisplayInfo> info); 53 private: 54 // No more methods or variables can be defined here. 55 void UpdateDisplayInfo(sptr<DisplayInfo>) const; 56 void UpdateDisplayInfo() const; 57 class Impl; 58 sptr<Impl> pImpl_; 59 }; 60 } // namespace OHOS::Rosen 61 62 #endif // FOUNDATION_DM_DISPLAY_H