ObjFW
|
00001 /* 00002 * Copyright (c) 2008, 2009, 2010, 2011, 2012 00003 * Jonathan Schleifer <js@webkeks.org> 00004 * 00005 * All rights reserved. 00006 * 00007 * This file is part of ObjFW. It may be distributed under the terms of the 00008 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in 00009 * the packaging of this file. 00010 * 00011 * Alternatively, it may be distributed under the terms of the GNU General 00012 * Public License, either version 2 or 3, which can be found in the file 00013 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this 00014 * file. 00015 */ 00016 00017 #import "OFObject.h" 00018 #import "OFXMLParser.h" 00019 00020 @class OFMutableArray; 00021 @class OFXMLElement; 00022 @class OFXMLElementBuilder; 00023 00028 #ifndef OF_XML_ELEMENT_BUILDER_M 00029 @protocol OFXMLElementBuilderDelegate <OFObject> 00030 #else 00031 @protocol OFXMLElementBuilderDelegate 00032 #endif 00033 00043 - (void)elementBuilder: (OFXMLElementBuilder*)builder 00044 didBuildElement: (OFXMLElement*)element; 00045 00046 #ifdef OF_HAVE_OPTIONAL_PROTOCOLS 00047 @optional 00048 #endif 00049 00060 - (void)elementBuilder: (OFXMLElementBuilder*)builder 00061 didBuildParentlessNode: (OFXMLNode*)node; 00062 00081 - (void)elementBuilder: (OFXMLElementBuilder*)builder 00082 didNotExpectCloseTag: (OFString*)name 00083 withPrefix: (OFString*)prefix 00084 namespace: (OFString*)ns; 00085 00093 - (OFString*)elementBuilder: (OFXMLElementBuilder*)builder 00094 foundUnknownEntityNamed: (OFString*)entity; 00095 @end 00096 00105 @interface OFXMLElementBuilder: OFObject <OFXMLParserDelegate> 00106 { 00107 OFMutableArray *stack; 00108 id <OFXMLElementBuilderDelegate> delegate; 00109 } 00110 00111 #ifdef OF_HAVE_PROPERTIES 00112 @property (assign) id <OFXMLElementBuilderDelegate> delegate; 00113 #endif 00114 00120 + elementBuilder; 00121 00127 - (id <OFXMLElementBuilderDelegate>)delegate; 00128 00134 - (void)setDelegate: (id <OFXMLElementBuilderDelegate>)delegate; 00135 @end 00136 00137 @interface OFObject (OFXMLElementBuilderDelegate) <OFXMLElementBuilderDelegate> 00138 @end