1 /* 2 * Copyright (c) 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 OHOS_ACELITE_BASE_SYSTEM_INFO_H 17 #define OHOS_ACELITE_BASE_SYSTEM_INFO_H 18 19 #include "acelite_config.h" 20 #include "memory_heap.h" 21 #include "non_copyable.h" 22 23 namespace OHOS { 24 namespace ACELite { 25 class SystemInfo final : public MemoryHeap { 26 public: 27 ACE_DISALLOW_COPY_AND_MOVE(SystemInfo); 28 static SystemInfo &GetInstance(); 29 void Initialize(); 30 31 /** 32 * @brief get the value of width/height 33 * @return the width/height value 34 */ 35 float GetAspectRatio() const; 36 37 /** 38 * @brief get the device type, support liteWearable and smartVision now 39 * @return the device type 40 */ 41 const char *GetDeviceType() const; 42 43 /** 44 * @brief charge the device is round screen or not 45 * @return the device is round scrren or not 46 */ 47 bool IsRoundScreen() const; 48 49 uint16_t GetScreenHeight() const; 50 51 uint16_t GetScreenWidth() const; 52 53 private: SystemInfo()54 SystemInfo() : screenWidth_(0), screenHeight_(0), aspectRatio_(0.0), deviceType_(nullptr), isRoundScreen_(false) {} ~SystemInfo()55 ~SystemInfo() {} 56 static const uint8_t DEVICE_TYPE_STR_LEN = 32; 57 uint16_t screenWidth_; 58 uint16_t screenHeight_; 59 float aspectRatio_; 60 const char *deviceType_; 61 bool isRoundScreen_; 62 }; 63 } // namespace ACELite 64 } // namespace OHOS 65 #endif // OHOS_ACELITE_BASE_SYSTEM_INFO_H 66