-
Notifications
You must be signed in to change notification settings - Fork 3
/
ItemAttachmentManager.j
56 lines (43 loc) · 1.38 KB
/
ItemAttachmentManager.j
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
var SharedManager;
@implementation ItemAttachmentManager : CPObject
{
}
/*+ (ItemAttachmentManager)sharedManager
{
if (!SharedManager)
SharedManager = [[ItemAttachmentManager alloc] init];
return SharedManager;
}
- (ItemAttachment)attachmentForObject:(ItemAttachment)anAttachment
{
// check the cached version first
// get it from the tubes
}
- (void)openAttachment:(ItemAttachment)anAttachment
{
var newWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(50, 75, 520, 400) styleMask:CPTitledWindowMask|CPClosableWindowMask|CPMiniaturizableWindowMask|CPResizableWindowMask];
[newWindow center];
[newWinodw orderFront:self];
}
- (CPImage)thumbnailForAttachment:(ItemAttachment)anAttachment
{
if ([anAttachment type] === "png" || [anAttachment type] === "gif" || [anAttachment type] === "jpg")
{
// give me a thumbnail
}
}
- (id)cacheAttachment:(ItemAttachment)anAttachment
{
if (![RLOfflineDatabaseStore offlineDataStoreIsAvailable])
return;
var storage = [[RLOfflineDatabaseStore alloc] - (id)initWithName:"InventoryFileCache" delegate:self];
var data = [storage getValueForKey:@"InventoryData"];
}
- (void)userDidRejectDatabase
{
alert("In order to use local caching for faster file access and offline accesability you need to accept the database.");
}
- (void)didReciveData:(CPString)fileData
{
}*/
@end