1 | /* |
---|
2 | * Adium is the legal property of its developers, whose names are listed in the copyright file included |
---|
3 | * with this source distribution. |
---|
4 | * |
---|
5 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU |
---|
6 | * General Public License as published by the Free Software Foundation; either version 2 of the License, |
---|
7 | * or (at your option) any later version. |
---|
8 | * |
---|
9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
---|
10 | * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
11 | * Public License for more details. |
---|
12 | * |
---|
13 | * You should have received a copy of the GNU General Public License along with this program; if not, |
---|
14 | * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
15 | */ |
---|
16 | |
---|
17 | #import <Adium/AIAccount.h> |
---|
18 | #import <Adium/AIContentMessage.h> |
---|
19 | #import <Adium/AIFileTransferControllerProtocol.h> |
---|
20 | |
---|
21 | #define CONTENT_FILE_TRANSFER_TYPE @"File Transfer Type" |
---|
22 | |
---|
23 | @class AIAccount, AIListObject, ESFileTransfer, ESFileTransferRequestPromptController; |
---|
24 | |
---|
25 | @protocol FileTransferDelegate |
---|
26 | -(void)fileTransfer:(ESFileTransfer *)fileTransfer didSetType:(AIFileTransferType)type; |
---|
27 | -(void)fileTransfer:(ESFileTransfer *)fileTransfer didSetStatus:(AIFileTransferStatus)status; |
---|
28 | -(void)fileTransfer:(ESFileTransfer *)fileTransfer didSetSize:(unsigned long long)size; |
---|
29 | -(void)fileTransfer:(ESFileTransfer *)fileTransfer didSetLocalFilename:(NSString *)inLocalFilename; |
---|
30 | -(void)gotUpdateForFileTransfer:(ESFileTransfer *)fileTransfer; |
---|
31 | @end |
---|
32 | |
---|
33 | @interface ESFileTransfer : AIContentMessage { |
---|
34 | NSString *localFilename; |
---|
35 | NSString *remoteFilename; |
---|
36 | id accountData; |
---|
37 | |
---|
38 | float percentDone; |
---|
39 | unsigned long long size; |
---|
40 | unsigned long long bytesSent; |
---|
41 | BOOL isDirectory; |
---|
42 | AIFileTransferType type; |
---|
43 | AIFileTransferStatus status; |
---|
44 | |
---|
45 | NSString *uniqueID; |
---|
46 | id <FileTransferDelegate> delegate; |
---|
47 | |
---|
48 | ESFileTransferRequestPromptController *promptController; |
---|
49 | } |
---|
50 | |
---|
51 | + (id)fileTransferWithContact:(AIListContact *)inContact forAccount:(AIAccount *)inAccount type:(AIFileTransferType)t; |
---|
52 | + (ESFileTransfer *)existingFileTransferWithID:(NSString *)fileTransferID; |
---|
53 | |
---|
54 | - (AIListContact *)contact; |
---|
55 | - (AIAccount<AIAccount_Files> *)account; |
---|
56 | |
---|
57 | - (void)setRemoteFilename:(NSString *)inRemoteFilename; |
---|
58 | - (NSString *)remoteFilename; |
---|
59 | |
---|
60 | - (void)setLocalFilename:(NSString *)inLocalFilename; |
---|
61 | - (NSString *)localFilename; |
---|
62 | |
---|
63 | - (NSString *)displayFilename; |
---|
64 | |
---|
65 | - (void)setSize:(unsigned long long)inSize; |
---|
66 | - (unsigned long long)size; |
---|
67 | |
---|
68 | - (void)setIsDirectory:(BOOL)inIsDirectory; |
---|
69 | - (BOOL)isDirectory; |
---|
70 | |
---|
71 | - (void)setFileTransferType:(AIFileTransferType)inType; |
---|
72 | - (AIFileTransferType)fileTransferType; |
---|
73 | |
---|
74 | - (void)setStatus:(AIFileTransferStatus)inStatus; |
---|
75 | - (AIFileTransferStatus)status; |
---|
76 | |
---|
77 | - (void)setPercentDone:(float)inPercent bytesSent:(unsigned long long)inBytesSent; |
---|
78 | - (float)percentDone; |
---|
79 | - (unsigned long long)bytesSent; |
---|
80 | |
---|
81 | - (void)setAccountData:(id)inAccountData; |
---|
82 | - (id)accountData; |
---|
83 | |
---|
84 | - (void)setDelegate:(id <FileTransferDelegate>)inDelegate; |
---|
85 | - (id <FileTransferDelegate>)delegate; |
---|
86 | |
---|
87 | - (BOOL)isStopped; |
---|
88 | |
---|
89 | - (void)cancel; |
---|
90 | - (void)reveal; |
---|
91 | - (void)openFile; |
---|
92 | |
---|
93 | - (NSImage *)iconImage; |
---|
94 | |
---|
95 | - (NSString *)uniqueID; |
---|
96 | |
---|
97 | - (void)setFileTransferRequestPromptController:(ESFileTransferRequestPromptController *)inPromptController; |
---|
98 | - (ESFileTransferRequestPromptController *)fileTransferRequestPromptController; |
---|
99 | |
---|
100 | @end |
---|