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

@implementation  URLArgs

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

- copyWithZone: (NSZone *) zone
{
	URLArgs * aCopy;
	aCopy = [[(URLArgs *)[[self class] allocWithZone: zone] setQt: kde_new_URLArgs1([self qt])] init];
	[aCopy setAllocatedInObjcWorld: YES];
	[QtSupport setObject: aCopy forQtKey: [aCopy qt]];
	return aCopy;
}

- initWithBOOL: (BOOL)reload xOffset: (int)xOffset yOffset: (int)yOffset serviceType: (NSString *)serviceType
{
static qt_QString * _qstring_serviceType = 0L;
	if ([self qt] == 0L) {
		[self setQt: kde_new_URLArgs2((int)reload, (int)xOffset, (int)yOffset, (qt_QString *) [serviceType toQString: &_qstring_serviceType])];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- initWithBOOL: (BOOL)reload xOffset: (int)xOffset yOffset: (int)yOffset 
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_URLArgs2((int)reload, (int)xOffset, (int)yOffset, qt_QString_null())];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld]) {
			kde_del_URLArgs((kde_URLArgs *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- setContentType: (NSString *)contentType
{
static qt_QString * _qstring_contentType = 0L;
	kde_URLArgs_setContentType((kde_URLArgs *)[self qt], (qt_QString *) [contentType toQString: &_qstring_contentType]);
	return self;
}

- (NSString *) contentType
{
static qt_QString * _qstring = 0L;
	_qstring = kde_URLArgs_contentType((kde_URLArgs *)[self qt]);
	return [NSString fromQString: _qstring];
}

- setDoPost: (BOOL)enable
{
	kde_URLArgs_setDoPost((kde_URLArgs *)[self qt], (int)enable);
	return self;
}

- (BOOL) doPost
{
	return (BOOL) kde_URLArgs_doPost((kde_URLArgs *)[self qt]);
}

- setLockHistory: (BOOL)lock
{
	kde_URLArgs_setLockHistory((kde_URLArgs *)[self qt], (int)lock);
	return self;
}

- (BOOL) lockHistory
{
	return (BOOL) kde_URLArgs_lockHistory((kde_URLArgs *)[self qt]);
}

@end
