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 class QStringList;
00031 
00032 
00033 namespace Akregator {
00034 namespace Backend {
00035 
00037 class Category 
00038 {
00039     public:
00040 
00041     QString term;
00042     QString scheme;
00043     QString name;
00044 
00047     bool operator==(const Category& other) const
00048     {
00049         return term == other.term && scheme == other.scheme;
00050     }
00051 
00052     bool operator!=(const Category& other) const 
00053     { 
00054         return !operator==(other); 
00055     }
00057     bool operator<(const Category& other) const
00058     {
00059         return other.scheme < other.scheme || (other.scheme == other.scheme && term < other.term);
00060     }
00061 };
00062 
00063 class Storage;
00064 
00065 class FeedStorage : public QObject
00066 {
00067     public:
00068     
00069         virtual int unread() = 0;
00070         virtual void setUnread(int unread) = 0;
00071         virtual int totalCount() = 0;
00072         virtual int lastFetch() = 0;
00073         virtual void setLastFetch(int lastFetch) = 0;
00074         
00076         virtual QStringList articles(const QString& tagID=QString::null) = 0;
00077 
00079         virtual QStringList articles(const Category& cat) = 0;
00080 
00084         virtual void add(FeedStorage* source) = 0;
00085 
00087         virtual void copyArticle(const QString& guid, FeedStorage* source) = 0;
00088 
00090         virtual void clear() = 0;
00091 
00092         
00093         virtual bool contains(const QString& guid) = 0;
00094         virtual void addEntry(const QString& guid) = 0;
00095         virtual void deleteArticle(const QString& guid) = 0;
00096         virtual int comments(const QString& guid) = 0;
00097         virtual QString commentsLink(const QString& guid) = 0;
00098         virtual void setCommentsLink(const QString& guid, const QString& commentsLink) = 0;
00099         virtual void setComments(const QString& guid, int comments) = 0;
00100         virtual bool guidIsHash(const QString& guid) = 0;
00101         virtual void setGuidIsHash(const QString& guid, bool isHash) = 0;
00102         virtual bool guidIsPermaLink(const QString& guid) = 0;
00103         virtual void setGuidIsPermaLink(const QString& guid, bool isPermaLink) = 0;
00104         virtual uint hash(const QString& guid) = 0;
00105         virtual void setHash(const QString& guid, uint hash) = 0;
00106         virtual void setDeleted(const QString& guid) = 0;
00107         virtual QString link(const QString& guid) = 0;
00108         virtual void setLink(const QString& guid, const QString& link) = 0;
00109         virtual uint pubDate(const QString& guid) = 0;
00110         virtual void setPubDate(const QString& guid, uint pubdate) = 0;
00111         virtual int status(const QString& guid) = 0;
00112         virtual void setStatus(const QString& guid, int status) = 0;
00113         virtual QString title(const QString& guid) = 0;
00114         virtual void setTitle(const QString& guid, const QString& title) = 0;
00115         virtual QString description(const QString& guid) = 0;
00116         virtual void setDescription(const QString& guid, const QString& description) = 0;
00117 
00118         virtual void addTag(const QString& guid, const QString& tag) = 0;
00119         virtual void removeTag(const QString& guid, const QString& tag) = 0;
00120 
00122         virtual QStringList tags(const QString& guid=QString::null) = 0;
00123 
00124         virtual void addCategory(const QString& guid, const Category& category) = 0;
00125         virtual QValueList<Category> categories(const QString& guid=QString::null) = 0;
00126 
00127         virtual void setEnclosure(const QString& guid, const QString& url, const QString& type, int length) = 0;
00128         virtual void removeEnclosure(const QString& guid) = 0;
00129         
00130         virtual void setAuthor(const QString& /*guid*/, const QString& /*author*/) {}
00131         virtual QString author(const QString& /*guid*/) { return QString(); }
00132         
00133         virtual void enclosure(const QString& guid, bool& hasEnclosure, QString& url, QString& type, int& length) = 0;
00134         virtual void close() = 0;
00135         virtual void commit() = 0;
00136         virtual void rollback() = 0;
00137     
00138         virtual void convertOldArchive() = 0;
00139 };
00140 
00141 }
00142 }
00143 
00144 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys