/***************************************************************************
                            KURLLabel.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_KURLLabel.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KURLLabel.h>
#include <qtobjc/QCursor.h>
#include <qtobjc/QFont.h>
#include <qtobjc/QPixmap.h>


@implementation  KURLLabel


- initWithWidget: (QWidget *)parent name: (NSString *)name
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KURLLabel((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_KURLLabel(0L, 0L)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

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

- initWithText: (NSString *)url 
{
static qt_QString * _qstring_url = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_KURLLabel1((qt_QString *) [url toQString: &_qstring_url], qt_QString_null(), 0L, 0L)];
		[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) {
			kde_del_KURLLabel((kde_KURLLabel *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (NSString *) url
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KURLLabel_url((kde_KURLLabel *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (NSString *) tipText
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KURLLabel_tipText((kde_KURLLabel *)[self qt]);
	return [NSString fromQString: _qstring];
}

- (BOOL) useTips
{
	return (BOOL) kde_KURLLabel_useTips((kde_KURLLabel *)[self qt]);
}

- (BOOL) useCursor
{
	return (BOOL) kde_KURLLabel_useCursor((kde_KURLLabel *)[self qt]);
}

- (BOOL) isGlowEnabled
{
	return (BOOL) kde_KURLLabel_isGlowEnabled((kde_KURLLabel *)[self qt]);
}

- (BOOL) isFloatEnabled
{
	return (BOOL) kde_KURLLabel_isFloatEnabled((kde_KURLLabel *)[self qt]);
}

- (QPixmap*) altPixmap
{
	return (QPixmap*) [QtSupport objectForQtKey: kde_KURLLabel_altPixmap((kde_KURLLabel *)[self qt]) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

- setUnderline: (BOOL)on
{
	kde_KURLLabel_setUnderline((kde_KURLLabel *)[self qt], (int)on);
	return self;
}

- setUnderline
{
	kde_KURLLabel_setUnderline((kde_KURLLabel *)[self qt], 1);
	return self;
}

- setURL: (NSString *)url
{
static qt_QString * _qstring_url = 0L;
	kde_KURLLabel_setURL((kde_KURLLabel *)[self qt], (qt_QString *) [url toQString: &_qstring_url]);
	return self;
}

- setFont: (QFont *)arg1
{
	kde_KURLLabel_setFont((kde_KURLLabel *)[self qt], (qt_QFont *) [arg1 qt]);
	return self;
}

- setUseTips: (BOOL)on
{
	kde_KURLLabel_setUseTips((kde_KURLLabel *)[self qt], (int)on);
	return self;
}

- setUseTips
{
	kde_KURLLabel_setUseTips((kde_KURLLabel *)[self qt], 1);
	return self;
}

- setTipText: (NSString *)tip
{
static qt_QString * _qstring_tip = 0L;
	kde_KURLLabel_setTipText((kde_KURLLabel *)[self qt], (qt_QString *) [tip toQString: &_qstring_tip]);
	return self;
}

- setHighlightedColor: (QColor *)highcolor
{
	kde_KURLLabel_setHighlightedColor((kde_KURLLabel *)[self qt], (qt_QColor *) [highcolor qt]);
	return self;
}

- setHighlightedColorWithName: (NSString *)highcolor
{
static qt_QString * _qstring_highcolor = 0L;
	kde_KURLLabel_setHighlightedColor1((kde_KURLLabel *)[self qt], (qt_QString *) [highcolor toQString: &_qstring_highcolor]);
	return self;
}

- setSelectedColor: (QColor *)selcolor
{
	kde_KURLLabel_setSelectedColor((kde_KURLLabel *)[self qt], (qt_QColor *) [selcolor qt]);
	return self;
}

- setSelectedColorWithName: (NSString *)selcolor
{
static qt_QString * _qstring_selcolor = 0L;
	kde_KURLLabel_setSelectedColor1((kde_KURLLabel *)[self qt], (qt_QString *) [selcolor toQString: &_qstring_selcolor]);
	return self;
}

- setUseCursor: (BOOL)on cursor: (QCursor *)cursor
{
	kde_KURLLabel_setUseCursor((kde_KURLLabel *)[self qt], (int)on, (qt_QCursor *) [cursor qt]);
	return self;
}

- setUseCursor: (BOOL)on 
{
	kde_KURLLabel_setUseCursor((kde_KURLLabel *)[self qt], (int)on, 0L);
	return self;
}

- setGlow: (BOOL)glow
{
	kde_KURLLabel_setGlow((kde_KURLLabel *)[self qt], (int)glow);
	return self;
}

- setGlow
{
	kde_KURLLabel_setGlow((kde_KURLLabel *)[self qt], 1);
	return self;
}

- setFloat: (BOOL)do_float
{
	kde_KURLLabel_setFloat((kde_KURLLabel *)[self qt], (int)do_float);
	return self;
}

- setFloat
{
	kde_KURLLabel_setFloat((kde_KURLLabel *)[self qt], 1);
	return self;
}

- setAltPixmap: (QPixmap *)altPix
{
	kde_KURLLabel_setAltPixmap((kde_KURLLabel *)[self qt], (qt_QPixmap *) [altPix qt]);
	return self;
}

@end
