1 #ifndef QTAUTOUPDATER_UPDATEINSTALLER_H
2 #define QTAUTOUPDATER_UPDATEINSTALLER_H
4 #include <QtCore/qobject.h>
5 #include <QtCore/quuid.h>
6 #include <QtCore/qabstractitemmodel.h>
8 #include "QtAutoUpdaterCore/qtautoupdatercore_global.h"
9 #include "QtAutoUpdaterCore/updateinfo.h"
15 class UpdateInstallerPrivate;
22 Q_PROPERTY(QtAutoUpdater::UpdateInstaller::Features features READ features CONSTANT)
34 SelectComponents = 0x01,
35 DetailedProgress = 0x02,
38 Q_DECLARE_FLAGS(Features, Feature)
42 virtual Features features()
const = 0;
52 virtual void startInstall();
54 virtual void cancelInstall();
56 virtual void eulaHandled(
const QVariant &
id,
bool accepted) = 0;
59 virtual void restartApplication();
66 void updateGlobalProgress(
double progress,
const QString &status = {});
68 void updateComponentProgress(
const QVariant &
id,
double progress,
const QString &status = {});
70 void showEula(
const QVariant &
id,
const QString &htmlText,
bool required);
72 void installSucceeded(
bool shouldRestart);
74 void installFailed(
const QString &errorMessage);
77 void componentsChanged();
81 explicit UpdateInstaller(
QObject *parent =
nullptr);
83 explicit UpdateInstaller(UpdateInstallerPrivate &dd,
QObject *parent =
nullptr);
86 virtual void startInstallImpl() = 0;
89 virtual void setComponentEnabled(
const QVariant &
id,
bool enabled);
92 Q_DECLARE_PRIVATE(UpdateInstaller)
93 Q_DISABLE_COPY(UpdateInstaller)
94 friend class QtAutoUpdater::ComponentModel;
99 Q_DECLARE_OPERATORS_FOR_FLAGS(QtAutoUpdater::UpdateInstaller::Features)
102 #endif // QTAUTOUPDATER_UPDATEINSTALLER_H