2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE 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 SOPE 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 SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #include <NGObjWeb/WOxElemBuilder.h>
25 This builder builds drag&drop elements from the WEExtensions library.
26 Note that there are other builders for WEExtensions elements as well !!
28 All tags are mapped into the <var:> namespace (XMLNS_OD_BIND).
31 <var:js-drag .../> maps to WEDragContainer
32 <var:js-drop .../> maps to WEDropContainer
33 <var:script-drag/> maps to WEDragScript
34 <var:script-drop/> maps to WEDropScript
37 @interface WExDnDElemBuilder : WOxTagClassElemBuilder
43 #include <SaxObjC/XMLNamespaces.h>
46 @implementation WExDnDElemBuilder
48 - (Class)classForElement:(id<DOMElement>)_element {
53 if (![[_element namespaceURI] isEqualToString:XMLNS_OD_BIND])
56 tagName = [_element tagName];
57 if ((tl = [tagName length]) < 7)
60 c1 = [tagName characterAtIndex:0];
63 case 'j': /* starting with 'j' */
65 if ([tagName hasPrefix:@"js-dr"]) {
66 if ([tagName isEqualToString:@"js-drag"])
67 return NSClassFromString(@"WEDragContainer");
68 if ([tagName isEqualToString:@"js-drop"])
69 return NSClassFromString(@"WEDropContainer");
74 case 's': /* starting with 's' */
76 if ([tagName hasPrefix:@"script-"]) {
77 if ([tagName isEqualToString:@"script-drag"])
78 return NSClassFromString(@"WEDragScript");
79 if ([tagName isEqualToString:@"script-drop"])
80 return NSClassFromString(@"WEDropScript");
88 @end /* WExDnDElemBuilder */