/***************************************************************************
                            KGlobal.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_KGlobal.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KGlobal.h>
#include <kdeobjc/KInstance.h>

#include <kdeobjc/KStaticDeleterBase.h>


@implementation  KGlobal

- (void *) qt
{
	return _qt;
}

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

- (BOOL) allocatedInObjcWorld
{
	return _allocatedInObjcWorld;
}

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


+ (KInstance*) instance
{
	return (KInstance*) [QtSupport objectForQtKey: kde_KGlobal_instance() withClass: [KInstance class] allocatedInObjcWorld: YES];
}

+ (KStandardDirs*) dirs
{
	return (KStandardDirs*) [QtSupport objectForQtKey: kde_KGlobal_dirs() withClass: [KStandardDirs class] allocatedInObjcWorld: YES];
}

+ (KConfig*) config
{
	return (KConfig*) [QtSupport objectForQtKey: kde_KGlobal_config() withClass: [KConfig class] allocatedInObjcWorld: YES];
}

+ (KIconLoader*) iconLoader
{
	return (KIconLoader*) [QtSupport objectForQtKey: kde_KGlobal_iconLoader() withClass: [KIconLoader class] allocatedInObjcWorld: YES];
}

+ (KLocale*) locale
{
	return (KLocale*) [QtSupport objectForQtKey: kde_KGlobal_locale() withClass: [KLocale class] allocatedInObjcWorld: YES];
}

+ (KCharsets*) charsets
{
	return (KCharsets*) [QtSupport objectForQtKey: kde_KGlobal_charsets() withClass: [KCharsets class] allocatedInObjcWorld: YES];
}

//+ (NSString *) staticQString: (NSString *)arg1
//{
//static qt_QString * _qstring = 0L;
//	_qstring = kde_KGlobal_staticQString((char*) [arg1 cString]);
//	return [NSString fromQString: _qstring];
//}

+ (NSString *) staticQString: (NSString *)arg1
{
static qt_QString * _qstring = 0L;
static qt_QString * _qstring_arg1 = 0L;
	_qstring = kde_KGlobal_staticQString1((qt_QString *) [arg1 toQString: &_qstring_arg1]);
	return [NSString fromQString: _qstring];
}

+ registerStaticDeleter: (KStaticDeleterBase*)arg1
{
	kde_KGlobal_registerStaticDeleter((kde_KStaticDeleterBase*) [arg1 qt]);
	return self;
}

+ unregisterStaticDeleter: (KStaticDeleterBase*)arg1
{
	kde_KGlobal_unregisterStaticDeleter((kde_KStaticDeleterBase*) [arg1 qt]);
	return self;
}

+ deleteStaticDeleters
{
	kde_KGlobal_deleteStaticDeleters();
	return self;
}

+ setActiveInstance: (KInstance*)d
{
	kde_KGlobal_setActiveInstance((kde_KInstance*) [d qt]);
	return self;
}

+ (KInstance*) activeInstance
{
	return (KInstance*) [QtSupport objectForQtKey: kde_KGlobal_activeInstance() withClass: [KInstance class] allocatedInObjcWorld: YES];
}

@end
