/*
* Copyright 2015 Canonical Ltd.
*
* This file is part of address-book-service.
*
* sync-monitor is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* contact-service-app is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#pragma once
#include
#include
#include "ab-update.h"
#include "dbus-service-defs.h"
#include "config.h"
class ABUpdateAdaptor : public QDBusAbstractAdaptor
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", CPIM_UPDATE_OBJECT_IFACE_NAME)
Q_CLASSINFO("D-Bus Introspection", ""
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
" \n"
"")
Q_PROPERTY(bool needsUpdate READ needsUpdate NOTIFY onNeedsUpdateChanged)
Q_PROPERTY(bool isRunning READ isRunning NOTIFY onIsRunningChanged)
public:
ABUpdateAdaptor(ABUpdate *parent = 0);
~ABUpdateAdaptor();
bool needsUpdate() const;
bool isRunning() const;
public Q_SLOTS:
void startUpdate();
void cancelUpdate();
Q_SIGNALS:
void onNeedsUpdateChanged();
void onIsRunningChanged();
void updateDone();
void updateError(const QString &errorMessage);
private:
ABUpdate *m_abUpdate;
bool m_needsUpdate;
bool m_isRunning;
};