DOMElement.h

Go to the documentation of this file.
00001 /*
00002  * Iconara DOM framework: DOMElement (created 27 April 2002)
00003  *
00004  * Release 1
00005  *
00006  * Copyright 2002-2005 Iconara/Theo Hultberg
00007  *
00008  *
00009  * This file is part of the Iconara DOM framework.
00010  *
00011  * Iconara DOM is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * Iconara DOM is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with Iconara DOM; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024  *
00025  */
00026  
00027 #import <Foundation/Foundation.h>
00028 #import "DOMParentNode.h";
00029 #import "DOMNamespaceAware.h"
00030 
00031 
00032 @protocol DOMAttribute;
00033 
00034 
00040 @protocol DOMElement <DOMParent, DOMNode, DOMNamespaceAware>
00041 
00048 - (NSString *)name;
00049 
00053 - (NSString *)localName;
00054 
00062 - (void)setName:(NSString *)name;
00063 
00067 - (void)setAttributeNamed:(NSString *)name value:(NSString *)value;
00068 
00084 - (void)setAttributeNamed:(NSString *)localName value:(NSString *)value inNamespace:(NSString *)namespaceURI prefix:(NSString *)prefix;
00085 
00093 - (void)setIdAttributeNamed:(NSString *)name;
00094 
00104 - (void)setIdAttributeNamed:(NSString *)localName inNamespace:(NSString *)namespaceURI prefix:(NSString *)prefix;
00105  
00109 - (id <DOMAttribute>)attributeNamed:(NSString *)name;
00110 
00117 - (id <DOMAttribute>)attributeNamed:(NSString *)localName inNamespace:(NSString *)namespaceURI prefix:(NSString *)prefix;
00118 
00125 - (NSString *)valueOfAttributeNamed:(NSString *)name;
00126 
00130 - (NSString *)valueOfAttributeNamed:(NSString *)localName inNamespace:(NSString *)namespaceURI prefix:(NSString *)prefix;
00131 
00135 - (void)removeAttributeNamed:(NSString *)name;
00136 
00140 - (void)removeAttributeNamed:(NSString *)localName inNamespace:(NSString *)namespaceURI prefix:(NSString *)prefix;
00141 
00146 - (NSDictionary *)attributes;
00147 
00151 - (BOOL)hasAttributeNamed:(NSString *)name;
00152 
00157 - (BOOL)hasAttributeNamed:(NSString *)aLocalName inNamespace:(NSString *)nsURI prefix:(NSString *)aPrefix;
00158  
00159 @end
00160 
00161 
00162 @interface DOMElement : DOMParent <DOMElement> {
00163     @private
00164         NSString *localName;
00165         NSString *prefix;
00166         NSString *namespaceURI;
00167     
00168         NSMutableDictionary *attributes;
00169 }
00170 
00171 + (id <DOMElement>)elementWithName:(NSString *)name;
00172 
00173 + (id <DOMElement>)elementWithName:(NSString *)name namespaceURI:(NSString *)nsURI;
00174 
00175 + (id <DOMElement>)elementWithName:(NSString *)name namespaceURI:(NSString *)nsURI prefix:(NSString *)prefix;
00176 
00183 - (id)initWithName:(NSString *)name;
00184 
00185 - (id)initWithName:(NSString *)name namespaceURI:(NSString *)nsURI;
00186 
00187 - (id)initWithName:(NSString *)name namespaceURI:(NSString *)nsURI prefix:(NSString *)prefix;
00188 
00189 @end