1 | /* |
---|
2 | * AIFileTransferControllerProtocol.h |
---|
3 | * Adium |
---|
4 | * |
---|
5 | * Created by Evan Schoenberg on 7/31/06. |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #import <Adium/AIControllerProtocol.h> |
---|
10 | #import <Adium/AIListContact.h> |
---|
11 | |
---|
12 | #define FileTransfer_NewFileTransfer @"NewFileTransfer" |
---|
13 | |
---|
14 | #define PREF_GROUP_FILE_TRANSFER @"FileTransfer" |
---|
15 | |
---|
16 | #define KEY_FT_AUTO_ACCEPT @"FT AutoAccept" |
---|
17 | #define KEY_FT_AUTO_OPEN_SAFE @"FT AutoOpenSafe" |
---|
18 | #define KEY_FT_AUTO_CLEAR_COMPLETED @"FT AutoClearCompleted" |
---|
19 | #define KEY_FT_SHOW_PROGRESS_WINDOW @"FT ShowProgressWindow" |
---|
20 | |
---|
21 | typedef enum { |
---|
22 | Unknown_FileTransfer = 0, |
---|
23 | Incoming_FileTransfer, |
---|
24 | Outgoing_FileTransfer, |
---|
25 | } AIFileTransferType; |
---|
26 | |
---|
27 | typedef enum { |
---|
28 | Unknown_Status_FileTransfer = 0, |
---|
29 | Not_Started_FileTransfer, //File transfer has not yet started |
---|
30 | Checksumming_Filetransfer, //Calculating a checksum for a file that is to be sent |
---|
31 | Waiting_on_Remote_User_FileTransfer, //Is pending confirmation from the remote user |
---|
32 | Connecting_FileTransfer, //Is negotiating a connection |
---|
33 | Accepted_FileTransfer, //Could also be called Began_FileTransfer or Started_FileTransfer |
---|
34 | In_Progress_FileTransfer, //Currently transferring, not yet complete |
---|
35 | Complete_FileTransfer, //File is complete; transferring is finished. |
---|
36 | Cancelled_Local_FileTransfer, //The local user cancelled the transfer |
---|
37 | Cancelled_Remote_FileTransfer, //The remote user cancelled the transfer |
---|
38 | Failed_FileTransfer //The transfer failed. |
---|
39 | } AIFileTransferStatus; |
---|
40 | |
---|
41 | typedef enum { |
---|
42 | AutoAccept_None = 0, |
---|
43 | AutoAccept_All, |
---|
44 | AutoAccept_FromContactList, |
---|
45 | } AIFileTransferAutoAcceptType; |
---|
46 | |
---|
47 | @class ESFileTransfer, AIAccount; |
---|
48 | |
---|
49 | @protocol AIFileTransferController <AIController> |
---|
50 | //Should be the only vendor of new ESFileTransfer* objects, as it creates, tracks, and returns them |
---|
51 | - (ESFileTransfer *)newFileTransferWithContact:(AIListContact *)inContact forAccount:(AIAccount *)inAccount type:(AIFileTransferType)type; |
---|
52 | |
---|
53 | - (NSArray *)fileTransferArray; |
---|
54 | |
---|
55 | - (int)activeTransferCount; |
---|
56 | |
---|
57 | - (void)receiveRequestForFileTransfer:(ESFileTransfer *)fileTransfer; |
---|
58 | |
---|
59 | - (void)fileTransfer:(ESFileTransfer *)fileTransfer didSetStatus:(AIFileTransferStatus)status; |
---|
60 | |
---|
61 | - (void)sendFile:(NSString *)inFile toListContact:(AIListContact *)listContact; |
---|
62 | - (void)requestForSendingFileToListContact:(AIListContact *)listContact; |
---|
63 | |
---|
64 | - (NSString *)stringForSize:(unsigned long long)inSize; |
---|
65 | - (NSString *)stringForSize:(unsigned long long)inSize of:(unsigned long long)totalSize ofString:(NSString *)totalSizeString; |
---|
66 | |
---|
67 | - (void)_removeFileTransfer:(ESFileTransfer *)fileTransfer; |
---|
68 | @end |
---|