/***************************************************************************
                            KImageIO.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_KImageIO.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KImageIO.h>

@implementation  KImageIO

- (void *) qt
{
	return _qt;
}

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

- (BOOL) allocatedInObjcWorld
{
	return _allocatedInObjcWorld;
}

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


+ registerFormats
{
	kde_KImageIO_registerFormats();
	return self;
}

+ (BOOL) canWrite: (NSString *)type
{
static qt_QString * _qstring_type = 0L;
	return (BOOL) kde_KImageIO_canWrite((qt_QString *) [type toQString: &_qstring_type]);
}

+ (BOOL) canRead: (NSString *)type
{
static qt_QString * _qstring_type = 0L;
	return (BOOL) kde_KImageIO_canRead((qt_QString *) [type toQString: &_qstring_type]);
}

+ (NSArray *) types: (int)mode
{
static qt_QStringList * _qlist = 0L;
	_qlist = kde_KImageIO_types((int)mode);
	return (NSArray *) [NSMutableArray arrayWithQStringList: _qlist];
}

+ (NSString *) pattern: (int)mode
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KImageIO_pattern((int)mode);
	return [NSString fromQString: _qstring];
}

+ (NSString *) suffix: (NSString *)type
{
static qt_QString * _qstring = 0L;
static qt_QString * _qstring_type = 0L;
	_qstring = kde_KImageIO_suffix((qt_QString *) [type toQString: &_qstring_type]);
	return [NSString fromQString: _qstring];
}

+ (NSString *) type: (NSString *)filename
{
static qt_QString * _qstring = 0L;
static qt_QString * _qstring_filename = 0L;
	_qstring = kde_KImageIO_type((qt_QString *) [filename toQString: &_qstring_filename]);
	return [NSString fromQString: _qstring];
}

+ (NSArray *) mimeTypes: (int)_mode
{
static qt_QStringList * _qlist = 0L;
	_qlist = kde_KImageIO_mimeTypes((int)_mode);
	return (NSArray *) [NSMutableArray arrayWithQStringList: _qlist];
}

+ (BOOL) isSupported: (NSString *)_mimeType _mode: (int)_mode
{
static qt_QString * _qstring__mimeType = 0L;
	return (BOOL) kde_KImageIO_isSupported((qt_QString *) [_mimeType toQString: &_qstring__mimeType], (int)_mode);
}

+ (BOOL) isSupported: (NSString *)_mimeType 
{
static qt_QString * _qstring__mimeType = 0L;
	return (BOOL) kde_KImageIO_isSupported((qt_QString *) [_mimeType toQString: &_qstring__mimeType], [KImageIO Writing]);
}

+ (NSString *) mimeType: (NSString *)_filename
{
static qt_QString * _qstring = 0L;
static qt_QString * _qstring__filename = 0L;
	_qstring = kde_KImageIO_mimeType((qt_QString *) [_filename toQString: &_qstring__filename]);
	return [NSString fromQString: _qstring];
}

+ (int) Reading
{
	return (int) KIMAGEIO_Reading;
}

+ (int) Writing
{
	return (int) KIMAGEIO_Writing;
}

@end
