/***************************************************************************
                            QFontDatabase.m -  description
                             -------------------
    begin                : Wed Nov 21 12:08:37 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 12:08:37 2001, 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 <qtc/qt_QFontDatabase.h>
#include <qtobjc/QFontDatabase.h>
#include <qtobjc/QFont.h>

@implementation  QFontDatabase

- (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: qt_new_QFontDatabase()];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (NSArray *) families
{
static qt_QStringList * _qlist = 0L;
	_qlist = qt_QFontDatabase_families((qt_QFontDatabase *)[self qt]);
	return (NSArray *) [NSMutableArray arrayWithQStringList: _qlist];
}

- (NSArray *) styles: (NSString *)arg1
{
static qt_QStringList * _qlist = 0L;
static qt_QString * _qstring_arg1 = 0L;
	_qlist = qt_QFontDatabase_styles((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1]);
	return (NSArray *) [NSMutableArray arrayWithQStringList: _qlist];
}

- (NSString *) styleString: (QFont *)arg1
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QFontDatabase_styleString((qt_QFontDatabase *)[self qt], (qt_QFont *) [arg1 qt]);
	return [NSString fromQString: _qstring];
}

- (QFont*) font: (NSString *)arg1 string: (NSString *)arg2 int: (int)arg3
{
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (QFont*) [QtSupport objectForQtKey: qt_QFontDatabase_font((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2], (int)arg3) withClass: [QFont class] allocatedInObjcWorld: YES];
}

- (BOOL) isBitmapScalable: (NSString *)arg1 string: (NSString *)arg2
{
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_isBitmapScalable((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2]);
}

- (BOOL) isBitmapScalable: (NSString *)arg1 
{
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_isBitmapScalable((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], qt_QString_null());
}

- (BOOL) isSmoothlyScalable: (NSString *)arg1 string: (NSString *)arg2
{
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_isSmoothlyScalable((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2]);
}

- (BOOL) isSmoothlyScalable: (NSString *)arg1 
{
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_isSmoothlyScalable((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], qt_QString_null());
}

- (BOOL) isScalable: (NSString *)arg1 string: (NSString *)arg2
{
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_isScalable((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2]);
}

- (BOOL) isScalable: (NSString *)arg1 
{
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_isScalable((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], qt_QString_null());
}

- (BOOL) isFixedPitch: (NSString *)arg1 string: (NSString *)arg2
{
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_isFixedPitch((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2]);
}

- (BOOL) isFixedPitch: (NSString *)arg1 
{
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_isFixedPitch((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], qt_QString_null());
}

- (BOOL) italic: (NSString *)arg1 string: (NSString *)arg2
{
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_italic((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2]);
}

- (BOOL) bold: (NSString *)arg1 string: (NSString *)arg2
{
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_bold((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2]);
}

- (int) weight: (NSString *)arg1 string: (NSString *)arg2
{
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (int) qt_QFontDatabase_weight((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2]);
}

- (NSArray *) families: (BOOL)arg1
{
static qt_QStringList * _qlist = 0L;
	_qlist = qt_QFontDatabase_families1((qt_QFontDatabase *)[self qt], (int)arg1);
	return (NSArray *) [NSMutableArray arrayWithQStringList: _qlist];
}

- (NSArray *) styles: (NSString *)arg1 string: (NSString *)arg2
{
static qt_QStringList * _qlist = 0L;
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	_qlist = qt_QFontDatabase_styles1((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2]);
	return (NSArray *) [NSMutableArray arrayWithQStringList: _qlist];
}

- (QFont*) font: (NSString *)arg1 string: (NSString *)arg2 int: (int)arg3 string: (NSString *)arg4
{
static qt_QString * _qstring_arg4 = 0L;
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (QFont*) [QtSupport objectForQtKey: qt_QFontDatabase_font1((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2], (int)arg3, (qt_QString *) [arg4 toQString: &_qstring_arg4]) withClass: [QFont class] allocatedInObjcWorld: YES];
}

- (BOOL) isBitmapScalable: (NSString *)arg1 string: (NSString *)arg2 string: (NSString *)arg3
{
static qt_QString * _qstring_arg3 = 0L;
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_isBitmapScalable1((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2], (qt_QString *) [arg3 toQString: &_qstring_arg3]);
}

- (BOOL) isSmoothlyScalable: (NSString *)arg1 string: (NSString *)arg2 string: (NSString *)arg3
{
static qt_QString * _qstring_arg3 = 0L;
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_isSmoothlyScalable1((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2], (qt_QString *) [arg3 toQString: &_qstring_arg3]);
}

- (BOOL) isScalable: (NSString *)arg1 string: (NSString *)arg2 string: (NSString *)arg3
{
static qt_QString * _qstring_arg3 = 0L;
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_isScalable1((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2], (qt_QString *) [arg3 toQString: &_qstring_arg3]);
}

- (BOOL) isFixedPitch: (NSString *)arg1 string: (NSString *)arg2 string: (NSString *)arg3
{
static qt_QString * _qstring_arg3 = 0L;
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_isFixedPitch1((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2], (qt_QString *) [arg3 toQString: &_qstring_arg3]);
}

- (BOOL) italic: (NSString *)arg1 string: (NSString *)arg2 string: (NSString *)arg3
{
static qt_QString * _qstring_arg3 = 0L;
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_italic1((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2], (qt_QString *) [arg3 toQString: &_qstring_arg3]);
}

- (BOOL) bold: (NSString *)arg1 string: (NSString *)arg2 string: (NSString *)arg3
{
static qt_QString * _qstring_arg3 = 0L;
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) qt_QFontDatabase_bold1((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2], (qt_QString *) [arg3 toQString: &_qstring_arg3]);
}

- (int) weight: (NSString *)arg1 string: (NSString *)arg2 string: (NSString *)arg3
{
static qt_QString * _qstring_arg3 = 0L;
static qt_QString * _qstring_arg2 = 0L;
static qt_QString * _qstring_arg1 = 0L;
	return (int) qt_QFontDatabase_weight1((qt_QFontDatabase *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QString *) [arg2 toQString: &_qstring_arg2], (qt_QString *) [arg3 toQString: &_qstring_arg3]);
}

+ (NSString *) scriptName: (int)arg1
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QFontDatabase_scriptName((int)arg1);
	return [NSString fromQString: _qstring];
}

+ (NSString *) scriptSample: (int)arg1
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QFontDatabase_scriptSample((int)arg1);
	return [NSString fromQString: _qstring];
}

//+ qwsAddDiskFont: (QDiskFont*)qdf
//{
//	qt_QFontDatabase_qwsAddDiskFont((qt_QDiskFont*) [qdf qt]);
//	return self;
//}

@end
