ResKnife/Cocoa/Classes/Resource.h

42 lines
1.5 KiB
C
Raw Normal View History

2001-10-19 19:41:13 +00:00
#import <Foundation/Foundation.h>
2002-02-02 11:31:28 +00:00
#import "ResKnifeResourceProtocol.h"
2001-10-19 19:41:13 +00:00
@interface Resource : NSObject <NSCopying, NSCoding, ResKnifeResourceProtocol>
2001-10-19 19:41:13 +00:00
{
2002-02-02 11:31:28 +00:00
@private
// flags
BOOL dirty;
2003-04-03 15:38:42 +00:00
NSString *representedFork;
2001-10-19 19:41:13 +00:00
// resource information
NSString *name;
NSString *type;
NSNumber *resID; // signed short
NSNumber *attributes; // unsigned short
// the actual data
NSData *data;
NSDocument *document; // Our owner.
2001-10-19 19:41:13 +00:00
}
2003-04-03 15:38:42 +00:00
// accessor methods not part of the protocol
2001-10-19 19:41:13 +00:00
- (void)setDirty:(BOOL)newValue;
2003-04-03 15:38:42 +00:00
- (NSString *)representedFork;
- (void)setRepresentedFork:(NSString *)forkName;
2001-10-19 19:41:13 +00:00
2003-04-03 15:38:42 +00:00
// init methods
2001-10-19 19:41:13 +00:00
- (id)initWithType:(NSString *)typeValue andID:(NSNumber *)resIDValue;
- (id)initWithType:(NSString *)typeValue andID:(NSNumber *)resIDValue withName:(NSString *)nameValue andAttributes:(NSNumber *)attributesValue;
- (id)initWithType:(NSString *)typeValue andID:(NSNumber *)resIDValue withName:(NSString *)nameValue andAttributes:(NSNumber *)attributesValue data:(NSData *)dataValue;
2001-10-19 19:41:13 +00:00
2003-04-03 15:38:42 +00:00
// autoreleased resource methods
2001-10-19 19:41:13 +00:00
+ (id)resourceOfType:(NSString *)typeValue andID:(NSNumber *)resIDValue;
+ (id)resourceOfType:(NSString *)typeValue andID:(NSNumber *)resIDValue withName:(NSString *)nameValue andAttributes:(NSNumber *)attributesValue;
+ (id)resourceOfType:(NSString *)typeValue andID:(NSNumber *)resIDValue withName:(NSString *)nameValue andAttributes:(NSNumber *)attributesValue data:(NSData *)dataValue;
2001-10-19 19:41:13 +00:00
-(void) setDocument: (NSDocument*)doc;
-(NSDocument*) document; // Resource protocol guarantees this.
2001-10-19 19:41:13 +00:00
@end