-
Notifications
You must be signed in to change notification settings - Fork 0
/
CKImage.h
55 lines (49 loc) · 1.74 KB
/
CKImage.h
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
/*
* ChanKit - Imageboard parsing and interaction.
* Copyright 2009-2012 command-Q.org. All rights reserved.
* This framework is distributed under the terms of the Do What The Fuck You Want To Public License, Version 2.
*
* CKImage.h - Cross-compatible wrapper around NSImage with imageboard-specific metadata and convenience routines.
*/
@class NSImage;
@interface CKImage : NSObject {
NSURL* URL;
NSData* image;
NSString* name;
NSUInteger size;
NSString* MD5;
NSSize resolution;
NSDate* timestamp;
CKImage* thumbnail;
BOOL spoiler;
BOOL verified;
}
@property(nonatomic,readonly) NSURL* URL;
@property(nonatomic,readonly) NSImage* image;
@property(nonatomic,readwrite,copy) NSString* name;
@property(nonatomic,readwrite,assign) NSUInteger size;
@property(nonatomic,readonly) NSString* formattedSize;
@property(nonatomic,readwrite,copy) NSString* MD5;
@property(nonatomic,readwrite,assign) NSSize resolution;
@property(nonatomic,readonly) NSString* formattedResolution;
@property(nonatomic,readwrite,retain) NSDate* timestamp;
@property(nonatomic,readonly) NSString* formattedTimestamp;
@property(nonatomic,readwrite,retain) CKImage* thumbnail;
@property(nonatomic,readonly) NSData* data;
@property(nonatomic,readwrite,assign) BOOL spoiler;
@property(nonatomic,readonly) BOOL loaded;
@property(nonatomic,readonly) BOOL verified;
- (id)initByReferencingURL:(NSURL*)url;
+ (CKImage*)imageReferencingURL:(NSURL*)url;
- (id)initWithContentsOfURL:(NSURL*)url;
+ (CKImage*)imageWithContentsOfURL:(NSURL*)url;
- (id)initWithXML:(NSXMLNode*)doc;
+ (CKImage*)imageFromXML:(NSXMLNode*)doc;
- (void)dealloc;
- (void)setMetadata:(NSDictionary*)meta;
- (int)load;
- (NSString*)description;
- (NSString*)prettyPrint;
- (NSXMLNode*)XMLRepresentation;
- (NSUInteger)hash;
@end