akregator/src

feedstorage.h

00001 /*
00002     This file is part of Akregator.
00003 
00004     Copyright (C) 2005 Frank Osterfeld <frank.osterfeld@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 #ifndef AKREGATOR_BACKEND_FEEDSTORAGE_H
00025 #define AKREGATOR_BACKEND_FEEDSTORAGE_H
00026 
00027 #include <qobject.h>
00028 #include <qstring.h>
00029 
00030 #include "akregator_export.h"
00031 
00032 class QStringList;
00033 
00034 
00035 namespace Akregator {
00036 namespace Backend {
00037 
00039 class AKREGATOR_EXPORT Category 
00040 {
00041     public:
00042 
00043     QString term;
00044     QString scheme;
00045     QString name;
00046 
00049     bool operator==(const Category& other) const
00050     {
00051         return term == other.term && scheme == other.scheme;
00052     }
00053 
00054     bool operator!=(const Category& other) const 
00055     { 
00056         return !operator==(other); 
00057     }
00059     bool operator<(const Category& other) const
00060     {
00061         return other.scheme < other.scheme || (other.scheme == other.scheme && term < other.term);
00062     }
00063 };
00064 
00065 class Storage;
00066 
00067 class AKREGATOR_EXPORT FeedStorage : public QObject
00068 {
00069     public:
00070     
00071         virtual int unread() = 0;
00072         virtual void setUnread(int unread) = 0;
00073         virtual int totalCount() = 0;
00074         virtual int lastFetch() = 0;
00075         virtual void setLastFetch(int lastFetch) = 0;
00076         
00078         virtual QStringList articles(const QString& tagID=QString::null) = 0;
00079 
00081         virtual QStringList articles(const Category& cat) = 0;
00082 
00086         virtual void add(FeedStorage* source) = 0;
00087 
00089         virtual void copyArticle(const QString& guid, FeedStorage* source) = 0;
00090 
00092         virtual void clear() = 0;
00093 
00094         
00095         virtual bool contains(const QString& guid) = 0;
00096         virtual void addEntry(const QString& guid) = 0;
00097         virtual void deleteArticle(const QString& guid) = 0;
00098         virtual int comments(const QString& guid) = 0;
00099         virtual QString commentsLink(const QString& guid) = 0;
00100         virtual void setCommentsLink(const QString& guid, const QString& commentsLink) = 0;
00101         virtual void setComments(const QString& guid, int comments) = 0;
00102         virtual bool guidIsHash(const QString& guid) = 0;
00103         virtual void setGuidIsHash(const QString& guid, bool isHash) = 0;
00104         virtual bool guidIsPermaLink(const QString& guid) = 0;
00105         virtual void setGuidIsPermaLink(const QString& guid, bool isPermaLink) = 0;
00106         virtual uint hash(const QString& guid) = 0;
00107         virtual void setHash(const QString& guid, uint hash) = 0;
00108         virtual void setDeleted(const QString& guid) = 0;
00109         virtual QString link(const QString& guid) = 0;
00110         virtual void setLink(const QString& guid, const QString& link) = 0;
00111         virtual uint pubDate(const QString& guid) = 0;
00112         virtual void setPubDate(const QString& guid, uint pubdate) = 0;
00113         virtual int status(const QString& guid) = 0;
00114         virtual void setStatus(const QString& guid, int status) = 0;
00115         virtual QString title(const QString& guid) = 0;
00116         virtual void setTitle(const QString& guid, const QString& title) = 0;
00117         virtual QString description(const QString& guid) = 0;
00118         virtual void setDescription(const QString& guid, const QString& description) = 0;
00119 
00120         virtual void addTag(const QString& guid, const QString& tag) = 0;
00121         virtual void removeTag(const QString& guid, const QString& tag) = 0;
00122 
00124         virtual QStringList tags(const QString& guid=QString::null) = 0;
00125 
00126         virtual void addCategory(const QString& guid, const Category& category) = 0;
00127         virtual QValueList<Category> categories(const QString& guid=QString::null) = 0;
00128 
00129         virtual void setEnclosure(const QString& guid, const QString& url, const QString& type, int length) = 0;
00130         virtual void removeEnclosure(const QString& guid) = 0;
00131         
00132         virtual void setAuthor(const QString& /*guid*/, const QString& /*author*/) {}
00133         virtual QString author(const QString& /*guid*/) { return QString(); }
00134         
00135         virtual void enclosure(const QString& guid, bool& hasEnclosure, QString& url, QString& type, int& length) = 0;
00136         virtual void close() = 0;
00137         virtual void commit() = 0;
00138         virtual void rollback() = 0;
00139     
00140         virtual void convertOldArchive() = 0;
00141 };
00142 
00143 }
00144 }
00145 
00146 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys