/***************************************************************************
                            QDomImplementation.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_QDomImplementation.h>
#include <qtobjc/QDomImplementation.h>
#include <qtobjc/QDomDocumentType.h>


@implementation  QDomImplementation

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

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

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

- (BOOL) hasFeature: (NSString *)feature version: (NSString *)version
{
static qt_QString * _qstring_version = 0L;
static qt_QString * _qstring_feature = 0L;
	return (BOOL) qt_QDomImplementation_hasFeature((qt_QDomImplementation *)[self qt], (qt_QString *) [feature toQString: &_qstring_feature], (qt_QString *) [version toQString: &_qstring_version]);
}

- (QDomDocumentType*) createDocumentType: (NSString *)qName publicId: (NSString *)publicId systemId: (NSString *)systemId
{
static qt_QString * _qstring_systemId = 0L;
static qt_QString * _qstring_publicId = 0L;
static qt_QString * _qstring_qName = 0L;
	return (QDomDocumentType*) [QtSupport objectForQtKey: qt_QDomImplementation_createDocumentType((qt_QDomImplementation *)[self qt], (qt_QString *) [qName toQString: &_qstring_qName], (qt_QString *) [publicId toQString: &_qstring_publicId], (qt_QString *) [systemId toQString: &_qstring_systemId]) withClass: [QDomDocumentType class] allocatedInObjcWorld: YES];
}

- (QDomDocument*) createDocument: (NSString *)nsURI qName: (NSString *)qName doctype: (QDomDocumentType*)doctype
{
static qt_QString * _qstring_qName = 0L;
static qt_QString * _qstring_nsURI = 0L;
	return (QDomDocument*) [QtSupport objectForQtKey: qt_QDomImplementation_createDocument((qt_QDomImplementation *)[self qt], (qt_QString *) [nsURI toQString: &_qstring_nsURI], (qt_QString *) [qName toQString: &_qstring_qName], (qt_QDomDocumentType*) [doctype qt]) withClass: [QDomDocument class] allocatedInObjcWorld: YES];
}

- (BOOL) isNull
{
	return (BOOL) qt_QDomImplementation_isNull((qt_QDomImplementation *)[self qt]);
}

@end
