Reformat method declarations of TFUSBController.
[MacTF.git] / TFUSBController.h
blob46a9a60fd426f6d6003022a198415eada49cb175
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>
34 #include <stdio.h>
35 #include <stdlib.h>
36 #include <string.h>
37 #include <ctype.h>
39 #include <mach/mach.h>
41 #include <CoreFoundation/CFNumber.h>
42 #import "DataHandler.h"
43 #include <IOKit/IOKitLib.h>
44 #include <IOKit/IOCFPlugIn.h>
45 #include <IOKit/usb/IOUSBLib.h>
47 //#define kBlockSize 0x08
48 #define kMaxXferSize 0xFFFF
50 #define kUproarSuccess 0
51 #define kUproarTrackNotFound -1
52 #define kUproarTrackExists -2
53 #define kUproarDeviceErr -3
54 #define kUproarNotEnoughSpace -4
57 typedef struct {
58 IOUSBDeviceInterface197 **dev;
59 IOUSBInterfaceInterface197 **intf;
60 } USBDeviceContext;
63 @interface TFUSBController : NSObject {
64 NSProgressIndicator* progressBar;
65 NSTextField* progressTime;
66 NSButton* turboCB;
67 USBDeviceContext* myContext;
68 NSMutableArray* transferQueue;
69 NSMutableArray* priorityTransferQueue;
70 NSMutableArray* pausedQueue;
71 DataHandler* dh; //move
72 id tableView;// and this?
74 int debug;
75 int rate;
76 int kBlockSize;
77 int connectedSpeed;
79 - (void) closeDevice:(USBDeviceContext *)device;
81 - (USBDeviceContext*) initializeUSB;
82 - (int) getFile:(NSDictionary*)fileInfo forPath:(NSString*)currentPath
83 toSaveTo:(NSString*)savePath beginAtOffset:(unsigned long long)offset
84 withLooping:(BOOL)looping existingTime:(NSTimeInterval)existingTime;
85 - (void) uploadFile:(NSString*)fileToUpload ofSize:(long long)size
86 fromPath:(NSString*)curPath withAttributes:(NSData*)typeFile
87 atOffset:(unsigned long long)offset
88 existingTime:(NSTimeInterval)existingTime;
89 - (int) getSpeed;
90 - (void) setDebug:(int)mode;
91 - (void) setRate:(int)newRate;
92 - (void) setProgressBar:(NSProgressIndicator*)bar time:(NSTextField*)timeField
93 turbo:(NSButton*)turbo;
94 - (void) deleteFile:(NSDictionary*)fileInfo fromPath:(NSString*)currentPath;
95 - (void) transfer:(id)sender;
96 - (void) addPriorityTransfer:(id)newTransfer;
97 - (void) addTransfer:(id)newTransfer atIndex:(int)front; //-1 for end of array
98 - (void) setDH:(id)newDH tableView:(id)tv;
99 - (void) clearQueues;
100 - (id) transferQueue;
101 - (id) pausedQueue;
103 @end