/***************************************************************************
                            KRuler.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_KRuler.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KRuler.h>

@implementation  KRuler


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

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

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

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

- initWithInt: (int)orient widgetWidth: (int)widgetWidth 
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KRuler2((int)orient, (int)widgetWidth, 0, 0, 0)];
		[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_KRuler((kde_KRuler *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

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

- (int) minValue
{
	return (int) kde_KRuler_minValue((kde_KRuler *)[self qt]);
}

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

- (int) maxValue
{
	return (int) kde_KRuler_maxValue((kde_KRuler *)[self qt]);
}

- setRange: (int)min max: (int)max
{
	kde_KRuler_setRange((kde_KRuler *)[self qt], (int)min, (int)max);
	return self;
}

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

- (int) value
{
	return (int) kde_KRuler_value((kde_KRuler *)[self qt]);
}

- setTinyMarkDistance: (int)arg1
{
	kde_KRuler_setTinyMarkDistance((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- (int) tinyMarkDistance
{
	return (int) kde_KRuler_tinyMarkDistance((kde_KRuler *)[self qt]);
}

- setLittleMarkDistance: (int)arg1
{
	kde_KRuler_setLittleMarkDistance((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- (int) littleMarkDistance
{
	return (int) kde_KRuler_littleMarkDistance((kde_KRuler *)[self qt]);
}

- setMediumMarkDistance: (int)arg1
{
	kde_KRuler_setMediumMarkDistance((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- (int) mediumMarkDistance
{
	return (int) kde_KRuler_mediumMarkDistance((kde_KRuler *)[self qt]);
}

- setBigMarkDistance: (int)arg1
{
	kde_KRuler_setBigMarkDistance((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- (int) bigMarkDistance
{
	return (int) kde_KRuler_bigMarkDistance((kde_KRuler *)[self qt]);
}

- setShowTinyMarks: (BOOL)arg1
{
	kde_KRuler_setShowTinyMarks((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- (BOOL) showTinyMarks
{
	return (BOOL) kde_KRuler_showTinyMarks((kde_KRuler *)[self qt]);
}

- setShowLittleMarks: (BOOL)arg1
{
	kde_KRuler_setShowLittleMarks((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- (BOOL) showLittleMarks
{
	return (BOOL) kde_KRuler_showLittleMarks((kde_KRuler *)[self qt]);
}

- setShowMediumMarks: (BOOL)arg1
{
	kde_KRuler_setShowMediumMarks((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- (BOOL) showMediumMarks
{
	return (BOOL) kde_KRuler_showMediumMarks((kde_KRuler *)[self qt]);
}

- setShowBigMarks: (BOOL)arg1
{
	kde_KRuler_setShowBigMarks((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- (BOOL) showBigMarks
{
	return (BOOL) kde_KRuler_showBigMarks((kde_KRuler *)[self qt]);
}

- setShowEndMarks: (BOOL)arg1
{
	kde_KRuler_setShowEndMarks((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- (BOOL) showEndMarks
{
	return (BOOL) kde_KRuler_showEndMarks((kde_KRuler *)[self qt]);
}

- setShowPointer: (BOOL)arg1
{
	kde_KRuler_setShowPointer((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- (BOOL) showPointer
{
	return (BOOL) kde_KRuler_showPointer((kde_KRuler *)[self qt]);
}

- setValuePerLittleMark: (int)arg1
{
	kde_KRuler_setValuePerLittleMark((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- setValuePerMediumMark: (int)arg1
{
	kde_KRuler_setValuePerMediumMark((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- setValuePerBigMark: (int)arg1
{
	kde_KRuler_setValuePerBigMark((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- setShowEndLabel: (BOOL)arg1
{
	kde_KRuler_setShowEndLabel((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- (BOOL) showEndLabel
{
	return (BOOL) kde_KRuler_showEndLabel((kde_KRuler *)[self qt]);
}

- setEndLabel: (NSString *)arg1
{
static qt_QString * _qstring_arg1 = 0L;
	kde_KRuler_setEndLabel((kde_KRuler *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1]);
	return self;
}

- (NSString *) endLabel
{
static qt_QString * _qstring = 0L;
	_qstring = kde_KRuler_endLabel((kde_KRuler *)[self qt]);
	return [NSString fromQString: _qstring];
}

- setRulerMetricStyle: (int)arg1
{
	kde_KRuler_setRulerMetricStyle((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- setPixelPerMark: (double)rate
{
	kde_KRuler_setPixelPerMark((kde_KRuler *)[self qt], (double)rate);
	return self;
}

- (double) pixelPerMark
{
	return (double) kde_KRuler_pixelPerMark((kde_KRuler *)[self qt]);
}

- setLength: (int)arg1
{
	kde_KRuler_setLength((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- (int) length
{
	return (int) kde_KRuler_length((kde_KRuler *)[self qt]);
}

- setLengthFixed: (BOOL)fix
{
	kde_KRuler_setLengthFixed((kde_KRuler *)[self qt], (int)fix);
	return self;
}

- (BOOL) lengthFixed
{
	return (BOOL) kde_KRuler_lengthFixed((kde_KRuler *)[self qt]);
}

- slideUp: (int)count
{
	kde_KRuler_slideUp((kde_KRuler *)[self qt], (int)count);
	return self;
}

- slideUp
{
	kde_KRuler_slideUp((kde_KRuler *)[self qt], 1);
	return self;
}

- slideDown: (int)count
{
	kde_KRuler_slideDown((kde_KRuler *)[self qt], (int)count);
	return self;
}

- slideDown
{
	kde_KRuler_slideDown((kde_KRuler *)[self qt], 1);
	return self;
}

- setOffset: (int)offset
{
	kde_KRuler_setOffset((kde_KRuler *)[self qt], (int)offset);
	return self;
}

- (int) offset
{
	return (int) kde_KRuler_offset((kde_KRuler *)[self qt]);
}

- (int) endOffset
{
	return (int) kde_KRuler_endOffset((kde_KRuler *)[self qt]);
}

- slotNewValue: (int)arg1
{
	kde_KRuler_slotNewValue((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- slotNewOffset: (int)arg1
{
	kde_KRuler_slotNewOffset((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

- slotEndOffset: (int)arg1
{
	kde_KRuler_slotEndOffset((kde_KRuler *)[self qt], (int)arg1);
	return self;
}

+ (int) Custom
{
	return (int) KRULER_Custom;
}

+ (int) Pixel
{
	return (int) KRULER_Pixel;
}

+ (int) Inch
{
	return (int) KRULER_Inch;
}

+ (int) Millimetres
{
	return (int) KRULER_Millimetres;
}

+ (int) Centimetres
{
	return (int) KRULER_Centimetres;
}

+ (int) Metres
{
	return (int) KRULER_Metres;
}

@end
