Buteo Synchronization Framework
DeletedItemsIdStorage.h
1/*
2 * This file is part of buteo-syncfw package
3 *
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5 *
6 * Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * version 2.1 as published by the Free Software Foundation.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 *
22 */
23#ifndef DELETEDITEMSIDSTORAGE_H
24#define DELETEDITEMSIDSTORAGE_H
25
26#include <QSqlDatabase>
27#include <QDateTime>
28
29namespace Buteo {
30
35{
36public:
41
46
53 bool init(const QString &aDbFile);
54
59 bool uninit();
60
67 bool getSnapshot(QList<QString> &aItems, QList<QDateTime> &aCreationTimes) const;
68
75 bool setSnapshot(const QList<QString> &aItems, const QList<QDateTime> &aCreationTimes);
76
83 void addDeletedItem(const QString &aItem, const QDateTime &aCreationTime, const QDateTime &aDeleteTime);
84
91 void addDeletedItems(const QList<QString> &aItems, const QList<QDateTime> &aCreationTimes,
92 const QList<QDateTime> &aDeleteTimes);
93
100 bool getDeletedItems(QList<QString> &aItems, const QDateTime &aTime);
101
102protected:
108
114
115private:
116 QSqlDatabase iDb;
117 QString iConnectionName;
118};
119
120}
121
122#endif
bool getSnapshot(QList< QString > &aItems, QList< QDateTime > &aCreationTimes) const
Retrieves persistently stored snapshot of item id's.
Definition DeletedItemsIdStorage.cpp:82
void addDeletedItem(const QString &aItem, const QDateTime &aCreationTime, const QDateTime &aDeleteTime)
Adds a deleted item to backend.
Definition DeletedItemsIdStorage.cpp:159
bool init(const QString &aDbFile)
Initializes backend.
Definition DeletedItemsIdStorage.cpp:43
~DeletedItemsIdStorage()
Destructor.
Definition DeletedItemsIdStorage.cpp:38
bool uninit()
Uninitializes backend.
Definition DeletedItemsIdStorage.cpp:69
bool getDeletedItems(QList< QString > &aItems, const QDateTime &aTime)
Returns the deleted items after given time.
Definition DeletedItemsIdStorage.cpp:227
bool setSnapshot(const QList< QString > &aItems, const QList< QDateTime > &aCreationTimes)
Store a snapshot of item id's persistently.
Definition DeletedItemsIdStorage.cpp:105
bool ensureDeletedItemsExists()
Checks whether item id table exists and creates it if needed.
Definition DeletedItemsIdStorage.cpp:270
DeletedItemsIdStorage()
Contructor.
Definition DeletedItemsIdStorage.cpp:33
void addDeletedItems(const QList< QString > &aItems, const QList< QDateTime > &aCreationTimes, const QList< QDateTime > &aDeleteTimes)
Adds deleted items to backend.
Definition DeletedItemsIdStorage.cpp:183
bool ensureItemSnapshotExists()
Checks whether snapshot table exists and creates it if needed.
Definition DeletedItemsIdStorage.cpp:253
Definition SyncBackupAdaptor.h:40