RSSFeed.h
/* -*-objc-*-
*
* GNUstep RSS Kit
* Copyright (C) 2010-2011 The Free Software Foundation, Inc.
* 2006 Guenther Noack
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, in version 2.1
* of the License
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#import <objc/objc.h>
#import <Foundation/Foundation.h>
#import "RSSFeedProtocol.h"
#import "RSSArticle.h"
enum RSSFeedStatus
{
RSSFeedIsFetching,
RSSFeedIsIdle
};
@interface RSSFeed : NSObject <RSSMutableFeed>
{
@protected
NSDate* lastRetrieval;
BOOL clearFeedBeforeFetching;
NSMutableArray* articles;
enum RSSFeedError lastError;
NSString* feedName;
NSURL* feedURL;
Class articleClass;
enum RSSFeedStatus status;
NSMutableData *cacheData; // Used only when load in background.
}
+ (RSSFeed *) feed;
+ (RSSFeed *) feedWithURL: (NSURL*) aURL;
- (id) init;
- (id) initWithURL: (NSURL*) aURL;
-(NSString*) description;
// ----------------------------------------------------------------------
// Status access
// ----------------------------------------------------------------------
- (enum RSSFeedStatus) status;
- (BOOL)isFetching;
// ----------------------------------------------------------------------
// Access to the articles
// ----------------------------------------------------------------------
// Note: please refer to RSSFeed protocol instead.
- (NSEnumerator*) articleEnumerator;
- (void) removeArticle: (RSSArticle*) article;
// ----------------------------------------------------------------------
// Access to the preferences
// ----------------------------------------------------------------------
- (void) setFeedName: (NSString*) aFeedName;
- (NSString*) feedName;
- (NSURL*) feedURL;
// --------------------------------------------------------------------
// Equality and hash codes
// --------------------------------------------------------------------
- (BOOL) isEqual: (id)anObject;
// --------------------------------------------------------------------
// Accessor and Mutator for the automatic clearing
// --------------------------------------------------------------------
- (void) clearArticles;
// ------------------------------------------------------------------
// Extensions that make subclassing RSSFeed and RSSArticle easier.
// ------------------------------------------------------------------
-(void) setArticleClass:(Class)aClass;
-(Class) articleClass;
// ------------------------------------------------------------------
// Dirtyness, now implemented via the date of last retrieval
// ------------------------------------------------------------------
-(NSDate*) lastRetrieval;
-(void) newArticleFound: (id) anArticle;
@end
RSSArticle
Definition RSSArticle.h:38
RSSFeed
Definition RSSFeed.h:87
RSSFeed::lastError
enum RSSFeedError lastError
Definition RSSFeed.h:92
RSSFeed::articleClass
Class articleClass
Definition RSSFeed.m:259
-[RSSFeed isFetching]
BOOL isFetching()
Definition RSSFeed.m:99
-[RSSFeed articleEnumerator]
NSEnumerator * articleEnumerator()
Definition RSSFeed.m:138
-[RSSFeed clearArticles]
void clearArticles()
Definition RSSFeed.m:234