~ken-vandine/ubuntu-system-settings/no_s_i_d

« back to all changes in this revision

Viewing changes to plugins/system-update/click/tokendownloader_impl.h

merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of system-settings
 
3
 *
 
4
 * Copyright (C) 2016 Canonical Ltd.
 
5
 *
 
6
 * This program is free software: you can redistribute it and/or modify it
 
7
 * under the terms of the GNU General Public License version 3, as published
 
8
 * by the Free Software Foundation.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful, but
 
11
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
12
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
13
 * PURPOSE.  See the GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License along
 
16
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
 */
 
18
 
 
19
#ifndef CLICK_TOKEN_DOWNLOADER_IMPL_H
 
20
#define CLICK_TOKEN_DOWNLOADER_IMPL_H
 
21
 
 
22
#include "click/tokendownloader.h"
 
23
 
 
24
namespace UpdatePlugin
 
25
{
 
26
namespace Click
 
27
{
 
28
class TokenDownloaderImpl : public TokenDownloader
 
29
{
 
30
    Q_OBJECT
 
31
public:
 
32
    explicit TokenDownloaderImpl(ApiClient *client,
 
33
                                 QSharedPointer<Update> update,
 
34
                                 QObject *parent = nullptr);
 
35
    virtual ~TokenDownloaderImpl();
 
36
    virtual void download(const QString &url) override;
 
37
    virtual ApiClient* client() const override;
 
38
public Q_SLOTS:
 
39
    virtual void cancel() override;
 
40
protected Q_SLOTS:
 
41
    void handleSuccess(const QString &token);
 
42
    void handleFailure();
 
43
};
 
44
} // Click
 
45
} // UpdatePlugin
 
46
 
 
47
#endif // CLICK_TOKEN_DOWNLOADER_IMPL_H