Mercurial > projects > dwt-mac
view dwt/internal/cocoa/NSXMLDocument.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 |
line wrap: on
line source
/******************************************************************************* * Copyright (c) 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * * Port to the D Programming language: * Jacob Carlborg <jacob.carlborg@gmail.com> *******************************************************************************/ module dwt.internal.cocoa.NSXMLDocument; import dwt.internal.cocoa.id; import dwt.internal.cocoa.NSArray; import dwt.internal.cocoa.NSData; import dwt.internal.cocoa.NSDictionary; import dwt.internal.cocoa.NSInteger; import dwt.internal.cocoa.NSString; import dwt.internal.cocoa.NSURL; import dwt.internal.cocoa.NSXMLDTD; import dwt.internal.cocoa.NSXMLElement; import dwt.internal.cocoa.NSXMLNode; import dwt.internal.cocoa.OS; import objc = dwt.internal.objc.runtime; enum NSXMLDocumentContentKind : NSUInteger { NSXMLDocumentXMLKind = 0, NSXMLDocumentXHTMLKind, NSXMLDocumentHTMLKind, NSXMLDocumentTextKind } alias NSXMLDocumentContentKind.NSXMLDocumentXMLKind NSXMLDocumentXMLKind; alias NSXMLDocumentContentKind.NSXMLDocumentXHTMLKind NSXMLDocumentXHTMLKind; alias NSXMLDocumentContentKind.NSXMLDocumentHTMLKind NSXMLDocumentHTMLKind; alias NSXMLDocumentContentKind.NSXMLDocumentTextKind NSXMLDocumentTextKind; public class NSXMLDocument : NSXMLNode { public this () { super(); } public this (objc.id id) { super(id); } public NSXMLDTD DTD () { objc.id result = OS.objc_msgSend(this.id, OS.sel_DTD); return result !is null ? new NSXMLDTD(result) : null; } public NSString MIMEType () { objc.id result = OS.objc_msgSend(this.id, OS.sel_MIMEType); return result !is null ? new NSString(result) : null; } public NSData XMLData () { objc.id result = OS.objc_msgSend(this.id, OS.sel_XMLData); return result !is null ? new NSData(result) : null; } public NSData XMLDataWithOptions (NSUInteger options) { objc.id result = OS.objc_msgSend(this.id, OS.sel_XMLDataWithOptions_1, options); return result !is null ? new NSData(result) : null; } public void addChild (NSXMLNode child) { OS.objc_msgSend(this.id, OS.sel_addChild_1, child !is null ? child.id : null); } public NSString characterEncoding () { objc.id result = OS.objc_msgSend(this.id, OS.sel_characterEncoding); return result !is null ? new NSString(result) : null; } public NSXMLDocumentContentKind documentContentKind () { return cast(NSXMLDocumentContentKind) OS.objc_msgSend(this.id, OS.sel_documentContentKind); } public id initWithContentsOfURL (NSURL url, NSUInteger mask, /*NSError** */objc.id** error) { objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1options_1error_1, url !is null ? url.id : null, mask, error); return result !is null ? new id(result) : null; } public id initWithData (NSData data, NSUInteger mask, /*NSError** */objc.id** error) { objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithData_1options_1error_1, data !is null ? data.id : null, mask, error); return result !is null ? new id(result) : null; } public id initWithRootElement (NSXMLElement element) { objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithRootElement_1, element !is null ? element.id : null); return result !is null ? new id(result) : null; } public id initWithXMLString (NSString string, NSUInteger mask, /*NSError** */objc.id** error) { objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithXMLString_1options_1error_1, string !is null ? string.id : null, mask, error); return result !is null ? new id(result) : null; } public void insertChild (NSXMLNode child, NSUInteger index) { OS.objc_msgSend(this.id, OS.sel_insertChild_1atIndex_1, child !is null ? child.id : null, index); } public void insertChildren (NSArray children, NSUInteger index) { OS.objc_msgSend(this.id, OS.sel_insertChildren_1atIndex_1, children !is null ? children.id : null, index); } public bool isStandalone () { return OS.objc_msgSend(this.id, OS.sel_isStandalone) !is null; } public id objectByApplyingXSLT (NSData xslt, NSDictionary arguments, /*NSError** */objc.id** error) { objc.id result = OS.objc_msgSend(this.id, OS.sel_objectByApplyingXSLT_1arguments_1error_1, xslt !is null ? xslt.id : null, arguments !is null ? arguments.id : null, error); return result !is null ? new id(result) : null; } public id objectByApplyingXSLTAtURL (NSURL xsltURL, NSDictionary argument, /*NSError** */objc.id** error) { objc.id result = OS.objc_msgSend(this.id, OS.sel_objectByApplyingXSLTAtURL_1arguments_1error_1, xsltURL !is null ? xsltURL.id : null, argument !is null ? argument.id : null, error); return result !is null ? new id(result) : null; } public id objectByApplyingXSLTString (NSString xslt, NSDictionary arguments, /*NSError** */objc.id** error) { objc.id result = OS.objc_msgSend(this.id, OS.sel_objectByApplyingXSLTString_1arguments_1error_1, xslt !is null ? xslt.id : null, arguments !is null ? arguments.id : null, error); return result !is null ? new id(result) : null; } public void removeChildAtIndex (NSUInteger index) { OS.objc_msgSend(this.id, OS.sel_removeChildAtIndex_1, index); } public void replaceChildAtIndex (NSUInteger index, NSXMLNode node) { OS.objc_msgSend(this.id, OS.sel_replaceChildAtIndex_1withNode_1, index, node !is null ? node.id : null); } public static objc.Class replacementClassForClass (objc.Class cls) { return cast(objc.Class) OS.objc_msgSend(OS.class_NSXMLDocument, OS.sel_replacementClassForClass_1, cls); } public NSXMLElement rootElement () { objc.id result = OS.objc_msgSend(this.id, OS.sel_rootElement); return result !is null ? new NSXMLElement(result) : null; } public void setCharacterEncoding (NSString encoding) { OS.objc_msgSend(this.id, OS.sel_setCharacterEncoding_1, encoding !is null ? encoding.id : null); } public void setChildren (NSArray children) { OS.objc_msgSend(this.id, OS.sel_setChildren_1, children !is null ? children.id : null); } public void setDTD (NSXMLDTD documentTypeDeclaration) { OS.objc_msgSend(this.id, OS.sel_setDTD_1, documentTypeDeclaration !is null ? documentTypeDeclaration.id : null); } public void setDocumentContentKind (NSXMLDocumentContentKind kind) { OS.objc_msgSend(this.id, OS.sel_setDocumentContentKind_1, kind); } public void setMIMEType (NSString MIMEType) { OS.objc_msgSend(this.id, OS.sel_setMIMEType_1, MIMEType !is null ? MIMEType.id : null); } public void setRootElement (NSXMLNode root) { OS.objc_msgSend(this.id, OS.sel_setRootElement_1, root !is null ? root.id : null); } public void setStandalone (bool standalone) { OS.objc_msgSend(this.id, OS.sel_setStandalone_1, standalone); } public void setVersion (NSString versionn) { OS.objc_msgSend(this.id, OS.sel_setVersion_1, versionn !is null ? versionn.id : null); } public bool validateAndReturnError (/*NSError** */objc.id** error) { return OS.objc_msgSend(this.id, OS.sel_validateAndReturnError_1, error) !is null; } //public NSString version() { // objc.id result = OS.objc_msgSend(this.id, OS.sel_version); // return result !is null ? new NSString(result) : null; //} }