/***************************************************************************
                            KDEDesktopMimeType.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_KDEDesktopMimeType.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KDEDesktopMimeType.h>
#include <kdeobjc/KDesktopFile.h>
#include <kdeobjc/KSimpleConfig.h>
#include <kdeobjc/KURL.h>
#include <qtobjc/QDataStream.h>


@implementation  KDEDesktopMimeType


- initWithDesktopFile: (KDesktopFile*)config
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KDEDesktopMimeType((kde_KDesktopFile*) [config qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithDataStream: (QDataStream *)_str offset: (int)offset
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KDEDesktopMimeType1((qt_QDataStream *) [_str qt], (int)offset)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (NSString *) icon: (NSString *)_url _is_local: (BOOL)_is_local
{
static qt_QString * _qstring = 0L;
static qt_QString * _qstring__url = 0L;
	_qstring = kde_KDEDesktopMimeType_icon((kde_KDEDesktopMimeType *)[self qt], (qt_QString *) [_url toQString: &_qstring__url], (int)_is_local);
	return [NSString fromQString: _qstring];
}

- (NSString *) iconForURL: (KURL*)_url _is_local: (BOOL)_is_local
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KDEDesktopMimeType_icon1((kde_KDEDesktopMimeType *)[self qt], (kde_KURL*) [_url qt], (int)_is_local);
	return [NSString fromQString: _qstring];
}

- (QPixmap*) pixmap: (KURL*)_url _group: (int)_group _force_size: (int)_force_size _state: (int)_state _path: (NSString *)_path
{
static qt_QString * _qstring__path = 0L;
	return (QPixmap*) [QtSupport objectForQtKey: kde_KDEDesktopMimeType_pixmap((kde_KDEDesktopMimeType *)[self qt], (kde_KURL*) [_url qt], (int)_group, (int)_force_size, (int)_state, (qt_QString*) [_path toQString: &_qstring__path]) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

- (QPixmap*) pixmap: (KURL*)_url _group: (int)_group 
{
	return (QPixmap*) [QtSupport objectForQtKey: kde_KDEDesktopMimeType_pixmap((kde_KDEDesktopMimeType *)[self qt], (kde_KURL*) [_url qt], (int)_group, 0, 0, 0L) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

- (NSString *) comment: (NSString *)_url _is_local: (BOOL)_is_local
{
static qt_QString * _qstring = 0L;
static qt_QString * _qstring__url = 0L;
	_qstring = kde_KDEDesktopMimeType_comment((kde_KDEDesktopMimeType *)[self qt], (qt_QString *) [_url toQString: &_qstring__url], (int)_is_local);
	return [NSString fromQString: _qstring];
}

- (NSString *) commentForURL: (KURL*)_url _is_local: (BOOL)_is_local
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KDEDesktopMimeType_comment1((kde_KDEDesktopMimeType *)[self qt], (kde_KURL*) [_url qt], (int)_is_local);
	return [NSString fromQString: _qstring];
}

//+ executeService: (NSString *)_path _service: (KDEDesktopMimeType_Service*)_service
//{
//static qt_QString * _qstring__path = 0L;
//	kde_KDEDesktopMimeType_executeService((qt_QString *) [_path toQString: &_qstring__path], (kde_KDEDesktopMimeType_Service*) [_service qt]);
//	return self;
//}

//+ executeService: (NSArray *)urls service: (KDEDesktopMimeType_Service*)service
//{
//static kde_KURLList * _qlist_urls = 0L;
//	kde_KDEDesktopMimeType_executeService1((kde_KURLList*) [urls toKURLList: (void *)&_qlist_urls], (kde_KDEDesktopMimeType_Service*) [service qt]);
//	return self;
//}

+ (long) run: (KURL*)_url _is_local: (BOOL)_is_local
{
	return (long) kde_KDEDesktopMimeType_run((kde_KURL*) [_url qt], (int)_is_local);
}

- (QPixmap*) pixmap: (int)a b: (int)b c: (int)c d: (NSString *)d
{
static qt_QString * _qstring_d = 0L;
	return (QPixmap*) [QtSupport objectForQtKey: kde_KDEDesktopMimeType_pixmap1((kde_KDEDesktopMimeType *)[self qt], (int)a, (int)b, (int)c, (qt_QString*) [d toQString: &_qstring_d]) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

//+ (long) runFSDevice: (KURL*)_url cfg: (KSimpleConfig*)cfg
//{
//	return (long) kde_KDEDesktopMimeType_runFSDevice((kde_KURL*) [_url qt], (kde_KSimpleConfig*) [cfg qt]);
//}

//+ (long) runApplication: (KURL*)_url _serviceFile: (NSString *)_serviceFile
//{
//static qt_QString * _qstring__serviceFile = 0L;
//	return (long) kde_KDEDesktopMimeType_runApplication((kde_KURL*) [_url qt], (qt_QString *) [_serviceFile toQString: &_qstring__serviceFile]);
//}

//+ (long) runLink: (KURL*)_url cfg: (KSimpleConfig*)cfg
//{
//	return (long) kde_KDEDesktopMimeType_runLink((kde_KURL*) [_url qt], (kde_KSimpleConfig*) [cfg qt]);
//}

//+ (long) runMimeType: (KURL*)_url cfg: (KSimpleConfig*)cfg
//{
//	return (long) kde_KDEDesktopMimeType_runMimeType((kde_KURL*) [_url qt], (kde_KSimpleConfig*) [cfg qt]);
//}

+ (int) ST_MOUNT
{
	return (int) KDEDESKTOPMIMETYPE_ST_MOUNT;
}

+ (int) ST_UNMOUNT
{
	return (int) KDEDESKTOPMIMETYPE_ST_UNMOUNT;
}

+ (int) ST_USER_DEFINED
{
	return (int) KDEDESKTOPMIMETYPE_ST_USER_DEFINED;
}

@end
