summaryrefslogtreecommitdiffstats
blob: 48b75e51fb8c333af14d6899a5ecbd6f02bbd200 (plain)
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
/*
 * Copyright (c) 2010-2017 Isode Limited.
 * All rights reserved.
 * See the COPYING file for more information.
 */

#pragma once

#include <memory>
#include <string>

#include <SwifTools/AutoUpdater/AutoUpdater.h>

namespace Swift {
    /**
     * @brief The SparkleAutoUpdater class provides integration with Sparkle.
     * This enables automatic silent background updates. If using this in Qt you
     * need to emit a NSApplicationWillTerminateNotification before you quit
     * the application.
     */
    class SparkleAutoUpdater : public AutoUpdater {
        public:
            SparkleAutoUpdater(const std::string& appcastFeed);
            ~SparkleAutoUpdater();

            void setAppcastFeed(const std::string& appcastFeed);
            void checkForUpdates();
            State getCurrentState();

        private:
            void setCurrentState(State updatedState);

        private:
            class Private;
            const std::unique_ptr<Private> d;
    };
}