Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSXMLDTD.d @ 0:380af2bdd8e5
Upload of whole dwt tree
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sat, 09 Aug 2008 17:00:02 +0200 |
parents | |
children | 8b48be5454ce |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:380af2bdd8e5 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2007 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * | |
11 * Port to the D Programming language: | |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | |
13 *******************************************************************************/ | |
14 module dwt.internal.cocoa.NSXMLDTD; | |
15 | |
16 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSArray; | |
18 import dwt.internal.cocoa.NSData; | |
19 import dwt.internal.cocoa.NSInteger; | |
20 import dwt.internal.cocoa.NSString; | |
21 import dwt.internal.cocoa.NSURL; | |
22 import dwt.internal.cocoa.NSXMLDTDNode; | |
23 import dwt.internal.cocoa.NSXMLNode; | |
24 import dwt.internal.cocoa.OS; | |
25 import objc = dwt.internal.objc.runtime; | |
26 | |
27 public class NSXMLDTD : NSXMLNode | |
28 { | |
29 | |
30 public this () | |
31 { | |
32 super(); | |
33 } | |
34 | |
35 public this (objc.id id) | |
36 { | |
37 super(id); | |
38 } | |
39 | |
40 public void addChild (NSXMLNode child) | |
41 { | |
42 OS.objc_msgSend(this.id, OS.sel_addChild_1, child !is null ? child.id : null); | |
43 } | |
44 | |
45 public NSXMLDTDNode attributeDeclarationForName (NSString name, NSString elementName) | |
46 { | |
47 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributeDeclarationForName_1elementName_1, name !is null ? name.id : null, | |
48 elementName !is null ? elementName.id : null); | |
49 return result !is null ? new NSXMLDTDNode(result) : null; | |
50 } | |
51 | |
52 public NSXMLDTDNode elementDeclarationForName (NSString name) | |
53 { | |
54 objc.id result = OS.objc_msgSend(this.id, OS.sel_elementDeclarationForName_1, name !is null ? name.id : null); | |
55 return result !is null ? new NSXMLDTDNode(result) : null; | |
56 } | |
57 | |
58 public NSXMLDTDNode entityDeclarationForName (NSString name) | |
59 { | |
60 objc.id result = OS.objc_msgSend(this.id, OS.sel_entityDeclarationForName_1, name !is null ? name.id : null); | |
61 return result !is null ? new NSXMLDTDNode(result) : null; | |
62 } | |
63 | |
64 public id initWithContentsOfURL (NSURL url, NSUInteger mask, /*NSError** */objc.id** error) | |
65 { | |
66 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1options_1error_1, url !is null ? url.id : null, mask, error); | |
67 return result !is null ? new id(result) : null; | |
68 } | |
69 | |
70 public id initWithData (NSData data, NSUInteger mask, /*NSError** */objc.id** error) | |
71 { | |
72 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithData_1options_1error_1, data !is null ? data.id : null, mask, error); | |
73 return result !is null ? new id(result) : null; | |
74 } | |
75 | |
76 public void insertChild (NSXMLNode child, NSUInteger index) | |
77 { | |
78 OS.objc_msgSend(this.id, OS.sel_insertChild_1atIndex_1, child !is null ? child.id : null, index); | |
79 } | |
80 | |
81 public void insertChildren (NSArray children, NSUInteger index) | |
82 { | |
83 OS.objc_msgSend(this.id, OS.sel_insertChildren_1atIndex_1, children !is null ? children.id : null, index); | |
84 } | |
85 | |
86 public NSXMLDTDNode notationDeclarationForName (NSString name) | |
87 { | |
88 objc.id result = OS.objc_msgSend(this.id, OS.sel_notationDeclarationForName_1, name !is null ? name.id : null); | |
89 return result !is null ? new NSXMLDTDNode(result) : null; | |
90 } | |
91 | |
92 public static NSXMLDTDNode predefinedEntityDeclarationForName (NSString name) | |
93 { | |
94 objc.id result = OS.objc_msgSend(OS.class_NSXMLDTD, OS.sel_predefinedEntityDeclarationForName_1, name !is null ? name.id : null); | |
95 return result !is null ? new NSXMLDTDNode(result) : null; | |
96 } | |
97 | |
98 public NSString publicID () | |
99 { | |
100 objc.id result = OS.objc_msgSend(this.id, OS.sel_publicID); | |
101 return result !is null ? new NSString(result) : null; | |
102 } | |
103 | |
104 public void removeChildAtIndex (NSUInteger index) | |
105 { | |
106 OS.objc_msgSend(this.id, OS.sel_removeChildAtIndex_1, index); | |
107 } | |
108 | |
109 public void replaceChildAtIndex (NSUInteger index, NSXMLNode node) | |
110 { | |
111 OS.objc_msgSend(this.id, OS.sel_replaceChildAtIndex_1withNode_1, index, node !is null ? node.id : null); | |
112 } | |
113 | |
114 public void setChildren (NSArray children) | |
115 { | |
116 OS.objc_msgSend(this.id, OS.sel_setChildren_1, children !is null ? children.id : null); | |
117 } | |
118 | |
119 public void setPublicID (NSString publicID) | |
120 { | |
121 OS.objc_msgSend(this.id, OS.sel_setPublicID_1, publicID !is null ? publicID.id : null); | |
122 } | |
123 | |
124 public void setSystemID (NSString systemID) | |
125 { | |
126 OS.objc_msgSend(this.id, OS.sel_setSystemID_1, systemID !is null ? systemID.id : null); | |
127 } | |
128 | |
129 public NSString systemID () | |
130 { | |
131 objc.id result = OS.objc_msgSend(this.id, OS.sel_systemID); | |
132 return result !is null ? new NSString(result) : null; | |
133 } | |
134 | |
135 } |