view dstep/foundation/NSSpellServer.d @ 14:89f3c3ef1fd2

Added the Foundation framework
author Jacob Carlborg <doob@me.com>
date Mon, 03 Aug 2009 15:23:15 +0200
parents
children 19885b43130e
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.NSSpellServer;

import dstep.foundation.NSArray;
import dstep.foundation.NSObject;
import dstep.foundation.NSRange;
import dstep.objc.bridge.Bridge;
import dstep.objc.objc : id;

import bindings = dstep.foundation.NSSpellServer_bindings;

const NSString NSGrammarRange;
const NSString NSGrammarUserDescription;
const NSString NSGrammarCorrections;

static this ()
{
	NSGrammarRange = new NSString(bindings.NSGrammarRange);
	NSGrammarUserDescription = new NSString(bindings.NSGrammarUserDescription);
	NSGrammarCorrections = new NSString(bindings.NSGrammarCorrections);
}

class NSSpellServer : NSObject
{
	mixin ObjcWrap;

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

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

	bool registerLanguage (NSString language, NSString vendor)
	{
		return invokeObjcSelf!(bool, "registerLanguage:byVendor:", NSString, NSString)(language, vendor);
	}

	bool isWordInUserDictionaries (NSString word, bool flag)
	{
		return invokeObjcSelf!(bool, "isWordInUserDictionaries:caseSensitive:", NSString, bool)(word, flag);
	}

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

template TNSSpellServerDelegate ()
{
	NSRange spellServer (NSSpellServer sender, NSString stringToCheck, NSString language, NSInteger* wordCount, bool countOnly);
	NSArray spellServer (NSSpellServer sender, NSString word, NSString language);
	void spellServer (NSSpellServer sender, NSString word, NSString language);
	void spellServer (NSSpellServer sender, NSString word, NSString language);
	NSArray spellServer (NSSpellServer sender, NSRange range, NSString string, NSString language);
	NSRange spellServer (NSSpellServer sender, NSString stringToCheck, NSString language, NSArray** details);
}