/***************************************************************************
                            QXmlSimpleReader.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_QXmlSimpleReader.h>
#include <qtobjc/QXmlSimpleReader.h>

@implementation  QXmlSimpleReader


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

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

- (BOOL) feature: (NSString *)name ok: (int*)ok
{
static qt_QString * _qstring_name = 0L;
	return (BOOL) qt_QXmlSimpleReader_feature((qt_QXmlSimpleReader *)[self qt], (qt_QString *) [name toQString: &_qstring_name], (int*)ok);
}

- (BOOL) feature: (NSString *)name 
{
static qt_QString * _qstring_name = 0L;
	return (BOOL) qt_QXmlSimpleReader_feature((qt_QXmlSimpleReader *)[self qt], (qt_QString *) [name toQString: &_qstring_name], 0);
}

- setFeature: (NSString *)name value: (BOOL)value
{
static qt_QString * _qstring_name = 0L;
	qt_QXmlSimpleReader_setFeature((qt_QXmlSimpleReader *)[self qt], (qt_QString *) [name toQString: &_qstring_name], (int)value);
	return self;
}

- (BOOL) hasFeature: (NSString *)name
{
static qt_QString * _qstring_name = 0L;
	return (BOOL) qt_QXmlSimpleReader_hasFeature((qt_QXmlSimpleReader *)[self qt], (qt_QString *) [name toQString: &_qstring_name]);
}

- (void*) property: (NSString *)name ok: (int*)ok
{
static qt_QString * _qstring_name = 0L;
	return (void*) qt_QXmlSimpleReader_property((qt_QXmlSimpleReader *)[self qt], (qt_QString *) [name toQString: &_qstring_name], (int*)ok);
}

- (void*) property: (NSString *)name 
{
static qt_QString * _qstring_name = 0L;
	return (void*) qt_QXmlSimpleReader_property((qt_QXmlSimpleReader *)[self qt], (qt_QString *) [name toQString: &_qstring_name], 0);
}

- setProperty: (NSString *)name value: (void*)value
{
static qt_QString * _qstring_name = 0L;
	qt_QXmlSimpleReader_setProperty((qt_QXmlSimpleReader *)[self qt], (qt_QString *) [name toQString: &_qstring_name], (void*)value);
	return self;
}

- (BOOL) hasProperty: (NSString *)name
{
static qt_QString * _qstring_name = 0L;
	return (BOOL) qt_QXmlSimpleReader_hasProperty((qt_QXmlSimpleReader *)[self qt], (qt_QString *) [name toQString: &_qstring_name]);
}

- setEntityResolver: (QXmlEntityResolver*)handler
{
	qt_QXmlSimpleReader_setEntityResolver((qt_QXmlSimpleReader *)[self qt], (qt_QXmlEntityResolver*) [handler qt]);
	return self;
}

- (QXmlEntityResolver*) entityResolver
{
	return (QXmlEntityResolver*) [QtSupport objectForQtKey: qt_QXmlSimpleReader_entityResolver((qt_QXmlSimpleReader *)[self qt]) withClass: [QXmlEntityResolver class] allocatedInObjcWorld: YES];
}

- setDTDHandler: (QXmlDTDHandler*)handler
{
	qt_QXmlSimpleReader_setDTDHandler((qt_QXmlSimpleReader *)[self qt], (qt_QXmlDTDHandler*) [handler qt]);
	return self;
}

- (QXmlDTDHandler*) DTDHandler
{
	return (QXmlDTDHandler*) [QtSupport objectForQtKey: qt_QXmlSimpleReader_DTDHandler((qt_QXmlSimpleReader *)[self qt]) withClass: [QXmlDTDHandler class] allocatedInObjcWorld: YES];
}

- setContentHandler: (QXmlContentHandler*)handler
{
	qt_QXmlSimpleReader_setContentHandler((qt_QXmlSimpleReader *)[self qt], (qt_QXmlContentHandler*) [handler qt]);
	return self;
}

- (QXmlContentHandler*) contentHandler
{
	return (QXmlContentHandler*) [QtSupport objectForQtKey: qt_QXmlSimpleReader_contentHandler((qt_QXmlSimpleReader *)[self qt]) withClass: [QXmlContentHandler class] allocatedInObjcWorld: YES];
}

- setErrorHandler: (QXmlErrorHandler*)handler
{
	qt_QXmlSimpleReader_setErrorHandler((qt_QXmlSimpleReader *)[self qt], (qt_QXmlErrorHandler*) [handler qt]);
	return self;
}

- (QXmlErrorHandler*) errorHandler
{
	return (QXmlErrorHandler*) [QtSupport objectForQtKey: qt_QXmlSimpleReader_errorHandler((qt_QXmlSimpleReader *)[self qt]) withClass: [QXmlErrorHandler class] allocatedInObjcWorld: YES];
}

- setLexicalHandler: (QXmlLexicalHandler*)handler
{
	qt_QXmlSimpleReader_setLexicalHandler((qt_QXmlSimpleReader *)[self qt], (qt_QXmlLexicalHandler*) [handler qt]);
	return self;
}

- (QXmlLexicalHandler*) lexicalHandler
{
	return (QXmlLexicalHandler*) [QtSupport objectForQtKey: qt_QXmlSimpleReader_lexicalHandler((qt_QXmlSimpleReader *)[self qt]) withClass: [QXmlLexicalHandler class] allocatedInObjcWorld: YES];
}

- setDeclHandler: (QXmlDeclHandler*)handler
{
	qt_QXmlSimpleReader_setDeclHandler((qt_QXmlSimpleReader *)[self qt], (qt_QXmlDeclHandler*) [handler qt]);
	return self;
}

- (QXmlDeclHandler*) declHandler
{
	return (QXmlDeclHandler*) [QtSupport objectForQtKey: qt_QXmlSimpleReader_declHandler((qt_QXmlSimpleReader *)[self qt]) withClass: [QXmlDeclHandler class] allocatedInObjcWorld: YES];
}

- (BOOL) parse: (QXmlInputSource*)input
{
	return (BOOL) qt_QXmlSimpleReader_parse((qt_QXmlSimpleReader *)[self qt], (qt_QXmlInputSource*) [input qt]);
}

//- (BOOL) parse: (QXmlInputSource*)input
//{
//	return (BOOL) qt_QXmlSimpleReader_parse1((qt_QXmlSimpleReader *)[self qt], (qt_QXmlInputSource*) [input qt]);
//}

- (BOOL) parse: (QXmlInputSource*)input incremental: (BOOL)incremental
{
	return (BOOL) qt_QXmlSimpleReader_parse2((qt_QXmlSimpleReader *)[self qt], (qt_QXmlInputSource*) [input qt], (int)incremental);
}

- (BOOL) parseContinue
{
	return (BOOL) qt_QXmlSimpleReader_parseContinue((qt_QXmlSimpleReader *)[self qt]);
}

@end
