KNewStuff
feed.cpp
Go to the documentation of this file.00001 /* 00002 This file is part of KNewStuff2. 00003 Copyright (c) 2007 Josef Spillner <spillner@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #include "feed.h" 00022 00023 #include <kdebug.h> 00024 00025 using namespace KNS; 00026 00027 struct KNS::FeedPrivate { 00028 KTranslatable mName; 00029 KTranslatable mDescription; 00030 KUrl mFeed; 00031 Entry::List mEntries; 00032 }; 00033 00034 Feed::Feed() 00035 : d(new FeedPrivate) 00036 { 00037 } 00038 00039 Feed::~Feed() 00040 { 00041 delete d; 00042 } 00043 00044 void Feed::setName(const KTranslatable& name) 00045 { 00046 d->mName = name; 00047 } 00048 00049 KTranslatable Feed::name() const 00050 { 00051 return d->mName; 00052 } 00053 00054 void Feed::setDescription(const KTranslatable &description) 00055 { 00056 d->mDescription = description; 00057 } 00058 00059 KTranslatable Feed::description() const 00060 { 00061 return d->mDescription; 00062 } 00063 00064 void Feed::setFeedUrl(const KUrl& feedurl) 00065 { 00066 d->mFeed = feedurl; 00067 } 00068 00069 KUrl Feed::feedUrl() const 00070 { 00071 return d->mFeed; 00072 } 00073 00074 void Feed::addEntry(Entry *entry) 00075 { 00076 //kDebug() << "adding entry: " << entry->name().representation() << " to feed: " << this; 00077 d->mEntries.append(entry); 00078 } 00079 00080 void Feed::removeEntry(Entry * entry) 00081 { 00082 //kDebug() << "removing entry: " << entry->name().representation() << " from feed: " << this; 00083 d->mEntries.removeAll(entry); 00084 } 00085 00086 Entry::List Feed::entries() const 00087 { 00088 return d->mEntries; 00089 } 00090