-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebInfos.h
104 lines (76 loc) · 2.85 KB
/
WebInfos.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#pragma once
#include <QString>
#include <QStringList>
#include "TargetVersion.h"
#include "WebContents.h"
/**
* @brief Get plugin infos from the web.
* @details This class gets version and download infos from the plugin delivery php scripts.
* @author Andeas Schrell
*/
class WebInfos : public QObject {
Q_OBJECT
public:
/** Creates an instance for the given plugin under the SDK version
* @param identifier plugin identifier
* @param sdkVersion the version of the ASP sdk (currently 8)
*/
WebInfos(QString identifier, QString sdkVersion, QString installedVersion);
/** Fetch the infos from the web database. */
void fetch();
/** Fetch the infos from the web database. */
void fetchAll();
/** Check for newer version
* @returns true if there is a newer version than this one available.
*/
bool isWebNewer();
/** Name of the plugin
* @returns the name of the plugin
*/
QString name();
/** Identifier of the plugin
* @returns the identifier of the plugin
*/
QString identifier();
/** Version string of the installed plugin
* @returns the installed version number of the plugin
*/
QString installedVersion();
/** Version string of the plugin download
* @returns the web version number of the plugin
*/
QString webVersion();
/** Link of the plugin
* @returns a link to the new version download
*/
QString link();
/** SDK version info
* @returns the SDK version
*/
QString sdk_version();
/** Formats the version string for compares */
static QString formatVersion(QString versionString);
public slots:
/** This slot is called when the infos are available
* @param str the resulting string we can parse
*/
void infosArrived(QString str);
/** This slot is called when the infos from fetchAll() are available
* @param str the resulting string we can parse
*/
void allInfosArrived(QString str);
signals:
/** This signal is emitted when the values are available. */
void ready();
/** This signal is emitted when the values are available. */
void readyAll(QList<WebInfos*>&);
private:
WebContents* m_wc; /**< our web contents */
QString m_identifier; /**< holds the plugin identifier */
QString m_installedVersion; /** the installed version */
QString m_sdk_version; /**< this is the SDK version */
protected:
QString m_name; /**< holds the plugin name */
QString m_webVersion; /**< holds the plugin version */
QString m_link; /**< holds the link to the plugin download */
};