#import <UIKit/UIKit.h>

@class Tune;

@interface ImportProgressController : UIViewController
{
  NSURL *_url;
  NSMutableData *lineData;
  NSURLConnection *urlConnection;
  Tune *tune;
  long bytesRead;
  long bytesToRead;
  int numTunes;
  BOOL cancelled;
  NSMutableString *dots;

  IBOutlet UIButton *cancelButton;
  IBOutlet UIProgressView *progressView;
  IBOutlet UILabel *activityLabel;
  IBOutlet UILabel *statusLabel;
}

- (void)viewDidLoad;

- (void)import:(NSURL *)url;

- (IBAction) onCancel:(id)sender;

- (NSString *)fixAccents:(NSString *)s;

- (void)threadRun:(id)sender;
- (void) updateProgress:(id)sender;

- (void) connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response;
- (void) connection:(NSURLConnection *)connection didReceiveData:(NSData *)data;
- (void) connection:(NSURLConnection *)connection didFailWithError:(NSError *)error;
- (NSCachedURLResponse *) connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse;
- (void) connectionDidFinishLoading:(NSURLConnection *)connection;

@end
