/***************************************************************************
                            KDataToolInfo.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_KDataToolInfo.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KDataToolInfo.h>
#include <qtobjc/QObject.h>


@implementation  KDataToolInfo

- (void *) qt
{
	return _qt;
}

- setQt: (void *) qt
{
	_qt = qt;
	return self;
}

- (BOOL) allocatedInObjcWorld
{
	return _allocatedInObjcWorld;
}

- setAllocatedInObjcWorld: (BOOL) yn
{
	_allocatedInObjcWorld = yn;
	return self;
}


- init
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KDataToolInfo()];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

//- initWithServicePtr: (KServicePtr*)service instance: (KInstance*)instance
//{
//	if ([self qt] == 0L) {
//		[self setQt: kde_new_KDataToolInfo1((kde_KServicePtr*) [service qt], (kde_KInstance*) [instance qt])];
//		[self setAllocatedInObjcWorld: YES];
//		[QtSupport setObject: self forQtKey: [self qt]];
//	}
//	[super init];
//	return self;
//}

- copyWithZone: (NSZone *) zone
{
	KDataToolInfo * aCopy;
	aCopy = [[(KDataToolInfo *)[[self class] allocWithZone: zone] setQt: kde_new_KDataToolInfo2([self qt])] init];
	[aCopy setAllocatedInObjcWorld: YES];
	[QtSupport setObject: aCopy forQtKey: [aCopy qt]];
	return aCopy;
}

- (NSString *) dataType
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KDataToolInfo_dataType((kde_KDataToolInfo *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (NSArray *) mimeTypes
{
static qt_QStringList * _qlist = 0L;
	_qlist = kde_KDataToolInfo_mimeTypes((kde_KDataToolInfo *)[self qt]);
	return (NSArray *) [NSMutableArray arrayWithQStringList: _qlist];
}

- (BOOL) isReadOnly
{
	return (BOOL) kde_KDataToolInfo_isReadOnly((kde_KDataToolInfo *)[self qt]);
}

- (QPixmap*) icon
{
	return (QPixmap*) [QtSupport objectForQtKey: kde_KDataToolInfo_icon((kde_KDataToolInfo *)[self qt]) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

- (QPixmap*) miniIcon
{
	return (QPixmap*) [QtSupport objectForQtKey: kde_KDataToolInfo_miniIcon((kde_KDataToolInfo *)[self qt]) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

- (NSString *) iconName
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KDataToolInfo_iconName((kde_KDataToolInfo *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (NSArray *) userCommands
{
static qt_QStringList * _qlist = 0L;
	_qlist = kde_KDataToolInfo_userCommands((kde_KDataToolInfo *)[self qt]);
	return (NSArray *) [NSMutableArray arrayWithQStringList: _qlist];
}

- (NSArray *) commands
{
static qt_QStringList * _qlist = 0L;
	_qlist = kde_KDataToolInfo_commands((kde_KDataToolInfo *)[self qt]);
	return (NSArray *) [NSMutableArray arrayWithQStringList: _qlist];
}

- (KDataTool*) createTool: (QObject *)parent name: (NSString *)name
{
	return (KDataTool*) [QtSupport objectForQtKey: kde_KDataToolInfo_createTool((kde_KDataToolInfo *)[self qt], (qt_QObject *) [parent qt], (char*) [name cString]) withClass: [KDataTool class] allocatedInObjcWorld: YES];
}

- (KDataTool*) createTool
{
	return (KDataTool*) [QtSupport objectForQtKey: kde_KDataToolInfo_createTool((kde_KDataToolInfo *)[self qt], 0, 0) withClass: [KDataTool class] allocatedInObjcWorld: YES];
}

//- (KService_Ptr*) service
//{
//	return (KService_Ptr*) kde_KDataToolInfo_service((kde_KDataToolInfo *)[self qt]);
//}

- (KInstance*) instance
{
	return (KInstance*) [QtSupport objectForQtKey: kde_KDataToolInfo_instance((kde_KDataToolInfo *)[self qt]) withClass: [KInstance class] allocatedInObjcWorld: YES];
}

- (BOOL) isValid
{
	return (BOOL) kde_KDataToolInfo_isValid((kde_KDataToolInfo *)[self qt]);
}

@end
