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} qtVersion - The Qt version used in Interface that is currently running. <em>Read-only.</em>
34  * @property {string} qtWebEngineVersion - The Qt WebEngine version used in Interface that is currently running. <em>Read-only.</em>
35  * @property {string} qtChromiumVersion - The Qt Chromium version used in Interface that is currently running. <em>Read-only.</em>
36  *
37  *
38  * @example <caption>Report information on the version of Interface currently running.</caption>
39  * print("Interface platform: " + About.platform);
40  * print("Interface build date: " + About.buildDate);
41  * print("Interface version: " + About.buildVersion);
42  * print("Qt version: " + About.qtVersion);
43  */
44 
45  /*@jsdoc
46  * The <code>HifiAbout</code> API provides information about the version of Interface that is currently running. It also
47  * has the functionality to open a web page in an Interface browser window.
48  *
49  * @namespace HifiAbout
50  *
51  * @hifi-interface
52  * @hifi-client-entity
53  * @hifi-avatar
54  *
55  * @deprecated This API is deprecated and will be removed. Use the {@link About} API instead.
56  *
57  * @property {string} platform - The name of the Interface platform running, e,g., <code>"Overte"</code> for the Overte.
58  * <em>Read-only.</em>
59  * @property {string} buildDate - The build date of Interface that is currently running. <em>Read-only.</em>
60  * @property {string} buildVersion - The build version of Interface that is currently running. <em>Read-only.</em>
61  * @property {string} qtVersion - The Qt version used in Interface that is currently running. <em>Read-only.</em>
62  *
63  * @borrows About.openUrl as openUrl
64  */
65 
66 class AboutUtil : public QObject {
67  Q_OBJECT
68 
69  Q_PROPERTY(QString platform READ getPlatformName CONSTANT)
70  Q_PROPERTY(QString buildDate READ getBuildDate CONSTANT)
71  Q_PROPERTY(QString buildVersion READ getBuildVersion CONSTANT)
72  Q_PROPERTY(QString qtVersion READ getQtVersion CONSTANT)
73  Q_PROPERTY(QString qtWebEngineVersion READ getQtWebEngineVersion CONSTANT)
74  Q_PROPERTY(QString qtChromiumVersion READ getQtChromiumVersion CONSTANT)
75 
76 public:
77  static AboutUtil* getInstance();
78  ~AboutUtil() {}
79 
80  QString getPlatformName() const { return "Overte"; }
81  QString getBuildDate() const;
82  QString getBuildVersion() const;
83  QString getQtVersion() const;
84  QString getQtWebEngineVersion() const;
85  QString getQtChromiumVersion() const;
86 
87 public slots:
88 
89  /*@jsdoc
90  * Display a web page in an Interface browser window or the tablet.
91  * @function About.openUrl
92  * @param {string} url - The URL of the web page you want to view in Interface.
93  */
94  void openUrl(const QString &url) const;
95 private:
96  AboutUtil(QObject* parent = nullptr);
97 };
98 
99 #endif // hifi_AboutUtil_h