~renatofilho/address-book-service/remove-updater

« back to all changes in this revision

Viewing changes to updater/ab-update-module.h

  • Committer: Renato Araujo Oliveira Filho
  • Date: 2015-10-07 13:31:56 UTC
  • Revision ID: renato.filho@canonical.com-20151007133156-kkhk8g865a6uyj04
Remove updater app.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2015 Canonical Ltd.
3
 
 *
4
 
 * This file is part of address-book-service.
5
 
 *
6
 
 * sync-monitor is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; version 3.
9
 
 *
10
 
 * contact-service-app is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 
 */
18
 
 
19
 
#pragma once
20
 
#include <QtCore/QObject>
21
 
 
22
 
class ABUpdateModule : public QObject
23
 
{
24
 
    Q_OBJECT
25
 
    Q_ENUMS(ImportError)
26
 
 
27
 
public:
28
 
    enum ImportError {
29
 
        ApplicationAreadyUpdated = 0,
30
 
        ConnectionError,
31
 
        FailToConnectWithButeo,
32
 
        FailToCreateButeoProfiles,
33
 
        FailToAuthenticate,
34
 
        InernalError,
35
 
        OnlineAccountNotFound,
36
 
        SyncAlreadyRunning,
37
 
        SyncError
38
 
    };
39
 
 
40
 
    ABUpdateModule(QObject *parent = 0);
41
 
    ~ABUpdateModule() override;
42
 
 
43
 
    virtual QString name() const = 0;
44
 
    virtual bool needsUpdate() = 0;
45
 
    virtual bool prepareToUpdate() = 0;
46
 
    virtual bool update() = 0;
47
 
    virtual bool canUpdate() = 0;
48
 
    virtual bool requireInternetConnection() = 0;
49
 
    virtual bool commit() = 0;
50
 
    virtual bool rollback() = 0;
51
 
    virtual ImportError lastError() const = 0;
52
 
 
53
 
Q_SIGNALS:
54
 
    void updated();
55
 
    void updateError(const QString &accountName,  ABUpdateModule::ImportError errorCode);
56
 
};