/***************************************************************************
                            QColorGroup.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_QColorGroup.h>
#include <qtobjc/QColorGroup.h>

@implementation  QColorGroup

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

- initWithColor: (QColor *)foreground button: (QColor *)button light: (QColor *)light dark: (QColor *)dark mid: (QColor *)mid text: (QColor *)text base: (QColor *)base
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QColorGroup1((qt_QColor *) [foreground qt], (qt_QColor *) [button qt], (qt_QColor *) [light qt], (qt_QColor *) [dark qt], (qt_QColor *) [mid qt], (qt_QColor *) [text qt], (qt_QColor *) [base qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithBrush: (QBrush *)foreground button: (QBrush *)button light: (QBrush *)light dark: (QBrush *)dark mid: (QBrush *)mid text: (QBrush *)text bright_text: (QBrush *)bright_text base: (QBrush *)base background: (QBrush *)background
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QColorGroup2((qt_QBrush *) [foreground qt], (qt_QBrush *) [button qt], (qt_QBrush *) [light qt], (qt_QBrush *) [dark qt], (qt_QBrush *) [mid qt], (qt_QBrush *) [text qt], (qt_QBrush *) [bright_text qt], (qt_QBrush *) [base qt], (qt_QBrush *) [background qt])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- copyWithZone: (NSZone *) zone
{
	QColorGroup * aCopy;
	aCopy = [[(QColorGroup *)[[self class] allocWithZone: zone] setQt: qt_new_QColorGroup3([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_QColorGroup((qt_QColorGroup *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (QColor*) color: (int)arg1
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_color((qt_QColorGroup *)[self qt], (int)arg1) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QBrush*) brush: (int)arg1
{
	return (QBrush*) [QtSupport objectForQtKey: qt_QColorGroup_brush((qt_QColorGroup *)[self qt], (int)arg1) withClass: [QBrush class] allocatedInObjcWorld: YES];
}

- setColor: (int)arg1 color: (QColor *)arg2
{
	qt_QColorGroup_setColor((qt_QColorGroup *)[self qt], (int)arg1, (qt_QColor *) [arg2 qt]);
	return self;
}

- setBrush: (int)arg1 brush: (QBrush *)arg2
{
	qt_QColorGroup_setBrush((qt_QColorGroup *)[self qt], (int)arg1, (qt_QBrush *) [arg2 qt]);
	return self;
}

- (QColor*) foreground
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_foreground((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) button
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_button((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) light
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_light((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) dark
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_dark((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) mid
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_mid((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) text
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_text((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) base
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_base((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) background
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_background((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) midlight
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_midlight((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) brightText
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_brightText((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) buttonText
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_buttonText((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) shadow
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_shadow((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) highlight
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_highlight((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) highlightedText
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_highlightedText((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) link
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_link((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

- (QColor*) linkVisited
{
	return (QColor*) [QtSupport objectForQtKey: qt_QColorGroup_linkVisited((qt_QColorGroup *)[self qt]) withClass: [QColor class] allocatedInObjcWorld: YES];
}

+ (int) Foreground
{
	return (int) QCOLORGROUP_Foreground;
}

+ (int) Button
{
	return (int) QCOLORGROUP_Button;
}

+ (int) Light
{
	return (int) QCOLORGROUP_Light;
}

+ (int) Midlight
{
	return (int) QCOLORGROUP_Midlight;
}

+ (int) Dark
{
	return (int) QCOLORGROUP_Dark;
}

+ (int) Mid
{
	return (int) QCOLORGROUP_Mid;
}

+ (int) Text
{
	return (int) QCOLORGROUP_Text;
}

+ (int) BrightText
{
	return (int) QCOLORGROUP_BrightText;
}

+ (int) ButtonText
{
	return (int) QCOLORGROUP_ButtonText;
}

+ (int) Base
{
	return (int) QCOLORGROUP_Base;
}

+ (int) Background
{
	return (int) QCOLORGROUP_Background;
}

+ (int) Shadow
{
	return (int) QCOLORGROUP_Shadow;
}

+ (int) Highlight
{
	return (int) QCOLORGROUP_Highlight;
}

+ (int) HighlightedText
{
	return (int) QCOLORGROUP_HighlightedText;
}

+ (int) Link
{
	return (int) QCOLORGROUP_Link;
}

+ (int) LinkVisited
{
	return (int) QCOLORGROUP_LinkVisited;
}

+ (int) NColorRoles
{
	return (int) QCOLORGROUP_NColorRoles;
}

@end
