RSSKit  0.6.1
RSSFeed.h
1 /* -*-objc-*-
2  *
3  * GNUstep RSS Kit
4  * Copyright (C) 2010-2011 The Free Software Foundation, Inc.
5  * 2006 Guenther Noack
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation, in version 2.1
10  * of the License
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */
21 
22 #import <objc/objc.h>
23 #import <Foundation/Foundation.h>
24 
25 #import "RSSFeedProtocol.h"
26 
27 
28 #import "RSSArticle.h"
29 
33 enum RSSFeedStatus
34  {
35  RSSFeedIsFetching,
36  RSSFeedIsIdle
37  };
38 
39 
85 @interface RSSFeed : NSObject <RSSMutableFeed>
86 {
87 @protected
88  NSDate* lastRetrieval;
89  BOOL clearFeedBeforeFetching;
90  NSMutableArray* articles;
91  enum RSSFeedError lastError;
92  NSString* feedName;
93  NSURL* feedURL;
94  Class articleClass;
95 
96  enum RSSFeedStatus status;
97 
98  NSMutableData *cacheData; // Used only when load in background.
99 }
100 
101 
102 + (RSSFeed *) feed;
103 + (RSSFeed *) feedWithURL: (NSURL*) aURL;
104 
105 - (id) init;
106 
112 - (id) initWithURL: (NSURL*) aURL;
113 
114 
118 -(NSString*) description;
119 
120 
121 // ----------------------------------------------------------------------
122 // Status access
123 // ----------------------------------------------------------------------
124 
135 - (enum RSSFeedStatus) status;
136 
140 - (BOOL)isFetching;
141 
142 // ----------------------------------------------------------------------
143 // Access to the articles
144 // ----------------------------------------------------------------------
145 
146 // Note: please refer to RSSFeed protocol instead.
147 
151 - (NSEnumerator*) articleEnumerator;
152 
158 - (void) removeArticle: (RSSArticle*) article;
159 
160 
161 
162 // ----------------------------------------------------------------------
163 // Access to the preferences
164 // ----------------------------------------------------------------------
165 
169 - (void) setFeedName: (NSString*) aFeedName;
170 
174 - (NSString*) feedName;
175 
180 - (NSURL*) feedURL;
181 
182 
183 
184 // --------------------------------------------------------------------
185 // Equality and hash codes
186 // --------------------------------------------------------------------
187 - (BOOL) isEqual: (id)anObject;
188 
189 
190 // --------------------------------------------------------------------
191 // Accessor and Mutator for the automatic clearing
192 // --------------------------------------------------------------------
193 
194 
195 
199 - (void) clearArticles;
200 
201 
202 
203 // ------------------------------------------------------------------
204 // Extensions that make subclassing RSSFeed and RSSArticle easier.
205 // ------------------------------------------------------------------
206 
213 -(void) setArticleClass:(Class)aClass;
214 
221 -(Class) articleClass;
222 
223 
224 // ------------------------------------------------------------------
225 // Dirtyness, now implemented via the date of last retrieval
226 // ------------------------------------------------------------------
227 
234 -(NSDate*) lastRetrieval;
235 
236 
240 -(void) newArticleFound: (id) anArticle;
241 
242 @end
243 
244 
NSURL * feedURL()
Class articleClass()
NSDate * lastRetrieval()
Definition: RSSFeed.h:85
NSString * feedName()
BOOL isFetching()
Definition: RSSFeed.m:99
enum RSSFeedError lastError()
Definition: RSSFeed+Fetching.m:304
void clearArticles()
Definition: RSSFeed.m:234
Definition: RSSArticle.h:36
enum RSSFeedStatus status()
NSEnumerator * articleEnumerator()
Definition: RSSFeed.m:138
NSString * description()
Definition: RSSFeed.m:85