comparison 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
comparison
equal deleted inserted replaced
13:4f583f7e242e 14:89f3c3ef1fd2
1 /**
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
3 * Authors: Jacob Carlborg
4 * Version: Initial created: Aug 3, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */
7 module dstep.foundation.NSSpellServer;
8
9 import dstep.foundation.NSArray;
10 import dstep.foundation.NSObject;
11 import dstep.foundation.NSRange;
12 import dstep.objc.bridge.Bridge;
13 import dstep.objc.objc : id;
14
15 import bindings = dstep.foundation.NSSpellServer_bindings;
16
17 const NSString NSGrammarRange;
18 const NSString NSGrammarUserDescription;
19 const NSString NSGrammarCorrections;
20
21 static this ()
22 {
23 NSGrammarRange = new NSString(bindings.NSGrammarRange);
24 NSGrammarUserDescription = new NSString(bindings.NSGrammarUserDescription);
25 NSGrammarCorrections = new NSString(bindings.NSGrammarCorrections);
26 }
27
28 class NSSpellServer : NSObject
29 {
30 mixin ObjcWrap;
31
32 void setDelegate (Object anObject)
33 {
34 return invokeObjcSelf!(void, "setDelegate:", Object)(anObject);
35 }
36
37 Object delegate_ ()
38 {
39 return invokeObjcSelf!(Object, "delegate");
40 }
41
42 bool registerLanguage (NSString language, NSString vendor)
43 {
44 return invokeObjcSelf!(bool, "registerLanguage:byVendor:", NSString, NSString)(language, vendor);
45 }
46
47 bool isWordInUserDictionaries (NSString word, bool flag)
48 {
49 return invokeObjcSelf!(bool, "isWordInUserDictionaries:caseSensitive:", NSString, bool)(word, flag);
50 }
51
52 void run ()
53 {
54 return invokeObjcSelf!(void, "run");
55 }
56 }
57
58 template TNSSpellServerDelegate ()
59 {
60 NSRange spellServer (NSSpellServer sender, NSString stringToCheck, NSString language, NSInteger* wordCount, bool countOnly);
61 NSArray spellServer (NSSpellServer sender, NSString word, NSString language);
62 void spellServer (NSSpellServer sender, NSString word, NSString language);
63 void spellServer (NSSpellServer sender, NSString word, NSString language);
64 NSArray spellServer (NSSpellServer sender, NSRange range, NSString string, NSString language);
65 NSRange spellServer (NSSpellServer sender, NSString stringToCheck, NSString language, NSArray** details);
66 }
67