1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
/* -*-objc-*-
*
* GNUstep RSS Kit
* Copyright (C) 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>
@class RSSArticle;
#import "RSSFeed.h"
#import "RSSArticleProtocol.h"
/**
* An object of this class represents an article in an RSS Feed.
*/
@interface RSSArticle : NSObject <RSSMutableArticle>
{
@protected
NSString* headline;
NSString* url;
NSString* description;
NSDate* date;
@private
NSURL* enclosure;
/// Links and multimedia content
NSMutableArray* links;
id<RSSFeed> feed;
}
/**
* Standard initializer. You shouldn't use this. Better use
* initWithHeadline:url:description:date:
*
* @see initWithHeadline:url:description:date:
*/
-init;
/**
* Designated initializer for the RSSArticle class.
*
* Don't create RSSArticle objects yourself. Create a RSSFeed
* object and let it fetch the articles for you!
*
* @param myHeadline A NSString containing the headline of the article.
* @param myUrl A NSString containing the URL of the
* full version of the article.
* @param myDescription An excerpt of the article text or the full text.
* @param myDate The date as NSDate object on which this article was posted.
* @see RSSFeed
*/
-initWithHeadline: (NSString*) myHeadline
url: (NSString*) myUrl
description: (NSString*) myDescription
date: (NSDate*) myDate;
-(void) dealloc;
// Autoclear flag
-(void) setAutoClear: (BOOL) autoClear;
-(BOOL) autoClear;
// Accessor methods (conformance to RSSArticle protocol)
-(NSString*)headline;
-(NSString*)url;
-(NSString*)content;
-(NSString*)description;
-(NSArray*) links;
-(NSDate*) date;
-(NSURL*)enclosure;
// Mutability methods (conformance to RSSMutableArticle protocol)
-(void)addLink:(NSURL*) anURL;
-(void)setLinks: (NSArray*) someLinks;
-(void)setFeed: (id<RSSMutableFeed>) aFeed;
-(void)setDate: (NSDate*) aDate;
/**
* Sends a change notification to the notification center.
* Useful for subclassing.
*/
-(void)notifyChange;
// Equality and hash codes
- (BOOL) isEqual: (id)anObject;
/**
* This method is intended to make sure that the replacing article keeps
* some fields from the old (this) article. Subclasses will probably want
* to override this, but shouldn't forget calling the super implementation,
* first.
*/
-(void)willBeReplacedByArticle: (id<RSSMutableArticle>) newArticle;
@end
|