2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #ifndef __SaxMethodCallHandler_H__
24 #define __SaxMethodCallHandler_H__
26 #include <SaxObjC/SaxDefaultHandler.h>
27 #import <Foundation/NSMapTable.h>
29 @class NSString, NSMutableArray, NSMutableDictionary;
32 [also take a look at SaxObjectDecoder]
34 This handler calls a method on a delegate for each tag. The selector is
37 [start|end] + nskey + tagname + ':'
39 If no method could be found for the tag, it is first checked whether the
42 [start|end] + nskey + 'unknownTag:attributes:'
44 and it this couldn't be found, it is checked for
46 [start|end] + 'tag:_tagName namespace:_ns attributes:'
48 If no key could be found for a namespace, it is first checked whether the
51 [start|end] + 'any_' + tagname + ':'
53 if this fails it is checked for this selector
55 [start|end] + 'tag:_tagName namespace:_ns attributes:'
57 if neither exists, the tag is ignored.
61 nskey='xhtml' startKey='start_' endKey='end_'
62 - (void)start_xhtml_br:(id<SaxAttributes>)_attrs;
66 @interface SaxMethodCallHandler : SaxDefaultHandler
68 id delegate; // non-retained: default=self (for subclasses)
69 NSMutableDictionary *namespaceToKey;
70 NSMutableArray *tagStack;
71 NSString *startKey; // default: 'start_'
72 NSString *endKey; // default: 'end_'
73 NSString *unknownNamespaceKey; // default: 'any_'
77 NSMapTable *fqNameToStartSel;
78 NSMutableString *selName; /* reused for each construction */
83 - (void)registerNamespace:(NSString *)_namespace withKey:(NSString *)_key;
87 - (void)setStartKey:(NSString *)_s;
88 - (NSString *)startKey;
89 - (void)setEndKey:(NSString *)_s;
91 - (void)setUnknownNamespaceKey:(NSString *)_s;
92 - (NSString *)unknownNamespaceKey;
96 - (NSArray *)tagStack;
99 - (void)ignoreChildren;
100 - (BOOL)doesIgnoreChildren;
104 - (void)setDelegate:(id)_delegate;
109 #endif /* __SaxMethodCallHandler_H__ */