• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 
17 #ifndef DEVICE_TYPE_DEFINITION_H
18 #define DEVICE_TYPE_DEFINITION_H
19 
20 #include <unordered_map>
21 
22 namespace OHOS {
23 namespace MMI {
24 enum class DeviceType {
25     DEVICE_UNKNOWN = 0,
26     DEVICE_PC = 1,
27     DEVICE_SOFT_PC_PRO = 2,
28     DEVICE_HARD_PC_PRO = 3,
29     DEVICE_TABLET = 4,
30     DEVICE_FOLD_PC = 5,
31     DEVICE_M_PC = 6,
32     DEVICE_FOLD_PC_VIRT = 7,
33     DEVICE_M_TABLET = 8,
34     DEVICE_Q_TABLET = 9,
35 };
36 
37 static const std::unordered_map<std::string, DeviceType> gDeviceTypeMap {
38     { "DEVICE_UNKNOWN", DeviceType::DEVICE_UNKNOWN },
39     { "DEVICE_PC", DeviceType::DEVICE_PC },
40     { "DEVICE_SOFT_PC_PRO", DeviceType::DEVICE_SOFT_PC_PRO },
41     { "DEVICE_HARD_PC_PRO", DeviceType::DEVICE_HARD_PC_PRO },
42     { "DEVICE_TABLET", DeviceType::DEVICE_TABLET },
43     { "DEVICE_FOLD_PC", DeviceType::DEVICE_FOLD_PC },
44     { "DEVICE_M_PC", DeviceType::DEVICE_M_PC },
45     { "DEVICE_FOLD_PC_VIRT", DeviceType::DEVICE_FOLD_PC_VIRT },
46     { "DEVICE_M_TABLET", DeviceType::DEVICE_M_TABLET },
47     { "DEVICE_Q_TABLET", DeviceType::DEVICE_Q_TABLET }
48 };
49 
50 } // namespace MMI
51 } // namespace OHOS
52 #endif // DEVICE_TYPE_DEFINITION_H