VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVersion.h@ 102493

Last change on this file since 102493 was 98103, checked in by vboxsync, 21 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1/* $Id: UIVersion.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIVersion class declaration.
4 */
5
6/*
7 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
8 *
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
26 */
27
28#ifndef FEQT_INCLUDED_SRC_globals_UIVersion_h
29#define FEQT_INCLUDED_SRC_globals_UIVersion_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QString>
36
37/** Represents VirtualBox version wrapper. */
38class UIVersion
39{
40public:
41
42 /** Constructs default object. */
43 UIVersion();
44 /** Constructs object based on parsed @a strFullVersionInfo. */
45 UIVersion(const QString &strFullVersionInfo);
46
47 /** Returns whether this object is valid. */
48 bool isValid() const;
49
50 /** Returns whether this object is equal to @a other. */
51 bool equal(const UIVersion &other) const;
52 /** Checks whether this object is equal to @a other. */
53 bool operator==(const UIVersion &other) const { return equal(other); }
54 /** Checks whether this object is NOT equal to @a other. */
55 bool operator!=(const UIVersion &other) const { return !equal(other); }
56
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;
65
66 /** Returns object string representation. */
67 QString toString() const;
68
69 /** Returns the object X value. */
70 int x() const { return m_x; }
71 /** Returns the object Y value. */
72 int y() const { return m_y; }
73 /** Returns the object Z value. */
74 int z() const { return m_z; }
75 /** Returns the object postfix. */
76 QString postfix() const { return m_strPostfix; }
77
78 /** Defines the object @a x value. */
79 void setX(int x) { m_x = x; }
80 /** Defines the object @a y value. */
81 void setY(int y) { m_y = y; }
82 /** Defines the object @a z value. */
83 void setZ(int z) { m_z = z; }
84 /** Defines the object @a strPostfix. */
85 void setPostfix(const QString &strPostfix) { m_strPostfix = strPostfix; }
86
87 /** Returns effective released version guessed or hardcoded for this one version.
88 * This can be even the version itself. */
89 UIVersion effectiveReleasedVersion() const;
90
91private:
92
93 /** Holds the object X value. */
94 int m_x;
95 /** Holds the object Y value. */
96 int m_y;
97 /** Holds the object Z value. */
98 int m_z;
99
100 /** Holds the object postfix. */
101 QString m_strPostfix;
102};
103
104#endif /* !FEQT_INCLUDED_SRC_globals_UIVersion_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette