//
//  TISendOperation.h
//  Device Explorer
//
//  Created by otusweb on Fri May 02 2003.
//  Copyright (c) 2003 Texas Instruments Incorporated. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "TIComOperation.h"

/*"keys to force a location on the device (archive or RAM)"*/
extern NSString* archive;
extern NSString* memory;
extern NSString* defaultLocation;


enum TIReplaceResult
{
    TIResultFailure = -1,
    TIStopSendOperation = 0,
    TIReplaceFile,
    TIDontReplaceFile,
    TIReplaceAll, 
    TIDontReplaceAll
};
typedef enum TIReplaceResult TIReplaceResult;

@interface TISendOperation : TIComOperation
{
    NSArray* fileToSend;
    NSArray* destinationToSendTo;
    NSMutableArray *validItems;
    NSMutableDictionary *resultOfConversions;
    NSAppleEventDescriptor *fileContentsToSend;
    NSInteger totalByteNeededToBeSent;
    NSInteger totalByteSent;
    NSInteger totalByteSentInPreviousThread;
    BOOL replaceAll;
    BOOL dontReplaceAll;
    BOOL stopOperation;
    BOOL isASkingForReplace;
	BOOL dontReplace;
}

/*"initialiser"*/
+ (TISendOperation*) sendOperationWithFiles: (NSArray*) inFilesToSend
                               destinations: (NSArray*) inDestinations
                    sendingCompletionCallTo: (id) target
                                 withOption: (NSString*) inOption;
- (TISendOperation*) initWithFiles: (NSArray*) inFilesToSend
                      destinations: (NSArray*) inDestinations
           sendingCompletionCallTo: (id) target
                        withOption: (NSString*) inOption;

/*"Accessors"*/
- (NSArray*) fileToSend;
- (NSArray*) destinationToSendTo;
- (NSArray *) validItems;
- (NSInteger) totalByteNeededToBeSent;
- (NSInteger) totalByteSent;

- (BOOL)stopOperation;
- (BOOL)dontReplaceAll;
- (BOOL)dontReplace;
@end

@interface NSObject (TISendOperationTarget)
- (TIReplaceResult) sendOperationShouldReplaceFile: (NSString*) deviceFileName inDevice: (TIDevice*) targetDevice atPath: (NSString*) devicePath;
@end
