Mercurial > projects > dstep
comparison dstep/appkit/NSTokenFieldCell.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.NSTokenFieldCell; | |
8 | |
9 import dstep.appkit.NSTextContainer; | |
10 import dstep.appkit.NSTextFieldCell; | |
11 import dstep.foundation.Foundation; | |
12 import dstep.objc.bridge.Bridge; | |
13 import dstep.objc.objc; | |
14 | |
15 alias NSUInteger NSTokenStyle; | |
16 | |
17 enum | |
18 { | |
19 NSDefaultTokenStyle, | |
20 NSPlainTextTokenStyle, | |
21 NSRoundedTokenStyle | |
22 } | |
23 | |
24 class NSTokenFieldCell : NSTextFieldCell | |
25 { | |
26 mixin (ObjcWrap); | |
27 | |
28 void setTokenStyle (uint style) | |
29 { | |
30 return invokeObjcSelf!(void, "setTokenStyle:", uint)(style); | |
31 } | |
32 | |
33 uint tokenStyle () | |
34 { | |
35 return invokeObjcSelf!(uint, "tokenStyle"); | |
36 } | |
37 | |
38 void setCompletionDelay (double delay) | |
39 { | |
40 return invokeObjcSelf!(void, "setCompletionDelay:", double)(delay); | |
41 } | |
42 | |
43 double completionDelay () | |
44 { | |
45 return invokeObjcSelf!(double, "completionDelay"); | |
46 } | |
47 | |
48 static double defaultCompletionDelay () | |
49 { | |
50 return invokeObjcSelfClass!(double, "defaultCompletionDelay"); | |
51 } | |
52 | |
53 void setTokenizingCharacterSet (NSCharacterSet characterSet) | |
54 { | |
55 return invokeObjcSelf!(void, "setTokenizingCharacterSet:", NSCharacterSet)(characterSet); | |
56 } | |
57 | |
58 NSCharacterSet tokenizingCharacterSet () | |
59 { | |
60 return invokeObjcSelf!(NSCharacterSet, "tokenizingCharacterSet"); | |
61 } | |
62 | |
63 static NSCharacterSet defaultTokenizingCharacterSet () | |
64 { | |
65 return invokeObjcSelfClass!(NSCharacterSet, "defaultTokenizingCharacterSet"); | |
66 } | |
67 | |
68 void setDelegate (Object anObject) | |
69 { | |
70 return invokeObjcSelf!(void, "setDelegate:", Object)(anObject); | |
71 } | |
72 | |
73 Object delegate_ () | |
74 { | |
75 return invokeObjcSelf!(Object, "delegate"); | |
76 } | |
77 } | |
78 | |
79 const TNSTokenFieldCellDelegate = ` | |
80 | |
81 NSArray tokenFieldCell (NSTokenFieldCell tokenFieldCell, NSString substring, NSInteger tokenIndex, NSInteger* selectedIndex) | |
82 { | |
83 return invokeObjcSelf!(NSArray, "tokenFieldCell:completionsForSubstring:indexOfToken:indexOfSelectedItem:", NSTokenFieldCell, NSString, NSInteger, NSInteger*)(tokenFieldCell, substring, tokenIndex, selectedIndex); | |
84 } | |
85 | |
86 NSArray tokenFieldCell (NSTokenFieldCell tokenFieldCell, NSArray tokens, NSUInteger index) | |
87 { | |
88 return invokeObjcSelf!(NSArray, "tokenFieldCell:shouldAddObjects:atIndex:", NSTokenFieldCell, NSArray, NSUInteger)(tokenFieldCell, tokens, index); | |
89 } | |
90 | |
91 NSString tokenFieldCell (NSTokenFieldCell tokenFieldCell, Object representedObject) | |
92 { | |
93 return invokeObjcSelf!(NSString, "tokenFieldCell:displayStringForRepresentedObject:", NSTokenFieldCell, Object)(tokenFieldCell, representedObject); | |
94 } | |
95 | |
96 NSString tokenFieldCell (NSTokenFieldCell tokenFieldCell, Object representedObject) | |
97 { | |
98 return invokeObjcSelf!(NSString, "tokenFieldCell:editingStringForRepresentedObject:", NSTokenFieldCell, Object)(tokenFieldCell, representedObject); | |
99 } | |
100 | |
101 Object tokenFieldCell (NSTokenFieldCell tokenFieldCell, NSString editingString) | |
102 { | |
103 return invokeObjcSelf!(Object, "tokenFieldCell:representedObjectForEditingString:", NSTokenFieldCell, NSString)(tokenFieldCell, editingString); | |
104 } | |
105 | |
106 bool tokenFieldCell (NSTokenFieldCell tokenFieldCell, NSArray objects, NSPasteboard pboard) | |
107 { | |
108 return invokeObjcSelf!(bool, "tokenFieldCell:writeRepresentedObjects:toPasteboard:", NSTokenFieldCell, NSArray, NSPasteboard)(tokenFieldCell, objects, pboard); | |
109 } | |
110 | |
111 NSArray tokenFieldCell (NSTokenFieldCell tokenFieldCell, NSPasteboard pboard) | |
112 { | |
113 return invokeObjcSelf!(NSArray, "tokenFieldCell:readFromPasteboard:", NSTokenFieldCell, NSPasteboard)(tokenFieldCell, pboard); | |
114 } | |
115 | |
116 NSMenu tokenFieldCell (NSTokenFieldCell tokenFieldCell, Object representedObject) | |
117 { | |
118 return invokeObjcSelf!(NSMenu, "tokenFieldCell:menuForRepresentedObject:", NSTokenFieldCell, Object)(tokenFieldCell, representedObject); | |
119 } | |
120 | |
121 bool tokenFieldCell (NSTokenFieldCell tokenFieldCell, Object representedObject) | |
122 { | |
123 return invokeObjcSelf!(bool, "tokenFieldCell:hasMenuForRepresentedObject:", NSTokenFieldCell, Object)(tokenFieldCell, representedObject); | |
124 } | |
125 | |
126 uint tokenFieldCell (NSTokenFieldCell tokenFieldCell, Object representedObject) | |
127 { | |
128 return invokeObjcSelf!(uint, "tokenFieldCell:styleForRepresentedObject:", NSTokenFieldCell, Object)(tokenFieldCell, representedObject); | |
129 } | |
130 | |
131 //mixin ObjcBindMethod!(tokenFieldCell, "tokenFieldCell:completionsForSubstring:indexOfToken:indexOfSelectedItem:"); | |
132 //mixin ObjcBindMethod!(tokenFieldCell, "tokenFieldCell:shouldAddObjects:atIndex:"); | |
133 //mixin ObjcBindMethod!(tokenFieldCell, "tokenFieldCell:displayStringForRepresentedObject:"); | |
134 //mixin ObjcBindMethod!(tokenFieldCell, "tokenFieldCell:editingStringForRepresentedObject:"); | |
135 //mixin ObjcBindMethod!(tokenFieldCell, "tokenFieldCell:representedObjectForEditingString:"); | |
136 //mixin ObjcBindMethod!(tokenFieldCell, "tokenFieldCell:writeRepresentedObjects:toPasteboard:"); | |
137 //mixin ObjcBindMethod!(tokenFieldCell, "tokenFieldCell:readFromPasteboard:"); | |
138 //mixin ObjcBindMethod!(tokenFieldCell, "tokenFieldCell:menuForRepresentedObject:"); | |
139 //mixin ObjcBindMethod!(tokenFieldCell, "tokenFieldCell:hasMenuForRepresentedObject:"); | |
140 //mixin ObjcBindMethod!(tokenFieldCell, "tokenFieldCell:styleForRepresentedObject:"); | |
141 | |
142 `; | |
143 |