Libksysguard

Unit.h
1 /*
2  Copyright (C) 2019 Vlad Zahorodnii <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #pragma once
21 
22 // Qt
23 #include <QMetaType>
24 
25 #include "formatter_export.h"
26 
27 namespace KSysGuard
28 {
29 FORMATTER_EXPORT Q_NAMESPACE
30 
31 /**
32  * This enum type is used to specify metric prefixes.
33  */
34 enum MetricPrefix {
35  MetricPrefixAutoAdjust = -1,
36  MetricPrefixUnity = 0,
37  MetricPrefixKilo,
38  MetricPrefixMega,
39  MetricPrefixGiga,
40  MetricPrefixTera,
41  MetricPrefixPeta,
42  MetricPrefixLast = MetricPrefixPeta
43 };
44 Q_ENUM_NS(MetricPrefix)
45 
46 /**
47  * This enum types is used to specify units.
48  */
49 enum Unit {
50  UnitInvalid = -1,
51  UnitNone = 0,
52 
53  // Byte size units.
54  UnitByte = 100,
55  UnitKiloByte = MetricPrefixKilo + UnitByte,
56  UnitMegaByte = MetricPrefixMega + UnitByte,
57  UnitGigaByte = MetricPrefixGiga + UnitByte,
58  UnitTeraByte = MetricPrefixTera + UnitByte,
59  UnitPetaByte = MetricPrefixPeta + UnitByte,
60 
61  // Data rate units.
62  UnitByteRate = 200,
63  UnitKiloByteRate = MetricPrefixKilo + UnitByteRate,
64  UnitMegaByteRate = MetricPrefixMega + UnitByteRate,
65  UnitGigaByteRate = MetricPrefixGiga + UnitByteRate,
66  UnitTeraByteRate = MetricPrefixTera + UnitByteRate,
67  UnitPetaByteRate = MetricPrefixPeta + UnitByteRate,
68 
69  // Frequency.
70  UnitHertz = 300,
71  UnitKiloHertz = MetricPrefixKilo + UnitHertz,
72  UnitMegaHertz = MetricPrefixMega + UnitHertz,
73  UnitGigaHertz = MetricPrefixGiga + UnitHertz,
74  UnitTeraHertz = MetricPrefixTera + UnitHertz,
75  UnitPetaHertz = MetricPrefixPeta + UnitHertz,
76 
77  // Time units.
78  UnitBootTimestamp = 400, // deprecated
79  UnitSecond,
80  UnitTime,
81 
82  // Misc units.
83  UnitCelsius = 500,
84  UnitDecibelMilliWatts,
85  UnitPercent,
86  UnitRate,
87  UnitRpm,
88  UnitVolt,
89  UnitWatt,
90  UnitWattHour
91 };
92 Q_ENUM_NS(Unit)
93 
94 } // namespace KSysGuard
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Mar 2 2021 02:46:14 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.