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

@implementation  KAboutData

- (void *) qt
{
	return _qt;
}

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

- (BOOL) allocatedInObjcWorld
{
	return _allocatedInObjcWorld;
}

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


- initWithText: (NSString *)appName programName: (NSString *)programName version: (NSString *)version shortDescription: (NSString *)shortDescription licenseType: (int)licenseType copyrightStatement: (NSString *)copyrightStatement text: (NSString *)text homePageAddress: (NSString *)homePageAddress bugsEmailAddress: (NSString *)bugsEmailAddress
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KAboutData((char*) [appName cString], (char*) [programName cString], (char*) [version cString], (char*) [shortDescription cString], (int)licenseType, (char*) [copyrightStatement cString], (char*) [text cString], (char*) [homePageAddress cString], (char*) [bugsEmailAddress cString])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithText: (NSString *)appName programName: (NSString *)programName version: (NSString *)version 
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KAboutData((char*) [appName cString], (char*) [programName cString], (char*) [version cString], 0, [KAboutData License_Unknown], 0, 0, 0, "submit@bugs.kde.org")];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld]) {
			kde_del_KAboutData((kde_KAboutData *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- addAuthor: (NSString *)name task: (NSString *)task emailAddress: (NSString *)emailAddress webAddress: (NSString *)webAddress
{
	kde_KAboutData_addAuthor((kde_KAboutData *)[self qt], (char*) [name cString], (char*) [task cString], (char*) [emailAddress cString], (char*) [webAddress cString]);
	return self;
}

- addAuthor: (NSString *)name 
{
	kde_KAboutData_addAuthor((kde_KAboutData *)[self qt], (char*) [name cString], 0, 0, 0);
	return self;
}

- addCredit: (NSString *)name task: (NSString *)task emailAddress: (NSString *)emailAddress webAddress: (NSString *)webAddress
{
	kde_KAboutData_addCredit((kde_KAboutData *)[self qt], (char*) [name cString], (char*) [task cString], (char*) [emailAddress cString], (char*) [webAddress cString]);
	return self;
}

- addCredit: (NSString *)name 
{
	kde_KAboutData_addCredit((kde_KAboutData *)[self qt], (char*) [name cString], 0, 0, 0);
	return self;
}

- setTranslator: (NSString *)name emailAddress: (NSString *)emailAddress
{
	kde_KAboutData_setTranslator((kde_KAboutData *)[self qt], (char*) [name cString], (char*) [emailAddress cString]);
	return self;
}

- setLicenseText: (NSString *)license
{
	kde_KAboutData_setLicenseText((kde_KAboutData *)[self qt], (char*) [license cString]);
	return self;
}

- setLicenseTextFile: (NSString *)file
{
static qt_QString * _qstring_file = 0L;
	kde_KAboutData_setLicenseTextFile((kde_KAboutData *)[self qt], (qt_QString *) [file toQString: &_qstring_file]);
	return self;
}

- (NSString *) appName
{
	return (NSString *) [NSString stringWithCString: kde_KAboutData_appName((kde_KAboutData *)[self qt])];
}

- (NSString *) programName
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KAboutData_programName((kde_KAboutData *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (NSString *) version
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KAboutData_version((kde_KAboutData *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (NSString *) shortDescription
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KAboutData_shortDescription((kde_KAboutData *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (NSString *) homepage
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KAboutData_homepage((kde_KAboutData *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (NSString *) bugAddress
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KAboutData_bugAddress((kde_KAboutData *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (NSString *) otherText
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KAboutData_otherText((kde_KAboutData *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (NSString *) license
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KAboutData_license((kde_KAboutData *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (NSString *) copyrightStatement
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KAboutData_copyrightStatement((kde_KAboutData *)[self qt]);
	return [NSString fromQString: _qstring];
}

+ (NSString *) aboutTranslationTeam
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KAboutData_aboutTranslationTeam();
	return [NSString fromQString: _qstring];
}

+ (int) License_Custom
{
	return (int) KABOUTDATA_License_Custom;
}

+ (int) License_File
{
	return (int) KABOUTDATA_License_File;
}

+ (int) License_Unknown
{
	return (int) KABOUTDATA_License_Unknown;
}

+ (int) License_GPL
{
	return (int) KABOUTDATA_License_GPL;
}

+ (int) License_GPL_V2
{
	return (int) KABOUTDATA_License_GPL_V2;
}

+ (int) License_LGPL
{
	return (int) KABOUTDATA_License_LGPL;
}

+ (int) License_LGPL_V2
{
	return (int) KABOUTDATA_License_LGPL_V2;
}

+ (int) License_BSD
{
	return (int) KABOUTDATA_License_BSD;
}

+ (int) License_Artistic
{
	return (int) KABOUTDATA_License_Artistic;
}

+ (int) License_QPL
{
	return (int) KABOUTDATA_License_QPL;
}

+ (int) License_QPL_V1_0
{
	return (int) KABOUTDATA_License_QPL_V1_0;
}

@end
