/***************************************************************************
                            CopyJob.m -  description
                             -------------------
    begin                : Fri Mar  8 13:55:08 2002
    copyright            : (C) 2000-2002 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Fri Mar  8 13:55:08 2002, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 ***************************************************************************/

#include <qtc/qt_QString.h>
#include <qtc/qt_QCString.h>
#include <kdec/kde_CopyJob.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/CopyJob.h>
#include <kdeobjc/KURL.h>


@implementation  CopyJob


- initWithArray: (NSArray *)src dest: (KURL*)dest mode: (int)mode asMethod: (BOOL)asMethod showProgressInfo: (BOOL)showProgressInfo
{
static kde_KURLList * _qlist_src = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_CopyJob((kde_KURLList*) [src toKURLList: (void *)&_qlist_src], (kde_KURL*) [dest qt], (int)mode, (int)asMethod, (int)showProgressInfo)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

//- (NSArray *) srcURLs
//{
//static kde_KURLList * _qlist = 0L;
//	_qlist = kde_CopyJob_srcURLs((kde_CopyJob *)[self qt]);
//	return (NSArray *) [NSMutableArray arrayWithKURLList: _qlist];
//}

- (KURL*) destURL
{
	return (KURL*) [QtSupport objectForQtKey: kde_CopyJob_destURL((kde_CopyJob *)[self qt]) withClass: [KURL class] allocatedInObjcWorld: YES];
}

- statNextSrc
{
	kde_CopyJob_statNextSrc((kde_CopyJob *)[self qt]);
	return self;
}

- slotResultStating: (Job*)job
{
	kde_CopyJob_slotResultStating((kde_CopyJob *)[self qt], (kde_Job*) [job qt]);
	return self;
}

- startListing: (KURL*)src
{
	kde_CopyJob_startListing((kde_CopyJob *)[self qt], (kde_KURL*) [src qt]);
	return self;
}

- slotResultCreatingDirs: (Job*)job
{
	kde_CopyJob_slotResultCreatingDirs((kde_CopyJob *)[self qt], (kde_Job*) [job qt]);
	return self;
}

- slotResultConflictCreatingDirs: (Job*)job
{
	kde_CopyJob_slotResultConflictCreatingDirs((kde_CopyJob *)[self qt], (kde_Job*) [job qt]);
	return self;
}

- createNextDir
{
	kde_CopyJob_createNextDir((kde_CopyJob *)[self qt]);
	return self;
}

- slotResultCopyingFiles: (Job*)job
{
	kde_CopyJob_slotResultCopyingFiles((kde_CopyJob *)[self qt], (kde_Job*) [job qt]);
	return self;
}

- slotResultConflictCopyingFiles: (Job*)job
{
	kde_CopyJob_slotResultConflictCopyingFiles((kde_CopyJob *)[self qt], (kde_Job*) [job qt]);
	return self;
}

- copyNextFile
{
	kde_CopyJob_copyNextFile((kde_CopyJob *)[self qt]);
	return self;
}

- slotResultDeletingDirs: (Job*)job
{
	kde_CopyJob_slotResultDeletingDirs((kde_CopyJob *)[self qt], (kde_Job*) [job qt]);
	return self;
}

- deleteNextDir
{
	kde_CopyJob_deleteNextDir((kde_CopyJob *)[self qt]);
	return self;
}

- skip: (KURL*)sourceURL
{
	kde_CopyJob_skip((kde_CopyJob *)[self qt], (kde_KURL*) [sourceURL qt]);
	return self;
}

- slotStart
{
	kde_CopyJob_slotStart((kde_CopyJob *)[self qt]);
	return self;
}

//- slotEntries: (Job*)arg1 list: (UDSEntryList*)list
//{
//	kde_CopyJob_slotEntries((kde_CopyJob *)[self qt], (kde_Job*) [arg1 qt], (kde_UDSEntryList*) [list qt]);
//	return self;
//}

- slotResult: (Job*)job
{
	kde_CopyJob_slotResult((kde_CopyJob *)[self qt], (kde_Job*) [job qt]);
	return self;
}

//- slotProcessedSize: (Job*)arg1 data_size: (unsigned long)data_size
//{
//	kde_CopyJob_slotProcessedSize((kde_CopyJob *)[self qt], (kde_Job*) [arg1 qt], (unsigned long)data_size);
//	return self;
//}

//- slotTotalSize: (Job*)arg1 size: (unsigned long)size
//{
//	kde_CopyJob_slotTotalSize((kde_CopyJob *)[self qt], (kde_Job*) [arg1 qt], (unsigned long)size);
//	return self;
//}

- slotReport
{
	kde_CopyJob_slotReport((kde_CopyJob *)[self qt]);
	return self;
}

+ (int) Copy
{
	return (int) COPYJOB_Copy;
}

+ (int) Move
{
	return (int) COPYJOB_Move;
}

+ (int) Link
{
	return (int) COPYJOB_Link;
}

@end
