/***************************************************************************
                            QFontInfo.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_QFontInfo.h>
#include <qtobjc/QFontInfo.h>
#include <qtobjc/QFont.h>


@implementation  QFontInfo

- (void *) qt
{
	return _qt;
}

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

- (BOOL) allocatedInObjcWorld
{
	return _allocatedInObjcWorld;
}

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


- initWithFont: (QFont *)arg1
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QFontInfo((qt_QFont *) [arg1 qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- copyWithZone: (NSZone *) zone
{
	QFontInfo * aCopy;
	aCopy = [[(QFontInfo *)[[self class] allocWithZone: zone] setQt: qt_new_QFontInfo1([self qt])] init];
	[aCopy setAllocatedInObjcWorld: YES];
	[QtSupport setObject: aCopy forQtKey: [aCopy qt]];
	return aCopy;
}

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

- (NSString *) family
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QFontInfo_family((qt_QFontInfo *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (int) pixelSize
{
	return (int) qt_QFontInfo_pixelSize((qt_QFontInfo *)[self qt]);
}

- (int) pointSize
{
	return (int) qt_QFontInfo_pointSize((qt_QFontInfo *)[self qt]);
}

- (BOOL) italic
{
	return (BOOL) qt_QFontInfo_italic((qt_QFontInfo *)[self qt]);
}

- (int) weight
{
	return (int) qt_QFontInfo_weight((qt_QFontInfo *)[self qt]);
}

- (BOOL) bold
{
	return (BOOL) qt_QFontInfo_bold((qt_QFontInfo *)[self qt]);
}

- (BOOL) underline
{
	return (BOOL) qt_QFontInfo_underline((qt_QFontInfo *)[self qt]);
}

- (BOOL) strikeOut
{
	return (BOOL) qt_QFontInfo_strikeOut((qt_QFontInfo *)[self qt]);
}

- (BOOL) fixedPitch
{
	return (BOOL) qt_QFontInfo_fixedPitch((qt_QFontInfo *)[self qt]);
}

- (int) styleHint
{
	return (int) qt_QFontInfo_styleHint((qt_QFontInfo *)[self qt]);
}

- (BOOL) rawMode
{
	return (BOOL) qt_QFontInfo_rawMode((qt_QFontInfo *)[self qt]);
}

- (BOOL) exactMatch
{
	return (BOOL) qt_QFontInfo_exactMatch((qt_QFontInfo *)[self qt]);
}

@end
