view dstep/foundation/NSAppleEventDescriptor.d @ 16:19885b43130e

Huge update, the bridge actually works now
author Jacob Carlborg <doob@me.com>
date Sun, 03 Jan 2010 22:06:11 +0100
parents 7ff919f595d5
children b9de51448c6b
line wrap: on
line source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Aug 3, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.foundation.NSAppleEventDescriptor;

//import dstep.applicationservices.ApplicationServices;
import dstep.coreservices.ae.AEDataModel;
import dstep.foundation.NSData;
import dstep.foundation.NSObjCRuntime;
import dstep.foundation.NSObject;
import dstep.foundation.NSString;
import dstep.foundation.NSZone;
import dstep.objc.bridge.Bridge;
import dstep.objc.objc;

class NSAppleEventDescriptor : NSObject, INSCopying
{
	mixin (ObjcWrap);
	
	this ()
	{
		super(typeof(this).alloc.init.objcObject);
	}
	
	typeof(this) init ()
	{
		return invokeObjcSelf!(typeof(this), "init");
	}

	static NSAppleEventDescriptor nullDescriptor ()
	{
		return invokeObjcSuperClass!(NSAppleEventDescriptor, "nullDescriptor");
	}

	static NSAppleEventDescriptor descriptorWithDescriptorType (uint descriptorType, void* bytes, NSUInteger byteCount)
	{
		return invokeObjcSuperClass!(NSAppleEventDescriptor, "descriptorWithDescriptorType:bytes:length:", uint, void*, NSUInteger)(descriptorType, bytes, byteCount);
	}

	static NSAppleEventDescriptor descriptorWithDescriptorType (uint descriptorType, NSData data)
	{
		return invokeObjcSuperClass!(NSAppleEventDescriptor, "descriptorWithDescriptorType:data:", uint, NSData)(descriptorType, data);
	}

	static NSAppleEventDescriptor descriptorWithBoolean (ubyte boolean)
	{
		return invokeObjcSuperClass!(NSAppleEventDescriptor, "descriptorWithBoolean:", ubyte)(boolean);
	}

	static NSAppleEventDescriptor descriptorWithEnumCode (uint enumerator)
	{
		return invokeObjcSuperClass!(NSAppleEventDescriptor, "descriptorWithEnumCode:", uint)(enumerator);
	}

	static NSAppleEventDescriptor descriptorWithInt32 (int signedInt)
	{
		return invokeObjcSuperClass!(NSAppleEventDescriptor, "descriptorWithInt32:", int)(signedInt);
	}

	static NSAppleEventDescriptor descriptorWithTypeCode (uint typeCode)
	{
		return invokeObjcSuperClass!(NSAppleEventDescriptor, "descriptorWithTypeCode:", uint)(typeCode);
	}

	static NSAppleEventDescriptor descriptorWithString (NSString string)
	{
		return invokeObjcSuperClass!(NSAppleEventDescriptor, "descriptorWithString:", NSString)(string);
	}

	static NSAppleEventDescriptor appleEventWithEventClass (uint eventClass, uint eventID, NSAppleEventDescriptor targetDescriptor, short returnID, int transactionID)
	{
		return invokeObjcSuperClass!(NSAppleEventDescriptor, "appleEventWithEventClass:eventID:targetDescriptor:returnID:transactionID:", uint, uint, NSAppleEventDescriptor, short, int)(eventClass, eventID, targetDescriptor, returnID, transactionID);
	}

	static NSAppleEventDescriptor listDescriptor ()
	{
		return invokeObjcSuperClass!(NSAppleEventDescriptor, "listDescriptor");
	}

	static NSAppleEventDescriptor recordDescriptor ()
	{
		return invokeObjcSuperClass!(NSAppleEventDescriptor, "recordDescriptor");
	}

	Object initWithAEDescNoCopy (AEDesc* aeDesc)
	{
		return invokeObjcSelf!(Object, "initWithAEDescNoCopy:", AEDesc*)(aeDesc);
	}

	this (AEDesc* aeDesc)
	{
		typeof(this).alloc.initWithAEDescNoCopy(aeDesc);
	}

	Object initWithDescriptorType (uint descriptorType, void* bytes, NSUInteger byteCount)
	{
		return invokeObjcSelf!(Object, "initWithDescriptorType:bytes:length:", uint, void*, NSUInteger)(descriptorType, bytes, byteCount);
	}

	this (uint descriptorType, void* bytes, NSUInteger byteCount)
	{		
		typeof(this).alloc.initWithDescriptorType(descriptorType, bytes, byteCount);
	}

	Object initWithDescriptorType (uint descriptorType, NSData data)
	{
		return invokeObjcSelf!(Object, "initWithDescriptorType:data:", uint, NSData)(descriptorType, data);
	}

	this (uint descriptorType, NSData data)
	{
		typeof(this).alloc.initWithDescriptorType(descriptorType, data);
	}

	Object initWithEventClass (uint eventClass, uint eventID, NSAppleEventDescriptor targetDescriptor, short returnID, int transactionID)
	{
		return invokeObjcSelf!(Object, "initWithEventClass:eventID:targetDescriptor:returnID:transactionID:", uint, uint, NSAppleEventDescriptor, short, int)(eventClass, eventID, targetDescriptor, returnID, transactionID);
	}

	this (uint eventClass, uint eventID, NSAppleEventDescriptor targetDescriptor, short returnID, int transactionID)
	{
		typeof(this).alloc.initWithEventClass(eventClass, eventID, targetDescriptor, returnID, transactionID);
	}

	Object initListDescriptor ()
	{
		return invokeObjcSelf!(Object, "initListDescriptor");
	}

	Object initRecordDescriptor ()
	{
		return invokeObjcSelf!(Object, "initRecordDescriptor");
	}

	AEDesc* aeDesc ()
	{
		return invokeObjcSelf!(AEDesc*, "aeDesc");
	}

	uint descriptorType ()
	{
		return invokeObjcSelf!(uint, "descriptorType");
	}

	NSData data ()
	{
		return invokeObjcSelf!(NSData, "data");
	}

	ubyte booleanValue ()
	{
		return invokeObjcSelf!(ubyte, "booleanValue");
	}

	uint enumCodeValue ()
	{
		return invokeObjcSelf!(uint, "enumCodeValue");
	}

	int int32Value ()
	{
		return invokeObjcSelf!(int, "int32Value");
	}

	uint typeCodeValue ()
	{
		return invokeObjcSelf!(uint, "typeCodeValue");
	}

	NSString stringValue ()
	{
		return invokeObjcSelf!(NSString, "stringValue");
	}

	uint eventClass ()
	{
		return invokeObjcSelf!(uint, "eventClass");
	}

	uint eventID ()
	{
		return invokeObjcSelf!(uint, "eventID");
	}

	short returnID ()
	{
		return invokeObjcSelf!(short, "returnID");
	}

	int transactionID ()
	{
		return invokeObjcSelf!(int, "transactionID");
	}

	void setParamDescriptor (NSAppleEventDescriptor descriptor, uint keyword)
	{
		return invokeObjcSelf!(void, "setParamDescriptor:forKeyword:", NSAppleEventDescriptor, uint)(descriptor, keyword);
	}

	NSAppleEventDescriptor paramDescriptorForKeyword (uint keyword)
	{
		id result = invokeObjcSelf!(id, "paramDescriptorForKeyword:", uint)(keyword);
		return result is this.objcObject ? this : (result !is null ? new NSAppleEventDescriptor(result) : null);
	}

	void removeParamDescriptorWithKeyword (uint keyword)
	{
		return invokeObjcSelf!(void, "removeParamDescriptorWithKeyword:", uint)(keyword);
	}

	void setAttributeDescriptor (NSAppleEventDescriptor descriptor, uint keyword)
	{
		return invokeObjcSelf!(void, "setAttributeDescriptor:forKeyword:", NSAppleEventDescriptor, uint)(descriptor, keyword);
	}

	NSAppleEventDescriptor attributeDescriptorForKeyword (uint keyword)
	{
		id result = invokeObjcSelf!(id, "attributeDescriptorForKeyword:", uint)(keyword);
		return result is this.objcObject ? this : (result !is null ? new NSAppleEventDescriptor(result) : null);
	}

	NSInteger numberOfItems ()
	{
		return invokeObjcSelf!(NSInteger, "numberOfItems");
	}

	void insertDescriptor (NSAppleEventDescriptor descriptor, NSInteger index)
	{
		return invokeObjcSelf!(void, "insertDescriptor:atIndex:", NSAppleEventDescriptor, NSInteger)(descriptor, index);
	}

	NSAppleEventDescriptor descriptorAtIndex (NSInteger index)
	{
		id result = invokeObjcSelf!(id, "descriptorAtIndex:", NSInteger)(index);
		return result is this.objcObject ? this : (result !is null ? new NSAppleEventDescriptor(result) : null);
	}

	void removeDescriptorAtIndex (NSInteger index)
	{
		return invokeObjcSelf!(void, "removeDescriptorAtIndex:", NSInteger)(index);
	}

	void setDescriptor (NSAppleEventDescriptor descriptor, uint keyword)
	{
		return invokeObjcSelf!(void, "setDescriptor:forKeyword:", NSAppleEventDescriptor, uint)(descriptor, keyword);
	}

	NSAppleEventDescriptor descriptorForKeyword (uint keyword)
	{
		id result = invokeObjcSelf!(id, "descriptorForKeyword:", uint)(keyword);
		return result is this.objcObject ? this : (result !is null ? new NSAppleEventDescriptor(result) : null);
	}

	void removeDescriptorWithKeyword (uint keyword)
	{
		return invokeObjcSelf!(void, "removeDescriptorWithKeyword:", uint)(keyword);
	}

	uint keywordForDescriptorAtIndex (NSInteger index)
	{
		return invokeObjcSelf!(uint, "keywordForDescriptorAtIndex:", NSInteger)(index);
	}

	NSAppleEventDescriptor coerceToDescriptorType (uint descriptorType)
	{
		id result = invokeObjcSelf!(id, "coerceToDescriptorType:", uint)(descriptorType);
		return result is this.objcObject ? this : (result !is null ? new NSAppleEventDescriptor(result) : null);
	}

	Object copyWithZone (NSZone* zone)
	{
		return invokeObjcSelf!(Object, "copyWithZone:", NSZone*)(zone);
	}
}