/***************************************************************************
                            QLabel.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_QLabel.h>
#include <qtobjc/QLabel.h>
#include <qtobjc/QFont.h>
#include <qtobjc/QPicture.h>

#include <qtobjc/QPainter.h>
#include <qtobjc/QMovie.h>

@implementation  QLabel


- initWithWidget: (QWidget *)parent name: (NSString *)name f: (int)f
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QLabel((qt_QWidget *) [parent qt], (char*) [name cString], (int)f)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithWidget: (QWidget *)parent 
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QLabel((qt_QWidget *) [parent qt], 0, 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithText: (NSString *)text parent: (QWidget *)parent name: (NSString *)name f: (int)f
{
static qt_QString * _qstring_text = 0L;
	if ([self qt] == 0L) {
		[self setQt: qt_new_QLabel1((qt_QString *) [text toQString: &_qstring_text], (qt_QWidget *) [parent qt], (char*) [name cString], (int)f)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithText: (NSString *)text parent: (QWidget *)parent 
{
static qt_QString * _qstring_text = 0L;
	if ([self qt] == 0L) {
		[self setQt: qt_new_QLabel1((qt_QString *) [text toQString: &_qstring_text], (qt_QWidget *) [parent qt], 0, 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithWidget: (QWidget *)buddy string: (NSString *)arg1 parent: (QWidget *)parent name: (NSString *)name f: (int)f
{
static qt_QString * _qstring_arg1 = 0L;
	if ([self qt] == 0L) {
		[self setQt: qt_new_QLabel2((qt_QWidget *) [buddy qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QWidget *) [parent qt], (char*) [name cString], (int)f)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithWidget: (QWidget *)buddy string: (NSString *)arg1 parent: (QWidget *)parent 
{
static qt_QString * _qstring_arg1 = 0L;
	if ([self qt] == 0L) {
		[self setQt: qt_new_QLabel2((qt_QWidget *) [buddy qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (qt_QWidget *) [parent qt], 0, 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld] && [self parentWidget: YES] == nil) {
			qt_del_QLabel((qt_QLabel *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (NSString *) text
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QLabel_text((qt_QLabel *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (QPixmap*) pixmap
{
	return (QPixmap*) [QtSupport objectForQtKey: qt_QLabel_pixmap((qt_QLabel *)[self qt]) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

- (QPicture*) picture
{
	return (QPicture*) [QtSupport objectForQtKey: qt_QLabel_picture((qt_QLabel *)[self qt]) withClass: [QPicture class] allocatedInObjcWorld: YES];
}

- (QMovie*) movie
{
	return (QMovie*) [QtSupport objectForQtKey: qt_QLabel_movie((qt_QLabel *)[self qt]) withClass: [QMovie class] allocatedInObjcWorld: YES];
}

- (int) textFormat
{
	return (int) qt_QLabel_textFormat((qt_QLabel *)[self qt]);
}

- setTextFormat: (int)arg1
{
	qt_QLabel_setTextFormat((qt_QLabel *)[self qt], (int)arg1);
	return self;
}

- (int) alignment
{
	return (int) qt_QLabel_alignment((qt_QLabel *)[self qt]);
}

- setAlignment: (int)arg1
{
	qt_QLabel_setAlignment((qt_QLabel *)[self qt], (int)arg1);
	return self;
}

- (int) indent
{
	return (int) qt_QLabel_indent((qt_QLabel *)[self qt]);
}

- setIndent: (int)arg1
{
	qt_QLabel_setIndent((qt_QLabel *)[self qt], (int)arg1);
	return self;
}

- (BOOL) autoResize
{
	return (BOOL) qt_QLabel_autoResize((qt_QLabel *)[self qt]);
}

- setAutoResize: (BOOL)arg1
{
	qt_QLabel_setAutoResize((qt_QLabel *)[self qt], (int)arg1);
	return self;
}

- (BOOL) hasScaledContents
{
	return (BOOL) qt_QLabel_hasScaledContents((qt_QLabel *)[self qt]);
}

- setScaledContents: (BOOL)arg1
{
	qt_QLabel_setScaledContents((qt_QLabel *)[self qt], (int)arg1);
	return self;
}

- (QSize*) sizeHint
{
	return (QSize*) [QtSupport objectForQtKey: qt_QLabel_sizeHint((qt_QLabel *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (QSize*) minimumSizeHint
{
	return (QSize*) [QtSupport objectForQtKey: qt_QLabel_minimumSizeHint((qt_QLabel *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- setBuddy: (QWidget *)arg1
{
	qt_QLabel_setBuddy((qt_QLabel *)[self qt], (qt_QWidget *) [arg1 qt]);
	return self;
}

- (QWidget*) buddy
{
	return (QWidget*) [QtSupport objectForQtKey: qt_QLabel_buddy((qt_QLabel *)[self qt]) withClass: [QWidget class] allocatedInObjcWorld: YES];
}

- (int) heightForWidth: (int)arg1
{
	return (int) qt_QLabel_heightForWidth((qt_QLabel *)[self qt], (int)arg1);
}

- setFont: (QFont *)f
{
	qt_QLabel_setFont((qt_QLabel *)[self qt], (qt_QFont *) [f qt]);
	return self;
}

- setText: (NSString *)arg1
{
static qt_QString * _qstring_arg1 = 0L;
	qt_QLabel_setText((qt_QLabel *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1]);
	return self;
}

- setPixmap: (QPixmap *)arg1
{
	qt_QLabel_setPixmap((qt_QLabel *)[self qt], (qt_QPixmap *) [arg1 qt]);
	return self;
}

- setPicture: (QPicture *)arg1
{
	qt_QLabel_setPicture((qt_QLabel *)[self qt], (qt_QPicture *) [arg1 qt]);
	return self;
}

- setMovie: (QMovie *)arg1
{
	qt_QLabel_setMovie((qt_QLabel *)[self qt], (qt_QMovie *) [arg1 qt]);
	return self;
}

- setIntNum: (int)arg1
{
	qt_QLabel_setNum((qt_QLabel *)[self qt], (int)arg1);
	return self;
}

- setDoubleNum: (double)arg1
{
	qt_QLabel_setNum1((qt_QLabel *)[self qt], (double)arg1);
	return self;
}

- clear
{
	qt_QLabel_clear((qt_QLabel *)[self qt]);
	return self;
}

- drawContents: (QPainter *)arg1
{
	qt_QLabel_drawContents((qt_QLabel *)[self qt], (qt_QPainter *) [arg1 qt]);
	return self;
}

- fontChange: (QFont *)arg1
{
	qt_QLabel_fontChange((qt_QLabel *)[self qt], (qt_QFont *) [arg1 qt]);
	return self;
}

@end
