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 42 // ColorMode 43 static const char *DARK_STR = "dark"; 44 static const char *LIGHT_STR = "light"; 45 46 // ScreenDensity 47 static const char *RE_120_STR = "sdpi"; 48 static const char *RE_160_STR = "mdpi"; 49 static const char *RE_240_STR = "ldpi"; 50 static const char *RE_320_STR = "xldpi"; 51 static const char *RE_480_STR = "xxldpi"; 52 static const char *RE_640_STR = "xxxldpi"; 53 54 // the type of qualifiers 55 typedef enum KeyType { 56 LANGUAGES = 0, 57 REGION = 1, 58 SCREEN_DENSITY = 2, 59 DIRECTION = 3, 60 DEVICETYPE = 4, 61 SCRIPT = 5, 62 COLORMODE = 6, // DARK = 0, LIGHT = 1 63 MCC = 7, 64 MNC = 8, 65 KEY_TYPE_MAX, 66 } KeyType; 67 68 // the type of resources 69 typedef enum ResType { 70 VALUES = 0, 71 ANIMATION = 1, 72 DRAWABLE = 2, 73 LAYOUT = 3, 74 MENU = 4, 75 MIPMAP = 5, 76 RAW = 6, 77 XML = 7, 78 79 INTEGER = 8, 80 STRING = 9, 81 STRINGARRAY = 10, 82 INTARRAY = 11, 83 BOOLEAN = 12, 84 DIMEN = 13, 85 COLOR = 14, 86 ID = 15, 87 THEME = 16, 88 PLURALS = 17, 89 FLOAT = 18, 90 MEDIA = 19, 91 PROF = 20, 92 SVG = 21, 93 PATTERN = 22, 94 MAX_RES_TYPE = 23, 95 } ResType; 96 97 enum DeviceType { 98 DEVICE_NOT_SET = -1, 99 DEVICE_PHONE = 0, 100 DEVICE_TABLET = 1, 101 DEVICE_CAR = 2, 102 DEVICE_PAD = 3, 103 DEVICE_TV = 4, 104 DEVICE_WEARABLE = 6, 105 }; 106 107 enum ColorMode { 108 COLOR_MODE_NOT_SET = -1, 109 DARK = 0, 110 LIGHT = 1, 111 }; 112 113 enum ScreenDensity { 114 SCREEN_DENSITY_NOT_SET = 0, 115 SCREEN_DENSITY_SDPI = 120, 116 SCREEN_DENSITY_MDPI = 160, 117 SCREEN_DENSITY_LDPI = 240, 118 SCREEN_DENSITY_XLDPI = 320, 119 SCREEN_DENSITY_XXLDPI = 480, 120 SCREEN_DENSITY_XXXLDPI = 640, 121 }; 122 123 enum Direction { 124 DIRECTION_NOT_SET = -1, 125 DIRECTION_VERTICAL = 0, 126 DIRECTION_HORIZONTAL = 1 127 }; 128 } // namespace Resource 129 } // namespace Global 130 } // namespace OHOS 131 #endif // OHOS_RES_COMMON_H