/***************************************************************************
                            KPopupTitle.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_KPopupTitle.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KPopupTitle.h>
#include <kdeobjc/KPixmap.h>
#include <qtobjc/QPixmap.h>


@implementation  KPopupTitle


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

- init
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KPopupTitle(0, 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithInt: (int)gradient color: (QColor *)color textColor: (QColor *)textColor parent: (QWidget *)parent name: (NSString *)name
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KPopupTitle1((int)gradient, (qt_QColor *) [color qt], (qt_QColor *) [textColor qt], (qt_QWidget *) [parent qt], (char*) [name cString])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithInt: (int)gradient color: (QColor *)color textColor: (QColor *)textColor 
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KPopupTitle1((int)gradient, (qt_QColor *) [color qt], (qt_QColor *) [textColor qt], 0, 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithPixmap: (KPixmap*)background color: (QColor *)color textColor: (QColor *)textColor parent: (QWidget *)parent name: (NSString *)name
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KPopupTitle2((kde_KPixmap*) [background qt], (qt_QColor *) [color qt], (qt_QColor *) [textColor qt], (qt_QWidget *) [parent qt], (char*) [name cString])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithPixmap: (KPixmap*)background color: (QColor *)color textColor: (QColor *)textColor 
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KPopupTitle2((kde_KPixmap*) [background qt], (qt_QColor *) [color qt], (qt_QColor *) [textColor qt], 0, 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- setTitle: (NSString *)text icon: (QPixmap *)icon
{
static qt_QString * _qstring_text = 0L;
	kde_KPopupTitle_setTitle((kde_KPopupTitle *)[self qt], (qt_QString *) [text toQString: &_qstring_text], (qt_QPixmap *) [icon qt]);
	return self;
}

- setTitle: (NSString *)text 
{
static qt_QString * _qstring_text = 0L;
	kde_KPopupTitle_setTitle((kde_KPopupTitle *)[self qt], (qt_QString *) [text toQString: &_qstring_text], 0);
	return self;
}

- (NSString *) title
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KPopupTitle_title((kde_KPopupTitle *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (QPixmap*) icon
{
	return (QPixmap*) [QtSupport objectForQtKey: kde_KPopupTitle_icon((kde_KPopupTitle *)[self qt]) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

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

@end
