/***************************************************************************
                            QProgressBar.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_QProgressBar.h>
#include <qtobjc/QProgressBar.h>
#include <qtobjc/QPainter.h>
#include <qtobjc/QStyle.h>

@implementation  QProgressBar


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

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

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

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

- (int) totalSteps
{
	return (int) qt_QProgressBar_totalSteps((qt_QProgressBar *)[self qt]);
}

- (int) progress
{
	return (int) qt_QProgressBar_progress((qt_QProgressBar *)[self qt]);
}

- (NSString *) progressString
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QProgressBar_progressString((qt_QProgressBar *)[self qt]);
	return [NSString fromQString: _qstring];
}

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

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

- setCenterIndicator: (BOOL)on
{
	qt_QProgressBar_setCenterIndicator((qt_QProgressBar *)[self qt], (int)on);
	return self;
}

- (BOOL) centerIndicator
{
	return (BOOL) qt_QProgressBar_centerIndicator((qt_QProgressBar *)[self qt]);
}

- setIndicatorFollowsStyle: (BOOL)arg1
{
	qt_QProgressBar_setIndicatorFollowsStyle((qt_QProgressBar *)[self qt], (int)arg1);
	return self;
}

- (BOOL) indicatorFollowsStyle
{
	return (BOOL) qt_QProgressBar_indicatorFollowsStyle((qt_QProgressBar *)[self qt]);
}

- (BOOL) percentageVisible
{
	return (BOOL) qt_QProgressBar_percentageVisible((qt_QProgressBar *)[self qt]);
}

- setPercentageVisible: (BOOL)arg1
{
	qt_QProgressBar_setPercentageVisible((qt_QProgressBar *)[self qt], (int)arg1);
	return self;
}

- show
{
	qt_QProgressBar_show((qt_QProgressBar *)[self qt]);
	return self;
}

- reset
{
	qt_QProgressBar_reset((qt_QProgressBar *)[self qt]);
	return self;
}

- setTotalSteps: (int)totalSteps
{
	qt_QProgressBar_setTotalSteps((qt_QProgressBar *)[self qt], (int)totalSteps);
	return self;
}

- setProgress: (int)progress
{
	qt_QProgressBar_setProgress((qt_QProgressBar *)[self qt], (int)progress);
	return self;
}

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

- (BOOL) setIndicator: (NSString *)progress_str progress: (int)progress totalSteps: (int)totalSteps
{
static qt_QString * _qstring_progress_str = 0L;
	return (BOOL) qt_QProgressBar_setIndicator((qt_QProgressBar *)[self qt], (qt_QString *) [progress_str toQString: &_qstring_progress_str], (int)progress, (int)totalSteps);
}

- styleChange: (QStyle*)arg1
{
	qt_QProgressBar_styleChange((qt_QProgressBar *)[self qt], (qt_QStyle*) [arg1 qt]);
	return self;
}

@end
