/***************************************************************************
                            QScrollBar.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_QScrollBar.h>
#include <qtc/qt_QRangeControl.h>
#include <qtobjc/QScrollBar.h>
#include <qtobjc/QStyle.h>
#include <qtobjc/QPalette.h>

@implementation  QScrollBar


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

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

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

- initWithInt: (int)arg1 parent: (QWidget *)parent 
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QScrollBar1((int)arg1, (qt_QWidget *) [parent qt], 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithInt: (int)minValue maxValue: (int)maxValue LineStep: (int)LineStep PageStep: (int)PageStep value: (int)value int: (int)arg1 parent: (QWidget *)parent name: (NSString *)name
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QScrollBar2((int)minValue, (int)maxValue, (int)LineStep, (int)PageStep, (int)value, (int)arg1, (qt_QWidget *) [parent qt], (char*) [name cString])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithInt: (int)minValue maxValue: (int)maxValue LineStep: (int)LineStep PageStep: (int)PageStep value: (int)value int: (int)arg1 parent: (QWidget *)parent 
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QScrollBar2((int)minValue, (int)maxValue, (int)LineStep, (int)PageStep, (int)value, (int)arg1, (qt_QWidget *) [parent qt], 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- setOrientation: (int)arg1
{
	qt_QScrollBar_setOrientation((qt_QScrollBar *)[self qt], (int)arg1);
	return self;
}

- (int) orientation
{
	return (int) qt_QScrollBar_orientation((qt_QScrollBar *)[self qt]);
}

- setTracking: (BOOL)enable
{
	qt_QScrollBar_setTracking((qt_QScrollBar *)[self qt], (int)enable);
	return self;
}

- (BOOL) tracking
{
	return (BOOL) qt_QScrollBar_tracking((qt_QScrollBar *)[self qt]);
}

- (BOOL) draggingSlider
{
	return (BOOL) qt_QScrollBar_draggingSlider((qt_QScrollBar *)[self qt]);
}

- setPalette: (QPalette *)arg1
{
	qt_QScrollBar_setPalette((qt_QScrollBar *)[self qt], (qt_QPalette *) [arg1 qt]);
	return self;
}

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

- (int) minValue
{
	return (int) qt_QScrollBar_minValue((qt_QScrollBar *)[self qt]);
}

- (int) maxValue
{
	return (int) qt_QScrollBar_maxValue((qt_QScrollBar *)[self qt]);
}

- setMinValue: (int)arg1
{
	qt_QScrollBar_setMinValue((qt_QScrollBar *)[self qt], (int)arg1);
	return self;
}

- setMaxValue: (int)arg1
{
	qt_QScrollBar_setMaxValue((qt_QScrollBar *)[self qt], (int)arg1);
	return self;
}

- (int) lineStep
{
	return (int) qt_QScrollBar_lineStep((qt_QScrollBar *)[self qt]);
}

- (int) pageStep
{
	return (int) qt_QScrollBar_pageStep((qt_QScrollBar *)[self qt]);
}

- setLineStep: (int)arg1
{
	qt_QScrollBar_setLineStep((qt_QScrollBar *)[self qt], (int)arg1);
	return self;
}

- setPageStep: (int)arg1
{
	qt_QScrollBar_setPageStep((qt_QScrollBar *)[self qt], (int)arg1);
	return self;
}

- (int) value
{
	return (int) qt_QScrollBar_value((qt_QScrollBar *)[self qt]);
}

- (int) sliderStart
{
	return (int) qt_QScrollBar_sliderStart((qt_QScrollBar *)[self qt]);
}

- (QRect*) sliderRect
{
	return (QRect*) [QtSupport objectForQtKey: qt_QScrollBar_sliderRect((qt_QScrollBar *)[self qt]) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- setValue: (int)arg1
{
	qt_QScrollBar_setValue((qt_QScrollBar *)[self qt], (int)arg1);
	return self;
}

- valueChange
{
	qt_QScrollBar_valueChange((qt_QScrollBar *)[self qt]);
	return self;
}

- stepChange
{
	qt_QScrollBar_stepChange((qt_QScrollBar *)[self qt]);
	return self;
}

- rangeChange
{
	qt_QScrollBar_rangeChange((qt_QScrollBar *)[self qt]);
	return self;
}

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

@end

@implementation QScrollBar (QRangeControlImplementation)
- (int) value
{
	return (int) qt_QRangeControl_value(qt_QScrollBar_QRangeControl([self qt]));
}

- setValue: (int)arg1
{
	qt_QRangeControl_setValue(qt_QScrollBar_QRangeControl([self qt]), (int)arg1);
	return self;
}

- addPage
{
	qt_QRangeControl_addPage(qt_QScrollBar_QRangeControl([self qt]));
	return self;
}

- subtractPage
{
	qt_QRangeControl_subtractPage(qt_QScrollBar_QRangeControl([self qt]));
	return self;
}

- addLine
{
	qt_QRangeControl_addLine(qt_QScrollBar_QRangeControl([self qt]));
	return self;
}

- subtractLine
{
	qt_QRangeControl_subtractLine(qt_QScrollBar_QRangeControl([self qt]));
	return self;
}

- (int) minValue
{
	return (int) qt_QRangeControl_minValue(qt_QScrollBar_QRangeControl([self qt]));
}

- (int) maxValue
{
	return (int) qt_QRangeControl_maxValue(qt_QScrollBar_QRangeControl([self qt]));
}

- setRange: (int)minValue maxValue: (int)maxValue
{
	qt_QRangeControl_setRange(qt_QScrollBar_QRangeControl([self qt]), (int)minValue, (int)maxValue);
	return self;
}

- setMinValue: (int)minVal
{
	qt_QRangeControl_setMinValue(qt_QScrollBar_QRangeControl([self qt]), (int)minVal);
	return self;
}

- setMaxValue: (int)minVal
{
	qt_QRangeControl_setMaxValue(qt_QScrollBar_QRangeControl([self qt]), (int)minVal);
	return self;
}

- (int) lineStep
{
	return (int) qt_QRangeControl_lineStep(qt_QScrollBar_QRangeControl([self qt]));
}

- (int) pageStep
{
	return (int) qt_QRangeControl_pageStep(qt_QScrollBar_QRangeControl([self qt]));
}

- setSteps: (int)line page: (int)page
{
	qt_QRangeControl_setSteps(qt_QScrollBar_QRangeControl([self qt]), (int)line, (int)page);
	return self;
}

- (int) bound: (int)arg1
{
	return (int) qt_QRangeControl_bound(qt_QScrollBar_QRangeControl([self qt]), (int)arg1);
}

- (int) positionFromValue: (int)val space: (int)space
{
	return (int) qt_QRangeControl_positionFromValue(qt_QScrollBar_QRangeControl([self qt]), (int)val, (int)space);
}

- (int) valueFromPosition: (int)pos space: (int)space
{
	return (int) qt_QRangeControl_valueFromPosition(qt_QScrollBar_QRangeControl([self qt]), (int)pos, (int)space);
}

- directSetValue: (int)val
{
	qt_QRangeControl_directSetValue(qt_QScrollBar_QRangeControl([self qt]), (int)val);
	return self;
}

- (int) prevValue
{
	return (int) qt_QRangeControl_prevValue(qt_QScrollBar_QRangeControl([self qt]));
}

- valueChange
{
	qt_QRangeControl_valueChange(qt_QScrollBar_QRangeControl([self qt]));
	return self;
}

- rangeChange
{
	qt_QRangeControl_rangeChange(qt_QScrollBar_QRangeControl([self qt]));
	return self;
}

- stepChange
{
	qt_QRangeControl_stepChange(qt_QScrollBar_QRangeControl([self qt]));
	return self;
}

@end
