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_RES_COMMON_H 17 #define OHOS_RES_COMMON_H 18 19 #include <stdint.h> 20 21 #ifdef __EXPORT_MGR__ 22 #define EXPORT_FUNC __declspec(dllexport) 23 #else 24 #define EXPORT_FUNC 25 #endif 26 27 namespace OHOS { 28 namespace Global { 29 namespace Resource { 30 // DIRECTION 31 static const char *VERTICAL = "vertical"; 32 static const char *HORIZONTAL = "horizontal"; 33 34 // DEVICETYPE 35 static const char *PHONE_STR = "phone"; 36 static const char *TABLET_STR = "tablet"; 37 static const char *CAR_STR = "car"; 38 static const char *PAD_STR = "pad"; 39 static const char *TV_STR = "tv"; 40 static const char *WEARABLE_STR = "wearable"; 41 static const char *TWOINONE_STR = "2in1"; 42 43 // ColorMode 44 static const char *DARK_STR = "dark"; 45 static const char *LIGHT_STR = "light"; 46 47 // InputDevice 48 static const char *POINTING_DEVICE_STR = "pointingdevice"; 49 50 // ScreenDensity 51 static const char *RE_120_STR = "sdpi"; 52 static const char *RE_160_STR = "mdpi"; 53 static const char *RE_240_STR = "ldpi"; 54 static const char *RE_320_STR = "xldpi"; 55 static const char *RE_480_STR = "xxldpi"; 56 static const char *RE_640_STR = "xxxldpi"; 57 58 static const uint32_t MCC_UNDEFINED = 0; 59 static const uint32_t MNC_UNDEFINED = 0; 60 61 // the type of qualifiers 62 typedef enum KeyType { 63 LANGUAGES = 0, 64 REGION = 1, 65 SCREEN_DENSITY = 2, 66 DIRECTION = 3, 67 DEVICETYPE = 4, 68 SCRIPT = 5, 69 COLORMODE = 6, // DARK = 0, LIGHT = 1 70 MCC = 7, 71 MNC = 8, 72 // RESERVER 9 73 INPUTDEVICE = 10, 74 KEY_TYPE_MAX, 75 } KeyType; 76 77 // the type of resources 78 typedef enum ResType { 79 VALUES = 0, 80 ANIMATION = 1, 81 DRAWABLE = 2, 82 LAYOUT = 3, 83 MENU = 4, 84 MIPMAP = 5, 85 RAW = 6, 86 XML = 7, 87 88 INTEGER = 8, 89 STRING = 9, 90 STRINGARRAY = 10, 91 INTARRAY = 11, 92 BOOLEAN = 12, 93 DIMEN = 13, 94 COLOR = 14, 95 ID = 15, 96 THEME = 16, 97 PLURALS = 17, 98 FLOAT = 18, 99 MEDIA = 19, 100 PROF = 20, 101 SVG = 21, 102 PATTERN = 22, 103 SYMBOL = 23, 104 MAX_RES_TYPE = 24, 105 } ResType; 106 107 enum DeviceType { 108 DEVICE_NOT_SET = -1, 109 DEVICE_PHONE = 0, 110 DEVICE_TABLET = 1, 111 DEVICE_CAR = 2, 112 DEVICE_PAD = 3, 113 DEVICE_TV = 4, 114 DEVICE_WEARABLE = 6, 115 DEVICE_TWOINONE = 7, 116 }; 117 118 enum TimeFormat { 119 HOUR_NOT_SET = -1, 120 HOUR_12 = 0, 121 HOUR_24 = 1, 122 }; 123 124 enum ColorMode { 125 COLOR_MODE_NOT_SET = -1, 126 DARK = 0, 127 LIGHT = 1, 128 }; 129 130 enum InputDevice { 131 INPUTDEVICE_NOT_SET = -1, 132 INPUTDEVICE_POINTINGDEVICE = 0, 133 }; 134 135 enum ScreenDensity { 136 SCREEN_DENSITY_NOT_SET = 0, 137 SCREEN_DENSITY_SDPI = 120, 138 SCREEN_DENSITY_MDPI = 160, 139 SCREEN_DENSITY_LDPI = 240, 140 SCREEN_DENSITY_XLDPI = 320, 141 SCREEN_DENSITY_XXLDPI = 480, 142 SCREEN_DENSITY_XXXLDPI = 640, 143 }; 144 145 enum Direction { 146 DIRECTION_NOT_SET = -1, 147 DIRECTION_VERTICAL = 0, 148 DIRECTION_HORIZONTAL = 1 149 }; 150 } // namespace Resource 151 } // namespace Global 152 } // namespace OHOS 153 #endif // OHOS_RES_COMMON_H