ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
QSimpleUpdater.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <QUrl>
11 #include <QList>
12 #include <QObject>
13 
14 #if defined(QSU_SHARED)
15 # define QSU_DECL Q_DECL_EXPORT
16 #elif defined(QSU_IMPORT)
17 # define QSU_DECL Q_DECL_IMPORT
18 #else
19 # define QSU_DECL
20 #endif
21 
22 class Updater;
23 
43 class QSU_DECL QSimpleUpdater : public QObject
44 {
45  Q_OBJECT
46 
47 signals:
48  void checkingFinished(const QString &url);
49  void appcastDownloaded(const QString &url, const QByteArray &data);
50  void downloadFinished(const QString &url, const QString &filepath);
51 
52 public:
53  static QSimpleUpdater *getInstance();
54 
55  bool usesCustomAppcast(const QString &url) const;
56  bool getNotifyOnUpdate(const QString &url) const;
57  bool getNotifyOnFinish(const QString &url) const;
58  bool getUpdateAvailable(const QString &url) const;
59  bool getDownloaderEnabled(const QString &url) const;
60  bool usesCustomInstallProcedures(const QString &url) const;
61 
62  QString getOpenUrl(const QString &url) const;
63  QString getChangelog(const QString &url) const;
64  QString getModuleName(const QString &url) const;
65  QString getDownloadUrl(const QString &url) const;
66  QString getPlatformKey(const QString &url) const;
67  QString getLatestVersion(const QString &url) const;
68  QString getModuleVersion(const QString &url) const;
69  QString getUserAgentString(const QString &url) const;
70 
71 public slots:
72  void checkForUpdates(const QString &url);
73  void setModuleName(const QString &url, const QString &name);
74  void setNotifyOnUpdate(const QString &url, const bool notify);
75  void setNotifyOnFinish(const QString &url, const bool notify);
76  void setPlatformKey(const QString &url, const QString &platform);
77  void setModuleVersion(const QString &url, const QString &version);
78  void setDownloaderEnabled(const QString &url, const bool enabled);
79  void setUserAgentString(const QString &url, const QString &agent);
80  void setUseCustomAppcast(const QString &url, const bool customAppcast);
81  void setUseCustomInstallProcedures(const QString &url, const bool custom);
82  void setMandatoryUpdate(const QString &url, const bool mandatory_update);
83 
84 protected:
85  ~QSimpleUpdater();
86 
87 private:
88  Updater *getUpdater(const QString &url) const;
89 };
std::string version
std::string name
#define slots
#define signals
#define QSU_DECL
Manages the updater instances.
void appcastDownloaded(const QString &url, const QByteArray &data)
void checkingFinished(const QString &url)
void downloadFinished(const QString &url, const QString &filepath)
Downloads and interprests the update definition file.
Definition: Updater.h:23