Don't link with Carbon.framework.
[MacTF.git] / TFUSBController.h
blob1691e0d33ae182d36ee65ed357870f4c6426af77
1 //
2 // TFUSBController.h
3 // MacTF
4 //
5 // Created by Nathan Oates on Sun Aug 01 2004.
6 // Copyright (c) 2004-7 Nathan Oates. All rights reserved.
7 //
9 // Includes code from uproar - see below for License:
12 * uproar 0.1
13 * Copyright (c) 2001 Kasima Tharnpipitchai <me@kasima.org>
15 * This source code is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Public License as published
17 * by the Free Software Foundation; either version 2 of the License,
18 * or (at your option) any later version.
20 * This source code is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 * Please refer to the GNU Public License for more details.
25 * You should have received a copy of the GNU Public License along with
26 * this source code; if not, write to:
27 * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 /* This file was modified by Kalle Olavi Niemitalo on 2007-10-28. */
32 #import <Foundation/Foundation.h>
33 #include <IOKit/usb/IOUSBLib.h>
35 @class DataHandler;
37 //#define kBlockSize 0x08
38 #define kMaxXferSize 0xFFFF
40 #define kUproarSuccess 0
41 #define kUproarTrackNotFound -1
42 #define kUproarTrackExists -2
43 #define kUproarDeviceErr -3
44 #define kUproarNotEnoughSpace -4
47 typedef struct {
48 IOUSBDeviceInterface197 **dev;
49 IOUSBInterfaceInterface197 **intf;
50 } USBDeviceContext;
53 @interface TFUSBController : NSObject {
54 NSProgressIndicator* progressBar;
55 NSTextField* progressTime;
56 NSButton* turboCB;
57 USBDeviceContext* myContext;
58 NSMutableArray* transferQueue;
59 NSMutableArray* priorityTransferQueue;
60 NSMutableArray* pausedQueue;
61 DataHandler* dh; //move
62 id tableView;// and this?
65 - (void) closeDevice:(USBDeviceContext *)device;
67 - (USBDeviceContext*) initializeUSB;
68 - (int) getFile:(NSDictionary*)fileInfo forPath:(NSString*)currentPath
69 toSaveTo:(NSString*)savePath beginAtOffset:(unsigned long long)offset
70 withLooping:(BOOL)looping existingTime:(NSTimeInterval)existingTime;
71 - (void) uploadFile:(NSString*)fileToUpload ofSize:(long long)size
72 fromPath:(NSString*)curPath withAttributes:(NSData*)typeFile
73 atOffset:(unsigned long long)offset
74 existingTime:(NSTimeInterval)existingTime;
75 - (int) getSpeed;
76 - (void) setDebug:(int)mode;
77 - (void) setRate:(int)newRate;
78 - (void) setProgressBar:(NSProgressIndicator*)bar time:(NSTextField*)timeField
79 turbo:(NSButton*)turbo;
80 - (void) deleteFile:(NSDictionary*)fileInfo fromPath:(NSString*)currentPath;
81 - (void) transfer:(id)sender;
82 - (void) addPriorityTransfer:(id)newTransfer;
83 - (void) addTransfer:(id)newTransfer atIndex:(int)front; //-1 for end of array
84 - (void) setDH:(id)newDH tableView:(id)tv;
85 - (BOOL) hasCurrentTransfer;
86 - (id) currentTransferInfo;
87 - (void) clearQueues;
88 - (id) firstPausedTransferInfo;
90 @end