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 TQt, and distribute the resulting executable, 00022 without including the source code for TQt in the source distribution. 00023 */ 00024 00025 #ifndef AKREGATOR_BACKEND_STORAGE_H 00026 #define AKREGATOR_BACKEND_STORAGE_H 00027 00028 #include <tqobject.h> 00029 00030 #include "akregator_export.h" 00031 00032 class TQString; 00033 class TQStringList; 00034 00035 namespace Akregator { 00036 namespace Backend { 00037 00038 class FeedStorage; 00039 00044 class AKREGATOR_EXPORT Storage : public TQObject 00045 { 00046 public: 00047 00048 static Storage* getInstance(); 00049 static void setInstance(Storage* instance); 00050 00051 virtual ~Storage() {} 00052 00055 virtual void initialize(const TQStringList& params) = 0; 00056 00061 virtual bool open(bool autoCommit = false) = 0; 00062 00067 virtual bool commit() = 0; 00068 00073 virtual bool rollback() = 0; 00074 00079 virtual bool close() = 0; 00080 00084 virtual FeedStorage* archiveFor(const TQString &url) = 0; 00085 virtual bool autoCommit() const = 0; 00086 virtual int unreadFor(const TQString &url) = 0; 00087 virtual void setUnreadFor(const TQString &url, int unread) = 0; 00088 virtual int totalCountFor(const TQString &url) = 0; 00089 virtual void setTotalCountFor(const TQString &url, int total) = 0; 00090 virtual int lastFetchFor(const TQString& url) = 0; 00091 virtual void setLastFetchFor(const TQString& url, int lastFetch) = 0; 00092 00097 virtual void storeFeedList(const TQString& opmlStr) = 0; 00098 virtual TQString restoreFeedList() const = 0; 00099 00100 virtual void storeTagSet(const TQString& xmlStr) = 0; 00101 virtual TQString restoreTagSet() const = 0; 00102 00105 virtual TQStringList feeds() const = 0; 00106 00110 virtual void add(Storage* source) = 0; 00111 00113 virtual void clear() = 0; 00114 00115 private: 00116 00117 static Storage *m_instance; 00118 }; 00119 00120 } 00121 } 00122 00123 #endif