view dstep/appkit/NSSpeechRecognizer.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
children b9de51448c6b
line wrap: on
line source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Sep 24, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.appkit.NSSpeechRecognizer;

import dstep.appkit.AppKitDefines;
import dstep.foundation.NSArray;
import dstep.foundation.NSString;
import dstep.foundation.NSObject;
import dstep.objc.bridge.Bridge;
import dstep.objc.objc;

class NSSpeechRecognizer : NSObject
{
	mixin (ObjcWrap);

	NSSpeechRecognizer init ()
	{
		id result = invokeObjcSelf!(id, "init");
		return result is this.objcObject ? this : (result !is null ? new NSSpeechRecognizer(result) : null);
	}

	this ()
	{
		super(NSSpeechRecognizer.alloc.init.objcObject);
	}

	void startListening ()
	{
		return invokeObjcSelf!(void, "startListening");
	}

	void stopListening ()
	{
		return invokeObjcSelf!(void, "stopListening");
	}

	Object delegate_ ()
	{
		return invokeObjcSelf!(Object, "delegate");
	}

	void setDelegate (Object anObject)
	{
		return invokeObjcSelf!(void, "setDelegate:", Object)(anObject);
	}

	NSArray commands ()
	{
		return invokeObjcSelf!(NSArray, "commands");
	}

	void setCommands (NSArray commands)
	{
		return invokeObjcSelf!(void, "setCommands:", NSArray)(commands);
	}

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

	void setDisplayedCommandsTitle (NSString title)
	{
		return invokeObjcSelf!(void, "setDisplayedCommandsTitle:", NSString)(title);
	}

	bool listensInForegroundOnly ()
	{
		return invokeObjcSelf!(bool, "listensInForegroundOnly");
	}

	void setListensInForegroundOnly (bool flag)
	{
		return invokeObjcSelf!(void, "setListensInForegroundOnly:", bool)(flag);
	}

	bool blocksOtherRecognizers ()
	{
		return invokeObjcSelf!(bool, "blocksOtherRecognizers");
	}

	void setBlocksOtherRecognizers (bool flag)
	{
		return invokeObjcSelf!(void, "setBlocksOtherRecognizers:", bool)(flag);
	}
}

const TNSSpeechRecognizerDelegate = `

	void speechRecognizer (NSSpeechRecognizer sender, Object command)
	{
		return invokeObjcSelf!(void, "speechRecognizer:didRecognizeCommand:", NSSpeechRecognizer, Object)(sender, command);
	}

	//mixin ObjcBindMethod!(speechRecognizer, "speechRecognizer:didRecognizeCommand:");

`;