File indexing completed on 2024-12-22 04:13:05

0001 /*
0002  *  SPDX-FileCopyrightText: 2019 Anna Medonosova <anna.medonosova@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 
0008 #ifndef KISUPDATERBASE_H
0009 #define KISUPDATERBASE_H
0010 
0011 #include <QObject>
0012 #include <KisUpdaterStatus.h>
0013 
0014 class QString;
0015 
0016 class KisUpdaterBase : public QObject
0017 {
0018     Q_OBJECT
0019 
0020 public:
0021     KisUpdaterBase();
0022 
0023     /**
0024      * @brief start the process checking whether there is an update available or not
0025      * When the check is done, the updater emits sigUpdateCheckStateChange with the check result
0026      */
0027     virtual void checkForUpdate() = 0;
0028 
0029     /**
0030      * @brief Returns true if this updater can actually perform an update.
0031      * If it can only check for new versions, return false.
0032      * @return bool
0033      */
0034     virtual bool hasUpdateCapability() = 0;
0035 
0036     /**
0037      * @brief if the updater has update capability, start the update process
0038      * When the update is done, the updater emits sigUpdateCheckStateChange with the check result
0039      */
0040     virtual void doUpdate() = 0;
0041 
0042 Q_SIGNALS:
0043     void sigUpdateCheckStateChange(KisUpdaterStatus);
0044 
0045 protected:
0046     KisUpdaterStatus m_updaterStatus;
0047 };
0048 
0049 #endif // KISUPDATERBASE_H