1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
|
/*
* This file is part of buteo-sync-plugins package
*
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
* Copyright (C) 2013 - 2021 Jolla Ltd.
*
* Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef NOTESSTORAGE_H
#define NOTESSTORAGE_H
#include "NotesBackend.h"
#include <buteosyncfw5/StoragePlugin.h>
#include <buteosyncfw5/StoragePluginLoader.h>
#include <buteosyncfw5/ProfileEngineDefs.h>
/*! \brief Harmattan notes storage plugin
*
*
*/
class NotesStorage : public Buteo::StoragePlugin
{
public:
/*! \brief Constructor
*
* @param aPluginName aPluginName Name of the plugin
*/
NotesStorage( const QString& aPluginName );
/*! \brief Destructor
*
*/
virtual ~NotesStorage();
/*! \see StoragePlugin::init()
*
*/
virtual bool init( const QMap<QString, QString>& aProperties );
/*! \see StoragePlugin::uninit()
*
*/
virtual bool uninit();
/*! \see StoragePlugin::getAllItems()
*
*/
virtual bool getAllItems( QList<Buteo::StorageItem*>& aItems );
/*! \see StoragePlugin::getAllItemIds()
*
*/
virtual bool getAllItemIds( QList<QString>& aItemIds );
/*! \see StoragePlugin::getNewItems()
*
*/
virtual bool getNewItems( QList<Buteo::StorageItem*>& aNewItems, const QDateTime& aTime );
/*! \see StoragePlugin::getNewItemIds()
*
*/
virtual bool getNewItemIds( QList<QString>& aNewItemIds, const QDateTime& aTime );
/*! \see StoragePlugin::getModifiedItems()
*
*/
virtual bool getModifiedItems( QList<Buteo::StorageItem*>& aModifiedItems, const QDateTime& aTime );
/*! \see StoragePlugin::getModifiedItemIds()
*
*/
virtual bool getModifiedItemIds( QList<QString>& aModifiedItemIds, const QDateTime& aTime );
/*! \see StoragePlugin::getDeletedItemIds()
*
*/
virtual bool getDeletedItemIds( QList<QString>& aDeletedItemIds, const QDateTime& aTime );
/*! \see StoragePlugin::newItem()
*
*/
virtual Buteo::StorageItem* newItem();
/*! \see StoragePlugin::getItem()
*
*/
virtual Buteo::StorageItem* getItem( const QString& aItemId );
/*! \see StoragePlugin::getItems()
*
*/
virtual QList<Buteo::StorageItem*> getItems( const QStringList& aItemIdList );
/*! \see StoragePlugin::addItem()
*
*/
virtual OperationStatus addItem( Buteo::StorageItem& aItem );
/*! \see StoragePlugin::addItems()
*
*/
virtual QList<OperationStatus> addItems( const QList<Buteo::StorageItem*>& aItems );
/*! \see StoragePlugin::modifyItem()
*
*/
virtual OperationStatus modifyItem( Buteo::StorageItem& aItem );
/*! \see StoragePlugin::modifyItems()
*
*/
virtual QList<OperationStatus> modifyItems( const QList<Buteo::StorageItem*>& aItems );
/*! \see StoragePlugin::deleteItem()
*
*/
virtual OperationStatus deleteItem( const QString& aItemId );
/*! \see StoragePlugin::deleteItems()
*
*/
virtual QList<OperationStatus> deleteItems( const QList<QString>& aItemIds );
protected:
private:
QDateTime normalizeTime( const QDateTime& aTime ) const;
QByteArray getCTCaps( const QString& aFilename ) const;
NotesBackend iBackend;
bool iCommitNow;
};
class NotesStoragePluginLoader : public Buteo::StoragePluginLoader
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "com.buteo.plugins.storage.NotesStoragePluginLoader")
Q_INTERFACES(Buteo::StoragePluginLoader)
public:
/*! \brief Creates notes storage plugin
*
* @param aPluginName Human-readable name for plugin
* @return Notes storage plugin instance
*/
Buteo::StoragePlugin* createPlugin(const QString& aPluginName) override;
};
#endif // NOTESSTORAGE_H
|