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 namespace OHOS { 20 namespace Global { 21 namespace Resource { 22 // DIRECTION 23 static const char *VERTICAL = "vertical"; 24 static const char *HORIZONTAL = "horizontal"; 25 26 // DEVICETYPE 27 static const char *PHONE_STR = "phone"; 28 static const char *TABLET_STR = "tablet"; 29 static const char *CAR_STR = "car"; 30 static const char *PAD_STR = "pad"; 31 static const char *TV_STR = "tv"; 32 static const char *WEARABLE_STR = "wearable"; 33 34 // ScreenDensity 35 static const char *RE_120_STR = "sdpi"; 36 static const char *RE_160_STR = "mdpi"; 37 static const char *RE_240_STR = "ldpi"; 38 static const char *RE_320_STR = "xldpi"; 39 static const char *RE_480_STR = "xxldpi"; 40 static const char *RE_640_STR = "xxxldpi"; 41 42 // the type of qualifiers 43 typedef enum KeyType { 44 LANGUAGES = 0, 45 REGION = 1, 46 SCREEN_DENSITY = 2, 47 DIRECTION = 3, 48 DEVICETYPE = 4, 49 SCRIPT = 5, 50 NIGHTMODE = 6, // DARK = 0, LIGHT = 1 51 UNKNOWN = 7, 52 MCC = 8, 53 MNC = 9, 54 KEY_TYPE_MAX, 55 } KeyType; 56 57 // the type of resources 58 typedef enum ResType { 59 VALUES = 0, 60 ANIMATION = 1, 61 DRAWABLE = 2, 62 LAYOUT = 3, 63 MENU = 4, 64 MIPMAP = 5, 65 RAW = 6, 66 XML = 7, 67 68 INTEGER = 8, 69 STRING = 9, 70 STRINGARRAY = 10, 71 INTARRAY = 11, 72 BOOLEAN = 12, 73 DIMEN = 13, 74 COLOR = 14, 75 ID = 15, 76 THEME = 16, 77 PLURALS = 17, 78 FLOAT = 18, 79 MEDIA = 19, 80 PROF = 20, 81 SVG = 21, 82 PATTERN = 22, 83 MAX_RES_TYPE = 23, 84 } ResType; 85 86 enum DeviceType { 87 DEVICE_NOT_SET = -1, 88 DEVICE_PHONE = 0, 89 DEVICE_TABLET = 1, 90 DEVICE_CAR = 2, 91 DEVICE_PAD = 3, 92 DEVICE_TV = 4, 93 DEVICE_WEARABLE = 6, 94 }; 95 96 enum NightMode { 97 DARK = 0, 98 LIGHT = 1, 99 }; 100 101 enum ScreenDensity { 102 SCREEN_DENSITY_NOT_SET = 0, 103 SCREEN_DENSITY_SDPI = 120, 104 SCREEN_DENSITY_MDPI = 160, 105 SCREEN_DENSITY_LDPI = 240, 106 SCREEN_DENSITY_XLDPI = 320, 107 SCREEN_DENSITY_XXLDPI = 480, 108 SCREEN_DENSITY_XXXLDPI = 640, 109 }; 110 111 enum Direction { 112 DIRECTION_NOT_SET = -1, 113 DIRECTION_VERTICAL = 0, 114 DIRECTION_HORIZONTAL = 1 115 }; 116 } // namespace Resource 117 } // namespace Global 118 } // namespace OHOS 119 #endif // OHOS_RES_COMMON_H