Mercurial > projects > dstep
comparison 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 |
comparison
equal
deleted
inserted
replaced
15:7ff919f595d5 | 16:19885b43130e |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Sep 24, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.appkit.NSSpeechRecognizer; | |
8 | |
9 import dstep.appkit.AppKitDefines; | |
10 import dstep.foundation.NSArray; | |
11 import dstep.foundation.NSString; | |
12 import dstep.foundation.NSObject; | |
13 import dstep.objc.bridge.Bridge; | |
14 import dstep.objc.objc; | |
15 | |
16 class NSSpeechRecognizer : NSObject | |
17 { | |
18 mixin (ObjcWrap); | |
19 | |
20 NSSpeechRecognizer init () | |
21 { | |
22 id result = invokeObjcSelf!(id, "init"); | |
23 return result is this.objcObject ? this : (result !is null ? new NSSpeechRecognizer(result) : null); | |
24 } | |
25 | |
26 this () | |
27 { | |
28 super(NSSpeechRecognizer.alloc.init.objcObject); | |
29 } | |
30 | |
31 void startListening () | |
32 { | |
33 return invokeObjcSelf!(void, "startListening"); | |
34 } | |
35 | |
36 void stopListening () | |
37 { | |
38 return invokeObjcSelf!(void, "stopListening"); | |
39 } | |
40 | |
41 Object delegate_ () | |
42 { | |
43 return invokeObjcSelf!(Object, "delegate"); | |
44 } | |
45 | |
46 void setDelegate (Object anObject) | |
47 { | |
48 return invokeObjcSelf!(void, "setDelegate:", Object)(anObject); | |
49 } | |
50 | |
51 NSArray commands () | |
52 { | |
53 return invokeObjcSelf!(NSArray, "commands"); | |
54 } | |
55 | |
56 void setCommands (NSArray commands) | |
57 { | |
58 return invokeObjcSelf!(void, "setCommands:", NSArray)(commands); | |
59 } | |
60 | |
61 NSString displayedCommandsTitle () | |
62 { | |
63 return invokeObjcSelf!(NSString, "displayedCommandsTitle"); | |
64 } | |
65 | |
66 void setDisplayedCommandsTitle (NSString title) | |
67 { | |
68 return invokeObjcSelf!(void, "setDisplayedCommandsTitle:", NSString)(title); | |
69 } | |
70 | |
71 bool listensInForegroundOnly () | |
72 { | |
73 return invokeObjcSelf!(bool, "listensInForegroundOnly"); | |
74 } | |
75 | |
76 void setListensInForegroundOnly (bool flag) | |
77 { | |
78 return invokeObjcSelf!(void, "setListensInForegroundOnly:", bool)(flag); | |
79 } | |
80 | |
81 bool blocksOtherRecognizers () | |
82 { | |
83 return invokeObjcSelf!(bool, "blocksOtherRecognizers"); | |
84 } | |
85 | |
86 void setBlocksOtherRecognizers (bool flag) | |
87 { | |
88 return invokeObjcSelf!(void, "setBlocksOtherRecognizers:", bool)(flag); | |
89 } | |
90 } | |
91 | |
92 const TNSSpeechRecognizerDelegate = ` | |
93 | |
94 void speechRecognizer (NSSpeechRecognizer sender, Object command) | |
95 { | |
96 return invokeObjcSelf!(void, "speechRecognizer:didRecognizeCommand:", NSSpeechRecognizer, Object)(sender, command); | |
97 } | |
98 | |
99 //mixin ObjcBindMethod!(speechRecognizer, "speechRecognizer:didRecognizeCommand:"); | |
100 | |
101 `; | |
102 |