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 #include <NGObjWeb/WOxElemBuilder.h>
26 This builder builds drag&drop elements from the WEExtensions library.
27 Note that there are other builders for WEExtensions elements as well !!
29 All tags are mapped into the <var:> namespace (XMLNS_OD_BIND).
32 <var:js-drag .../> maps to WEDragContainer
33 <var:js-drop .../> maps to WEDropContainer
34 <var:script-drag/> maps to WEDragScript
35 <var:script-drop/> maps to WEDropScript
38 @interface WExDnDElemBuilder : WOxTagClassElemBuilder
44 #include <SaxObjC/XMLNamespaces.h>
47 @implementation WExDnDElemBuilder
49 - (Class)classForElement:(id<DOMElement>)_element {
54 if (![[_element namespaceURI] isEqualToString:XMLNS_OD_BIND])
57 tagName = [_element tagName];
58 if ((tl = [tagName length]) < 7)
61 c1 = [tagName characterAtIndex:0];
64 case 'j': /* starting with 'j' */
66 if ([tagName hasPrefix:@"js-dr"]) {
67 if ([tagName isEqualToString:@"js-drag"])
68 return NSClassFromString(@"WEDragContainer");
69 if ([tagName isEqualToString:@"js-drop"])
70 return NSClassFromString(@"WEDropContainer");
75 case 's': /* starting with 's' */
77 if ([tagName hasPrefix:@"script-"]) {
78 if ([tagName isEqualToString:@"script-drag"])
79 return NSClassFromString(@"WEDragScript");
80 if ([tagName isEqualToString:@"script-drop"])
81 return NSClassFromString(@"WEDropScript");
89 @end /* WExDnDElemBuilder */