/***************************************************************************
                            QDomNamedNodeMap.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_QDomNamedNodeMap.h>
#include <qtobjc/QDomNamedNodeMap.h>
#include <qtobjc/QDomNode.h>

@implementation  QDomNamedNodeMap

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

- copyWithZone: (NSZone *) zone
{
	QDomNamedNodeMap * aCopy;
	aCopy = [[(QDomNamedNodeMap *)[[self class] allocWithZone: zone] setQt: qt_new_QDomNamedNodeMap1([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_QDomNamedNodeMap((qt_QDomNamedNodeMap *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (QDomNode*) namedItem: (NSString *)name
{
static qt_QString * _qstring_name = 0L;
	return (QDomNode*) [QtSupport objectForQtKey: qt_QDomNamedNodeMap_namedItem((qt_QDomNamedNodeMap *)[self qt], (qt_QString *) [name toQString: &_qstring_name]) withClass: [QDomNode class] allocatedInObjcWorld: YES];
}

- (QDomNode*) setNamedItem: (QDomNode*)newNode
{
	return (QDomNode*) [QtSupport objectForQtKey: qt_QDomNamedNodeMap_setNamedItem((qt_QDomNamedNodeMap *)[self qt], (qt_QDomNode*) [newNode qt]) withClass: [QDomNode class] allocatedInObjcWorld: YES];
}

- (QDomNode*) removeNamedItem: (NSString *)name
{
static qt_QString * _qstring_name = 0L;
	return (QDomNode*) [QtSupport objectForQtKey: qt_QDomNamedNodeMap_removeNamedItem((qt_QDomNamedNodeMap *)[self qt], (qt_QString *) [name toQString: &_qstring_name]) withClass: [QDomNode class] allocatedInObjcWorld: YES];
}

- (QDomNode*) item: (int)index
{
	return (QDomNode*) [QtSupport objectForQtKey: qt_QDomNamedNodeMap_item((qt_QDomNamedNodeMap *)[self qt], (int)index) withClass: [QDomNode class] allocatedInObjcWorld: YES];
}

- (QDomNode*) namedItemNS: (NSString *)nsURI localName: (NSString *)localName
{
static qt_QString * _qstring_localName = 0L;
static qt_QString * _qstring_nsURI = 0L;
	return (QDomNode*) [QtSupport objectForQtKey: qt_QDomNamedNodeMap_namedItemNS((qt_QDomNamedNodeMap *)[self qt], (qt_QString *) [nsURI toQString: &_qstring_nsURI], (qt_QString *) [localName toQString: &_qstring_localName]) withClass: [QDomNode class] allocatedInObjcWorld: YES];
}

- (QDomNode*) setNamedItemNS: (QDomNode*)newNode
{
	return (QDomNode*) [QtSupport objectForQtKey: qt_QDomNamedNodeMap_setNamedItemNS((qt_QDomNamedNodeMap *)[self qt], (qt_QDomNode*) [newNode qt]) withClass: [QDomNode class] allocatedInObjcWorld: YES];
}

- (QDomNode*) removeNamedItemNS: (NSString *)nsURI localName: (NSString *)localName
{
static qt_QString * _qstring_localName = 0L;
static qt_QString * _qstring_nsURI = 0L;
	return (QDomNode*) [QtSupport objectForQtKey: qt_QDomNamedNodeMap_removeNamedItemNS((qt_QDomNamedNodeMap *)[self qt], (qt_QString *) [nsURI toQString: &_qstring_nsURI], (qt_QString *) [localName toQString: &_qstring_localName]) withClass: [QDomNode class] allocatedInObjcWorld: YES];
}

- (unsigned int) length
{
	return (unsigned int) qt_QDomNamedNodeMap_length((qt_QDomNamedNodeMap *)[self qt]);
}

- (unsigned int) count
{
	return (unsigned int) qt_QDomNamedNodeMap_count((qt_QDomNamedNodeMap *)[self qt]);
}

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

@end
