Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSTokenFieldCell.d @ 0:380af2bdd8e5
Upload of whole dwt tree
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sat, 09 Aug 2008 17:00:02 +0200 |
parents | |
children | 8b48be5454ce |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:380af2bdd8e5 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2007 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * | |
11 * Port to the D Programming language: | |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | |
13 *******************************************************************************/ | |
14 module dwt.internal.cocoa.NSTokenFieldCell; | |
15 | |
16 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSCharacterSet; | |
18 import dwt.internal.cocoa.NSDate : NSTimeInterval; | |
19 import dwt.internal.cocoa.NSTextFieldCell; | |
20 import dwt.internal.cocoa.OS; | |
21 import objc = dwt.internal.objc.runtime; | |
22 | |
23 enum NSTokenStyle : NSUInteger | |
24 { | |
25 NSDefaultTokenStyle, | |
26 NSPlainTextTokenStyle, | |
27 NSRoundedTokenStyle | |
28 } | |
29 | |
30 alias NSTokenStyle.NSDefaultTokenStyle NSDefaultTokenStyle; | |
31 alias NSTokenStyle.NSPlainTextTokenStyle NSPlainTextTokenStyle; | |
32 alias NSTokenStyle.NSRoundedTokenStyle NSRoundedTokenStyle; | |
33 | |
34 public class NSTokenFieldCell : NSTextFieldCell | |
35 { | |
36 | |
37 public this () | |
38 { | |
39 super(); | |
40 } | |
41 | |
42 public this (objc.id id) | |
43 { | |
44 super(id); | |
45 } | |
46 | |
47 public NSTimeInterval completionDelay () | |
48 { | |
49 return cast(NSTimeInterval) OS.objc_msgSend_fpret(this.id, OS.sel_completionDelay); | |
50 } | |
51 | |
52 public static NSTimeInterval defaultCompletionDelay () | |
53 { | |
54 return cast(NSTimeInterval) OS.objc_msgSend_fpret(OS.class_NSTokenFieldCell, OS.sel_defaultCompletionDelay); | |
55 } | |
56 | |
57 public static NSCharacterSet defaultTokenizingCharacterSet () | |
58 { | |
59 objc.id result = OS.objc_msgSend(OS.class_NSTokenFieldCell, OS.sel_defaultTokenizingCharacterSet); | |
60 return result !is null ? new NSCharacterSet(result) : null; | |
61 } | |
62 | |
63 public id delegatee () | |
64 { | |
65 objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate); | |
66 return result !is null ? new id(result) : null; | |
67 } | |
68 | |
69 public void setCompletionDelay (NSTimeInterval delay) | |
70 { | |
71 OS.objc_msgSend(this.id, OS.sel_setCompletionDelay_1, delay); | |
72 } | |
73 | |
74 public void setDelegate (id anObject) | |
75 { | |
76 OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject !is null ? anObject.id : null); | |
77 } | |
78 | |
79 public void setTokenStyle (NSTokenStyle style) | |
80 { | |
81 OS.objc_msgSend(this.id, OS.sel_setTokenStyle_1, style); | |
82 } | |
83 | |
84 public void setTokenizingCharacterSet (NSCharacterSet characterSet) | |
85 { | |
86 OS.objc_msgSend(this.id, OS.sel_setTokenizingCharacterSet_1, characterSet !is null ? characterSet.id : null); | |
87 } | |
88 | |
89 public NSTokenStyle tokenStyle () | |
90 { | |
91 return cast(NSTokenStyle) OS.objc_msgSend(this.id, OS.sel_tokenStyle); | |
92 } | |
93 | |
94 public NSCharacterSet tokenizingCharacterSet () | |
95 { | |
96 objc.id result = OS.objc_msgSend(this.id, OS.sel_tokenizingCharacterSet); | |
97 return result !is null ? new NSCharacterSet(result) : null; | |
98 } | |
99 | |
100 } |