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