DOMNode.h

Go to the documentation of this file.
00001 /*
00002  * Iconara DOM framework: DOMNode (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 "DOMVisitor.h"
00029 
00030 
00037 typedef enum {
00038     DOMUnknownNodeType                = -1,
00039     DOMElementNodeType                = 1,
00040     DOMAttributeNodeType              = 2,
00041     DOMTextNodeType                   = 3,
00042     DOMCDATASectionNodeType           = 4,
00043     DOMEntityReferenceNodeType        = 5,
00044     DOMEntityNodeType                 = 6,
00045     DOMProcessingInstructionNodeType  = 7,
00046     DOMCommentNodeType                = 8,
00047     DOMDocumentNodeType               = 9,
00048     DOMDocTypeNodeType                = 10,
00049     DOMDocumentFragmentNodeType       = 11,
00050     DOMNotationNodeType               = 12
00051 } DOMNodeType;
00052 
00053 
00054 @protocol DOMNode, DOMDocument, DOMElement, DOMParent;
00055 
00056 
00077 @protocol DOMNode <NSObject>
00078 
00099 - (NSString *)nodeName;
00100 
00108 - (NSString *)nodeValue;
00109 
00117 - (DOMNodeType)nodeType;
00118 
00122 - (id <DOMParent, DOMNode>)parentNode;
00123 
00134 - (void)setParentNode:(id <DOMParent, DOMNode>)newParent;
00135 
00144 - (id <DOMDocument>)ownerDocument;
00145 
00159 - (id <DOMNode>)detach;
00160 
00170 - (BOOL)isDetached;
00171 
00175 - (BOOL)hasChildren;
00176 
00181 - (id <DOMNode>)previousSibling;
00182 
00187  - (id <DOMNode>)nextSibling;
00188  
00209 - (NSString *)textContent;
00210  
00231 - (void)setTextContent:(NSString *)text;
00232 
00233 
00248 - (BOOL)isEqualToNode:(id <DOMNode>)node;
00249 
00250 @end
00251 
00252 
00256 @interface DOMNode : NSObject <DOMNode, DOMVisitable, NSCopying> {
00257     @private
00258         id <DOMParent, DOMNode> parent;
00259 }
00260 
00261 @end