akregator/src

storage.h

00001 /*
00002     This file is part of Akregator.
00003 
00004     Copyright (C) 2005 Stanislav Karchebny <Stanislav.Karchebny@kdemail.net>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 
00025 #ifndef AKREGATOR_BACKEND_STORAGE_H
00026 #define AKREGATOR_BACKEND_STORAGE_H
00027 
00028 #include <qobject.h>
00029 
00030 class QString;
00031 class QStringList;
00032 
00033 namespace Akregator {
00034 namespace Backend {
00035 
00036 class FeedStorage;
00037 
00042 class Storage : public QObject
00043 {
00044     public:
00045 
00046         static Storage* getInstance();
00047         static void setInstance(Storage* instance);
00048 
00049         virtual ~Storage() {}
00050 
00053         virtual void initialize(const QStringList& params) = 0;
00054         
00059         virtual bool open(bool autoCommit = false) = 0;
00060 
00065         virtual bool commit() = 0;
00066 
00071         virtual bool rollback() = 0;
00072 
00077         virtual bool close() = 0;
00078 
00082         virtual FeedStorage* archiveFor(const QString &url) = 0;
00083         virtual bool autoCommit() const  = 0;
00084         virtual int unreadFor(const QString &url) = 0;
00085         virtual void setUnreadFor(const QString &url, int unread) = 0;
00086         virtual int totalCountFor(const QString &url) = 0;
00087         virtual void setTotalCountFor(const QString &url, int total) = 0;
00088         virtual int lastFetchFor(const QString& url) = 0;
00089         virtual void setLastFetchFor(const QString& url, int lastFetch) = 0;
00090 
00095         virtual void storeFeedList(const QString& opmlStr) = 0;
00096         virtual QString restoreFeedList() const = 0;
00097 
00098         virtual void storeTagSet(const QString& xmlStr) = 0;
00099         virtual QString restoreTagSet() const = 0;
00100 
00103         virtual QStringList feeds() const = 0;
00104 
00108         virtual void add(Storage* source) = 0;
00109         
00111         virtual void clear() = 0;
00112         
00113      private:
00114         
00115         static Storage *m_instance;
00116 };
00117 
00118 }
00119 }
00120 
00121 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys