DtkCore
DTK Core module
dsysinfo.h
1/*
2 * Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd.
3 *
4 * Author: zccrs <[email protected]>
5 *
6 * Maintainer: zccrs <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21#ifndef DSYSINFO_H
22#define DSYSINFO_H
23
24#include <dtkcore_global.h>
25
26#include <QLocale>
27
28DCORE_BEGIN_NAMESPACE
29
30class DSysInfoPrivate;
31class LIBDTKCORESHARED_EXPORT DSysInfo
32{
33public:
34 enum ProductType {
35 UnknownType = 0,
36 Deepin,
37 ArchLinux,
38 CentOS,
39 Debian,
40 Fedora,
41 LinuxMint,
42 Manjaro,
43 openSUSE,
44 SailfishOS,
45 Ubuntu,
46 Uos
47 };
48
49 enum DeepinType {
50 UnknownDeepin = 0,
51 DeepinDesktop,
52 DeepinProfessional,
53 DeepinServer,
54 DeepinPersonal
55 };
56
57 enum LogoType {
58 Normal = 0,
59 Light,
60 Symbolic,
61 Transparent
62 };
63
64 enum OrgType {
67 Manufacturer
68 };
69
70 enum UosType {
71 UosTypeUnknown,
72 UosDesktop,
73 UosServer,
74 UosDevice,
75
76 UosTypeCount // must at last
77 };
78
79 enum UosEdition {
80 UosEditionUnknown,
81 UosProfessional,
82 UosHome,
83 UosCommunity,
84 UosMilitary,
85 UosEnterprise,
86 UosEnterpriseC,
87 UosEuler,
88 UosMilitaryS, // for Server
89 UosDeviceEdition,
90 UosEducation,
91
92 UosEditionCount // must at last
93 };
94
95 // 注意:此处架构是从OsBuild获取的系统版本的Arch信息,并不是指硬件的Arch信息
96 enum UosArch {
97 UosArchUnknown,
98 UosAMD64 = 1 << 0,
99 UosARM64 = 1 << 1,
100 UosMIPS64 = 1 << 2,
101 UosSW64 = 1 << 3
102 };
103
104#ifdef Q_OS_LINUX
105 static bool isDeepin();
106 static bool isDDE();
107 static DeepinType deepinType();
108 static QString deepinTypeDisplayName(const QLocale &locale = QLocale::system());
109 static QString deepinVersion();
110 static QString deepinEdition();
111 static QString deepinCopyright();
112
113 // uos version interface
114 static UosType uosType();
115 static UosEdition uosEditionType();
116 static UosArch uosArch();
117 static QString uosProductTypeName(const QLocale &locale = QLocale::system());
118 static QString uosSystemName(const QLocale &locale = QLocale::system());
119 static QString uosEditionName(const QLocale &locale = QLocale::system());
120
121 static QString spVersion(); // SP1...SP99
122 static QString udpateVersion(); // update1...update9
123 static QString majorVersion();
124 static QString minorVersion();
125 static QString buildVersion(); // xyzs
126#endif
127
128 Q_DECL_DEPRECATED_X("Use distributionInfoPath() instead") static QString deepinDistributionInfoPath();
129 static QString distributionInfoPath();
130 static QString distributionInfoSectionName(OrgType type);
131
132 static QString distributionOrgName(OrgType type = Distribution, const QLocale &locale = QLocale::system());
133 Q_DECL_DEPRECATED_X("Use deepinDistributionOrgName() instead") static QString deepinDistributorName();
134 static QPair<QString, QString> distributionOrgWebsite(OrgType type = Distribution);
135 Q_DECL_DEPRECATED_X("Use deepinDistributionOrgWebsite() instead") static QPair<QString, QString> deepinDistributorWebsite();
136 static QString distributionOrgLogo(OrgType orgType = Distribution, LogoType type = Normal, const QString & fallback = QString());
137 Q_DECL_DEPRECATED_X("Use deepinDistributionOrgLogo() instead") static QString deepinDistributorLogo(LogoType type = Normal, const QString & fallback = QString());
138
139 static QString operatingSystemName();
140 static ProductType productType();
141 static QString productTypeString();
142 static QString productVersion();
143 static bool isCommunityEdition();
144
145 static QString computerName();
146 static QString cpuModelName();
147 static qint64 memoryInstalledSize();
148 static qint64 memoryTotalSize();
149 static qint64 systemDiskSize();
150};
151
152DCORE_END_NAMESPACE
153
154#endif // DSYSINFO_H
Definition: dsysinfo.h:32
OrgType
Definition: dsysinfo.h:64
@ Distribution
distribution itself
Definition: dsysinfo.h:65
@ Distributor
distributer of the current distribution
Definition: dsysinfo.h:66