DOMParentNode.h

Go to the documentation of this file.
00001 /*
00002  * Iconara DOM framework: DOMParentNode (created 11 December 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 
00029 
00033 @protocol DOMParent <NSObject>
00034 
00041 - (NSArray *)children;
00042 
00046 - (id <DOMNode>)firstChild;
00047 
00051 - (id <DOMNode>)lastChild;
00052 
00057 - (BOOL)containsChild:(id <DOMNode>)child;
00058 
00104 - (id <DOMNode>)appendChild:(id <DOMNode>)child;
00105 
00114 - (void)appendChildren:(NSArray *)children;
00115 
00127 - (id <DOMNode>)insertChild:(id <DOMNode>)child after:(id <DOMNode>)node;
00128 
00140 - (id <DOMNode>)insertChild:(id <DOMNode>)child before:(id <DOMNode>)other;
00141 
00148 - (id <DOMNode>)removeChild:(id <DOMNode>)child;
00149 
00155 - (void)removeAllChildren;
00156 
00166 - (id <DOMNode>)replaceChild:(id <DOMNode>)child withNode:(id <DOMNode>)other;
00167 
00180 - (id <DOMElement>)childElementById:(NSString *)ID;
00181 
00188 - (NSArray *)childElementsByName:(NSString *)name;
00189 
00197 - (NSArray *)childElementsByName:(NSString *)name inNamespace:(NSString *)namespaceURI;
00198 
00199 @end
00200 
00201 
00205 @interface DOMParent : DOMNode <DOMParent> {
00206     @protected
00207         NSMutableArray *children;
00208 }
00209 
00210 @end
00211 
00215 @interface DOMParent ( ProtectedMethods )
00216 
00217 - (id <DOMNode>)insertChild:(id <DOMNode>)node atIndex:(int)index;
00218 
00219 - (BOOL)isValidChild:(id <DOMNode>)node;
00220 
00221 @end