1 /***************************************************************************
2 * Copyright (C) 2005-07 by The Quassel Team *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #ifndef _SQLITESTORAGE_H_
22 #define _SQLITESTORAGE_H_
29 class SqliteStorage : public Storage {
34 virtual ~SqliteStorage();
40 static bool isAvailable();
41 static QString displayName();
43 // TODO: Add functions for configuring the backlog handling, i.e. defining auto-cleanup settings etc
47 virtual UserId addUser(QString user, QString password);
48 virtual void updateUser(QString user, QString password);
49 virtual UserId validateUser(QString user, QString password);
50 virtual void delUser(QString user);
54 virtual BufferId getBufferId(UserId user, QString network, QString buffer = "");
55 virtual QList<BufferId> requestBuffers(UserId user, QDateTime since = QDateTime());
57 /* Message handling */
59 virtual MsgId logMessage(Message msg);
60 virtual QList<Message> requestMsgs(BufferId buffer, int lastmsgs = -1, int offset = -1);
61 virtual QList<Message> requestMsgs(BufferId buffer, QDateTime since, int offset = -1);
62 virtual QList<Message> requestMsgRange(BufferId buffer, int first, int last);
65 //! This is just for importing the old file-based backlog */
66 /** This slot needs to be implemented in the storage backends.
67 * It should first prepare (delete?) the database, then call initBackLogOld(UserId id).
68 * If the importing was successful, backLogEnabledOld will be true afterwards.
70 void importOldBacklog();
73 void bufferIdUpdated(BufferId);