Overte C++ Documentation
AboutUtil.h
1 //
2 // AboutUtil.h
3 // interface/src
4 //
5 // Created by Vlad Stelmahovsky on 15/5/2018.
6 // Copyright 2018 High Fidelity, Inc.
7 // Copyright 2020 Vircadia Contributors.
8 //
9 // Distributed under the Apache License, Version 2.0.
10 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
11 //
12 
13 
14 #ifndef hifi_AboutUtil_h
15 #define hifi_AboutUtil_h
16 
17 #include <QObject>
18 
19 /*@jsdoc
20  * The <code>About</code> API provides information about the version of Interface that is currently running. It also has the
21  * functionality to open a web page in an Interface browser window.
22  *
23  * @namespace About
24  *
25  * @hifi-interface
26  * @hifi-client-entity
27  * @hifi-avatar
28  *
29  * @property {string} platform - The name of the Interface platform running, e,g., <code>"Overte"</code> for the Overte.
30  * <em>Read-only.</em>
31  * @property {string} buildDate - The build date of Interface that is currently running. <em>Read-only.</em>
32  * @property {string} buildVersion - The build version of Interface that is currently running. <em>Read-only.</em>
33  * @property {string} releaseName - The release codename of the version that Interface is currently running. <em>Read-only.</em>
34  * @property {string} qtVersion - The Qt version used in Interface that is currently running. <em>Read-only.</em>
35  * @property {string} qtWebEngineVersion - The Qt WebEngine version used in Interface that is currently running. <em>Read-only.</em>
36  * @property {string} qtChromiumVersion - The Qt Chromium version used in Interface that is currently running. <em>Read-only.</em>
37  *
38  *
39  * @example <caption>Report information on the version of Interface currently running.</caption>
40  * print("Interface platform: " + About.platform);
41  * print("Interface build date: " + About.buildDate);
42  * print("Interface version: " + About.buildVersion);
43  * print("Interface release name: " + About.releaseName);
44  * print("Qt version: " + About.qtVersion);
45  */
46 
47  /*@jsdoc
48  * The <code>HifiAbout</code> API provides information about the version of Interface that is currently running. It also
49  * has the functionality to open a web page in an Interface browser window.
50  *
51  * @namespace HifiAbout
52  *
53  * @hifi-interface
54  * @hifi-client-entity
55  * @hifi-avatar
56  *
57  * @deprecated This API is deprecated and will be removed. Use the {@link About} API instead.
58  *
59  * @property {string} platform - The name of the Interface platform running, e,g., <code>"Overte"</code> for the Overte.
60  * <em>Read-only.</em>
61  * @property {string} buildDate - The build date of Interface that is currently running. <em>Read-only.</em>
62  * @property {string} buildVersion - The build version of Interface that is currently running. <em>Read-only.</em>
63  * @property {string} qtVersion - The Qt version used in Interface that is currently running. <em>Read-only.</em>
64  *
65  * @borrows About.openUrl as openUrl
66  */
67 
68 class AboutUtil : public QObject {
69  Q_OBJECT
70 
71  Q_PROPERTY(QString platform READ getPlatformName CONSTANT)
72  Q_PROPERTY(QString buildDate READ getBuildDate CONSTANT)
73  Q_PROPERTY(QString buildVersion READ getBuildVersion CONSTANT)
74  Q_PROPERTY(QString releaseName READ getReleaseName CONSTANT)
75  Q_PROPERTY(QString qtVersion READ getQtVersion CONSTANT)
76  Q_PROPERTY(QString qtWebEngineVersion READ getQtWebEngineVersion CONSTANT)
77  Q_PROPERTY(QString qtChromiumVersion READ getQtChromiumVersion CONSTANT)
78 
79 public:
80  static AboutUtil* getInstance();
81  ~AboutUtil() {}
82 
83  QString getPlatformName() const { return "Overte"; }
84  QString getBuildDate() const;
85  QString getBuildVersion() const;
86  QString getReleaseName() const;
87  QString getQtVersion() const;
88  QString getQtWebEngineVersion() const;
89  QString getQtChromiumVersion() const;
90 
91 public slots:
92 
93  /*@jsdoc
94  * Display a web page in an Interface browser window or the tablet.
95  * @function About.openUrl
96  * @param {string} url - The URL of the web page you want to view in Interface.
97  */
98  void openUrl(const QString &url) const;
99 private:
100  AboutUtil(QObject* parent = nullptr);
101  QString _dateConverted;
102 };
103 
104 #endif // hifi_AboutUtil_h