/***************************************************************************
                            QCommonStyle.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_QCommonStyle.h>

#include <qtobjc/QCommonStyle.h>
#include <qtobjc/QWidget.h>
#include <qtobjc/QPainter.h>
#include <qtobjc/QPalette.h>
#include <qtobjc/QColorGroup.h>
#include <qtobjc/QPushButton.h>
#include <qtobjc/QScrollBar.h>
#include <qtobjc/QTab.h>
#include <qtobjc/QTabBar.h>
#include <qtobjc/QPopupMenu.h>
#include <qtobjc/QFontMetrics.h>
#include <qtobjc/QPoint.h>

@implementation  QCommonStyle


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

//- (void) dealloc
//{
//	if ([self qt] != 0L) {
//		if ([self allocatedInObjcWorld] && [self parent] == nil) {
//			qt_del_QCommonStyle((qt_QCommonStyle *)[self qt]);
//		}
//		[QtSupport removeQtKey: [self qt]];
//		[self setQt: 0L];
//	}
//	[super dealloc];
//}

- drawPrimitive: (int)pe p: (QPainter *)p r: (QRect*)r cg: (QColorGroup *)cg flags: (int)flags int: (int)arg1
{
	qt_QCommonStyle_drawPrimitive((qt_QCommonStyle *)[self qt], (int)pe, (qt_QPainter *) [p qt], (qt_QRect*) [r qt], (qt_QColorGroup *) [cg qt], (int)flags, (int)arg1);
	return self;
}

- drawPrimitive: (int)pe p: (QPainter *)p r: (QRect*)r cg: (QColorGroup *)cg
{
	qt_QCommonStyle_drawPrimitive((qt_QCommonStyle *)[self qt], (int)pe, (qt_QPainter *) [p qt], (qt_QRect*) [r qt], (qt_QColorGroup *) [cg qt], [QCommonStyle Style_Default], 0);
	return self;
}

- drawControl: (int)element p: (QPainter *)p widget: (QWidget *)widget r: (QRect*)r cg: (QColorGroup *)cg how: (int)how int: (int)arg1
{
	qt_QCommonStyle_drawControl((qt_QCommonStyle *)[self qt], (int)element, (qt_QPainter *) [p qt], (qt_QWidget *) [widget qt], (qt_QRect*) [r qt], (qt_QColorGroup *) [cg qt], (int)how, (int)arg1);
	return self;
}

- drawControl: (int)element p: (QPainter *)p widget: (QWidget *)widget r: (QRect*)r cg: (QColorGroup *)cg
{
	qt_QCommonStyle_drawControl((qt_QCommonStyle *)[self qt], (int)element, (qt_QPainter *) [p qt], (qt_QWidget *) [widget qt], (qt_QRect*) [r qt], (qt_QColorGroup *) [cg qt], [QCommonStyle Style_Default], 0);
	return self;
}

- drawControlMask: (int)element p: (QPainter *)p widget: (QWidget *)widget r: (QRect*)r int: (int)arg1
{
	qt_QCommonStyle_drawControlMask((qt_QCommonStyle *)[self qt], (int)element, (qt_QPainter *) [p qt], (qt_QWidget *) [widget qt], (qt_QRect*) [r qt], (int)arg1);
	return self;
}

- drawControlMask: (int)element p: (QPainter *)p widget: (QWidget *)widget r: (QRect*)r
{
	qt_QCommonStyle_drawControlMask((qt_QCommonStyle *)[self qt], (int)element, (qt_QPainter *) [p qt], (qt_QWidget *) [widget qt], (qt_QRect*) [r qt], 0);
	return self;
}

- (QRect*) subRect: (int)r widget: (QWidget *)widget
{
	return (QRect*) [QtSupport objectForQtKey: qt_QCommonStyle_subRect((qt_QCommonStyle *)[self qt], (int)r, (qt_QWidget *) [widget qt]) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- drawComplexControl: (int)control p: (QPainter *)p widget: (QWidget *)widget r: (QRect*)r cg: (QColorGroup *)cg how: (int)how sub: (int)sub subActive: (int)subActive int: (int)arg1
{
	qt_QCommonStyle_drawComplexControl((qt_QCommonStyle *)[self qt], (int)control, (qt_QPainter *) [p qt], (qt_QWidget *) [widget qt], (qt_QRect*) [r qt], (qt_QColorGroup *) [cg qt], (int)how, (int)sub, (int)subActive, (int)arg1);
	return self;
}

- drawComplexControl: (int)control p: (QPainter *)p widget: (QWidget *)widget r: (QRect*)r cg: (QColorGroup *)cg
{
	qt_QCommonStyle_drawComplexControl((qt_QCommonStyle *)[self qt], (int)control, (qt_QPainter *) [p qt], (qt_QWidget *) [widget qt], (qt_QRect*) [r qt], (qt_QColorGroup *) [cg qt], [QCommonStyle Style_Default], [QCommonStyle SC_All], [QCommonStyle SC_None], 0);
	return self;
}

- drawComplexControlMask: (int)control p: (QPainter *)p widget: (QWidget *)widget r: (QRect*)r int: (int)arg1
{
	qt_QCommonStyle_drawComplexControlMask((qt_QCommonStyle *)[self qt], (int)control, (qt_QPainter *) [p qt], (qt_QWidget *) [widget qt], (qt_QRect*) [r qt], (int)arg1);
	return self;
}

- drawComplexControlMask: (int)control p: (QPainter *)p widget: (QWidget *)widget r: (QRect*)r
{
	qt_QCommonStyle_drawComplexControlMask((qt_QCommonStyle *)[self qt], (int)control, (qt_QPainter *) [p qt], (qt_QWidget *) [widget qt], (qt_QRect*) [r qt], 0);
	return self;
}

- (QRect*) querySubControlMetrics: (int)control widget: (QWidget *)widget sc: (int)sc int: (int)arg1
{
	return (QRect*) [QtSupport objectForQtKey: qt_QCommonStyle_querySubControlMetrics((qt_QCommonStyle *)[self qt], (int)control, (qt_QWidget *) [widget qt], (int)sc, (int)arg1) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- (QRect*) querySubControlMetrics: (int)control widget: (QWidget *)widget sc: (int)sc
{
	return (QRect*) [QtSupport objectForQtKey: qt_QCommonStyle_querySubControlMetrics((qt_QCommonStyle *)[self qt], (int)control, (qt_QWidget *) [widget qt], (int)sc, 0) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- (int) querySubControl: (int)control widget: (QWidget *)widget pos: (QPoint*)pos int: (int)arg1
{
	return (int) qt_QCommonStyle_querySubControl((qt_QCommonStyle *)[self qt], (int)control, (qt_QWidget *) [widget qt], (qt_QPoint*) [pos qt], (int)arg1);
}

- (int) querySubControl: (int)control widget: (QWidget *)widget pos: (QPoint*)pos
{
	return (int) qt_QCommonStyle_querySubControl((qt_QCommonStyle *)[self qt], (int)control, (qt_QWidget *) [widget qt], (qt_QPoint*) [pos qt], 0);
}

- (int) pixelMetric: (int)m widget: (QWidget *)widget
{
	return (int) qt_QCommonStyle_pixelMetric((qt_QCommonStyle *)[self qt], (int)m, (qt_QWidget *) [widget qt]);
}

- (int) pixelMetric: (int)m
{
	return (int) qt_QCommonStyle_pixelMetric((qt_QCommonStyle *)[self qt], (int)m, 0);
}

- (QSize*) sizeFromContents: (int)s widget: (QWidget *)widget contentsSize: (QSize *)contentsSize int: (int)arg1
{
	return (QSize*) [QtSupport objectForQtKey: qt_QCommonStyle_sizeFromContents((qt_QCommonStyle *)[self qt], (int)s, (qt_QWidget *) [widget qt], (qt_QSize *) [contentsSize qt], (int)arg1) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (QSize*) sizeFromContents: (int)s widget: (QWidget *)widget contentsSize: (QSize *)contentsSize
{
	return (QSize*) [QtSupport objectForQtKey: qt_QCommonStyle_sizeFromContents((qt_QCommonStyle *)[self qt], (int)s, (qt_QWidget *) [widget qt], (qt_QSize *) [contentsSize qt], 0) withClass: [QSize class] allocatedInObjcWorld: YES];
}

//- (int) styleHint: (int)sh widget: (QWidget *)arg1 int: (int)arg2 stylehintreturn: (QStyleHintReturn*)arg3
//{
//	return (int) qt_QCommonStyle_styleHint((qt_QCommonStyle *)[self qt], (int)sh, (qt_QWidget *) [arg1 qt], (int)arg2, (qt_QStyleHintReturn*) [arg3 qt]);
//}

- (QPixmap*) stylePixmap: (int)sp widget: (QWidget *)widget int: (int)arg1
{
	return (QPixmap*) [QtSupport objectForQtKey: qt_QCommonStyle_stylePixmap((qt_QCommonStyle *)[self qt], (int)sp, (qt_QWidget *) [widget qt], (int)arg1) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

- (QPixmap*) stylePixmap: (int)sp 
{
	return (QPixmap*) [QtSupport objectForQtKey: qt_QCommonStyle_stylePixmap((qt_QCommonStyle *)[self qt], (int)sp, 0, 0) withClass: [QPixmap class] allocatedInObjcWorld: YES];
}

@end
