[55401] | 1 | /* $Id: UIVersion.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
[25177] | 2 | /** @file
|
---|
[75571] | 3 | * VBox Qt GUI - UIVersion class declaration.
|
---|
[25177] | 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
[25177] | 8 | *
|
---|
[96407] | 9 | * This file is part of VirtualBox base platform packages, as
|
---|
| 10 | * available from https://www.virtualbox.org.
|
---|
| 11 | *
|
---|
| 12 | * This program is free software; you can redistribute it and/or
|
---|
| 13 | * modify it under the terms of the GNU General Public License
|
---|
| 14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
| 15 | * License.
|
---|
| 16 | *
|
---|
| 17 | * This program is distributed in the hope that it will be useful, but
|
---|
| 18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 20 | * General Public License for more details.
|
---|
| 21 | *
|
---|
| 22 | * You should have received a copy of the GNU General Public License
|
---|
| 23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
| 24 | *
|
---|
| 25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
[25177] | 26 | */
|
---|
| 27 |
|
---|
[76581] | 28 | #ifndef FEQT_INCLUDED_SRC_globals_UIVersion_h
|
---|
| 29 | #define FEQT_INCLUDED_SRC_globals_UIVersion_h
|
---|
[76532] | 30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 31 | # pragma once
|
---|
| 32 | #endif
|
---|
[25177] | 33 |
|
---|
[75563] | 34 | /* Qt includes: */
|
---|
| 35 | #include <QString>
|
---|
| 36 |
|
---|
[70826] | 37 | /** Represents VirtualBox version wrapper. */
|
---|
[70824] | 38 | class UIVersion
|
---|
[38476] | 39 | {
|
---|
| 40 | public:
|
---|
| 41 |
|
---|
[70826] | 42 | /** Constructs default object. */
|
---|
[75571] | 43 | UIVersion();
|
---|
[75563] | 44 | /** Constructs object based on parsed @a strFullVersionInfo. */
|
---|
[75571] | 45 | UIVersion(const QString &strFullVersionInfo);
|
---|
[38476] | 46 |
|
---|
[70826] | 47 | /** Returns whether this object is valid. */
|
---|
[75571] | 48 | bool isValid() const;
|
---|
[39473] | 49 |
|
---|
[70826] | 50 | /** Returns whether this object is equal to @a other. */
|
---|
[75571] | 51 | bool equal(const UIVersion &other) const;
|
---|
[70826] | 52 | /** Checks whether this object is equal to @a other. */
|
---|
[70824] | 53 | bool operator==(const UIVersion &other) const { return equal(other); }
|
---|
[70826] | 54 | /** Checks whether this object is NOT equal to @a other. */
|
---|
[70824] | 55 | bool operator!=(const UIVersion &other) const { return !equal(other); }
|
---|
[38476] | 56 |
|
---|
[75571] | 57 | /** Checks whether this object is less than @a other. */
|
---|
| 58 | bool operator<(const UIVersion &other) const;
|
---|
| 59 | /** Checks whether this object is less or equal than @a other. */
|
---|
| 60 | bool operator<=(const UIVersion &other) const;
|
---|
| 61 | /** Checks whether this object is greater than @a other. */
|
---|
| 62 | bool operator>(const UIVersion &other) const;
|
---|
| 63 | /** Checks whether this object is greater or equal than @a other. */
|
---|
| 64 | bool operator>=(const UIVersion &other) const;
|
---|
[38476] | 65 |
|
---|
[70826] | 66 | /** Returns object string representation. */
|
---|
[75571] | 67 | QString toString() const;
|
---|
[38476] | 68 |
|
---|
[70826] | 69 | /** Returns the object X value. */
|
---|
[38476] | 70 | int x() const { return m_x; }
|
---|
[70826] | 71 | /** Returns the object Y value. */
|
---|
[38476] | 72 | int y() const { return m_y; }
|
---|
[70826] | 73 | /** Returns the object Z value. */
|
---|
[38476] | 74 | int z() const { return m_z; }
|
---|
[75563] | 75 | /** Returns the object postfix. */
|
---|
| 76 | QString postfix() const { return m_strPostfix; }
|
---|
[38476] | 77 |
|
---|
[75563] | 78 | /** Defines the object @a x value. */
|
---|
[70830] | 79 | void setX(int x) { m_x = x; }
|
---|
[75563] | 80 | /** Defines the object @a y value. */
|
---|
[70830] | 81 | void setY(int y) { m_y = y; }
|
---|
[75563] | 82 | /** Defines the object @a z value. */
|
---|
[70830] | 83 | void setZ(int z) { m_z = z; }
|
---|
[75563] | 84 | /** Defines the object @a strPostfix. */
|
---|
| 85 | void setPostfix(const QString &strPostfix) { m_strPostfix = strPostfix; }
|
---|
[70830] | 86 |
|
---|
| 87 | /** Returns effective released version guessed or hardcoded for this one version.
|
---|
| 88 | * This can be even the version itself. */
|
---|
[75571] | 89 | UIVersion effectiveReleasedVersion() const;
|
---|
[70830] | 90 |
|
---|
[38476] | 91 | private:
|
---|
| 92 |
|
---|
[70826] | 93 | /** Holds the object X value. */
|
---|
[75563] | 94 | int m_x;
|
---|
[70826] | 95 | /** Holds the object Y value. */
|
---|
[75563] | 96 | int m_y;
|
---|
[70826] | 97 | /** Holds the object Z value. */
|
---|
[75563] | 98 | int m_z;
|
---|
| 99 |
|
---|
| 100 | /** Holds the object postfix. */
|
---|
| 101 | QString m_strPostfix;
|
---|
[38476] | 102 | };
|
---|
| 103 |
|
---|
[76581] | 104 | #endif /* !FEQT_INCLUDED_SRC_globals_UIVersion_h */
|
---|