HarmattanSyncApplications
ContactsChangeNotifierPlugin.h
1/*
2 * This file is part of buteo-sync-plugins package
3 *
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5 * Copyright (C) 2013 - 2021 Jolla Ltd.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * version 2.1 as published by the Free Software Foundation.
10 *
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 *
21 */
22#ifndef CONTACTSCHANGENOTIFIERPLUGIN_H
23#define CONTACTSCHANGENOTIFIERPLUGIN_H
24
25#include "StorageChangeNotifierPlugin.h"
26#include "StorageChangeNotifierPluginLoader.h"
27
29
30class ContactsChangeNotifierPlugin : public Buteo::StorageChangeNotifierPlugin
31{
32 Q_OBJECT
33
34public:
38 ContactsChangeNotifierPlugin(const QString& aStorageName);
39
43
46 QString name() const;
47
50 bool hasChanges() const;
51
55
58 void enable();
59
62 void disable(bool disableAfterNextChange = false);
63
64private Q_SLOTS:
67 void onChange();
68
69private:
70 ContactsChangeNotifier* icontactsChangeNotifier;
71 bool ihasChanges;
72 bool iDisableLater;
73};
74
75
76class ContactsChangeNotifierPluginLoader : public Buteo::StorageChangeNotifierPluginLoader
77{
78 Q_OBJECT
79 Q_PLUGIN_METADATA(IID "com.buteo.plugins.storage.ContactsChangeNotifierPluginLoader")
80 Q_INTERFACES(Buteo::StorageChangeNotifierPluginLoader)
81
82public:
83 Buteo::StorageChangeNotifierPlugin* createPlugin(const QString& aStorageName) override;
84};
85
86#endif
Definition ContactsChangeNotifierPlugin.h:77
Definition ContactsChangeNotifierPlugin.h:31
void enable()
see StorageChangeNotifierPlugin::enable
bool hasChanges() const
see StorageChangeNotifierPlugin::hasChanges
ContactsChangeNotifierPlugin(const QString &aStorageName)
constructor see StorageChangeNotifierPlugin
void disable(bool disableAfterNextChange=false)
see StorageChangeNotifierPlugin::disable
~ContactsChangeNotifierPlugin()
destructor
void changesReceived()
see StorageChangeNotifierPlugin::changesReceived
QString name() const
see StorageChangeNotifierPlugin::name
Definition ContactsChangeNotifier.h:14