HarmattanSyncApplications
NotesStorage.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 * Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * version 2.1 as published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24#ifndef NOTESSTORAGE_H
25#define NOTESSTORAGE_H
26
27#include "NotesBackend.h"
28
29#include <buteosyncfw5/StoragePlugin.h>
30#include <buteosyncfw5/StoragePluginLoader.h>
31#include <buteosyncfw5/ProfileEngineDefs.h>
32
37class NotesStorage : public Buteo::StoragePlugin
38{
39
40public:
41
46 NotesStorage( const QString& aPluginName );
47
51 virtual ~NotesStorage();
52
56 virtual bool init( const QMap<QString, QString>& aProperties );
57
61 virtual bool uninit();
62
66 virtual bool getAllItems( QList<Buteo::StorageItem*>& aItems );
67
71 virtual bool getAllItemIds( QList<QString>& aItemIds );
72
76 virtual bool getNewItems( QList<Buteo::StorageItem*>& aNewItems, const QDateTime& aTime );
77
81 virtual bool getNewItemIds( QList<QString>& aNewItemIds, const QDateTime& aTime );
82
86 virtual bool getModifiedItems( QList<Buteo::StorageItem*>& aModifiedItems, const QDateTime& aTime );
87
91 virtual bool getModifiedItemIds( QList<QString>& aModifiedItemIds, const QDateTime& aTime );
92
96 virtual bool getDeletedItemIds( QList<QString>& aDeletedItemIds, const QDateTime& aTime );
97
101 virtual Buteo::StorageItem* newItem();
102
106 virtual Buteo::StorageItem* getItem( const QString& aItemId );
107
111 virtual QList<Buteo::StorageItem*> getItems( const QStringList& aItemIdList );
112
116 virtual OperationStatus addItem( Buteo::StorageItem& aItem );
117
121 virtual QList<OperationStatus> addItems( const QList<Buteo::StorageItem*>& aItems );
122
126 virtual OperationStatus modifyItem( Buteo::StorageItem& aItem );
127
131 virtual QList<OperationStatus> modifyItems( const QList<Buteo::StorageItem*>& aItems );
132
136 virtual OperationStatus deleteItem( const QString& aItemId );
137
141 virtual QList<OperationStatus> deleteItems( const QList<QString>& aItemIds );
142
143protected:
144
145private:
146
147 QDateTime normalizeTime( const QDateTime& aTime ) const;
148
149 QByteArray getCTCaps( const QString& aFilename ) const;
150
151 NotesBackend iBackend;
152
153 bool iCommitNow;
154};
155
156class NotesStoragePluginLoader : public Buteo::StoragePluginLoader
157{
158 Q_OBJECT
159 Q_PLUGIN_METADATA(IID "com.buteo.plugins.storage.NotesStoragePluginLoader")
160 Q_INTERFACES(Buteo::StoragePluginLoader)
161
162public:
168 Buteo::StoragePlugin* createPlugin(const QString& aPluginName) override;
169};
170
171#endif // NOTESSTORAGE_H
Notes Calendar backend proxy.
Definition NotesBackend.h:40
Definition NotesStorage.h:157
Buteo::StoragePlugin * createPlugin(const QString &aPluginName) override
Creates notes storage plugin.
Harmattan notes storage plugin.
Definition NotesStorage.h:38
virtual bool getDeletedItemIds(QList< QString > &aDeletedItemIds, const QDateTime &aTime)
virtual bool getModifiedItemIds(QList< QString > &aModifiedItemIds, const QDateTime &aTime)
virtual bool init(const QMap< QString, QString > &aProperties)
virtual bool getAllItems(QList< Buteo::StorageItem * > &aItems)
virtual OperationStatus addItem(Buteo::StorageItem &aItem)
virtual QList< Buteo::StorageItem * > getItems(const QStringList &aItemIdList)
virtual bool uninit()
virtual QList< OperationStatus > deleteItems(const QList< QString > &aItemIds)
virtual bool getAllItemIds(QList< QString > &aItemIds)
virtual Buteo::StorageItem * newItem()
virtual OperationStatus deleteItem(const QString &aItemId)
virtual bool getModifiedItems(QList< Buteo::StorageItem * > &aModifiedItems, const QDateTime &aTime)
virtual bool getNewItemIds(QList< QString > &aNewItemIds, const QDateTime &aTime)
virtual QList< OperationStatus > modifyItems(const QList< Buteo::StorageItem * > &aItems)
virtual Buteo::StorageItem * getItem(const QString &aItemId)
NotesStorage(const QString &aPluginName)
Constructor.
virtual QList< OperationStatus > addItems(const QList< Buteo::StorageItem * > &aItems)
virtual bool getNewItems(QList< Buteo::StorageItem * > &aNewItems, const QDateTime &aTime)
virtual OperationStatus modifyItem(Buteo::StorageItem &aItem)
virtual ~NotesStorage()
Destructor.