comparison dwt/internal/cocoa/NSUserDefaults.d @ 1:8b48be5454ce

The internal cocoa classes compile now
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Tue, 19 Aug 2008 17:35:17 +0200
parents 380af2bdd8e5
children f565d3a95c0a
comparison
equal deleted inserted replaced
0:380af2bdd8e5 1:8b48be5454ce
36 super(id); 36 super(id);
37 } 37 }
38 38
39 public void addSuiteNamed (NSString suiteName) 39 public void addSuiteNamed (NSString suiteName)
40 { 40 {
41 OS.objc_msgSend(this.id, OS.sel_addSuiteNamed_1, suiteName !is null ? suiteName.id : null); 41 OS.objc_msgSend(this.id_, OS.sel_addSuiteNamed_1, suiteName !is null ? suiteName.id_ : null);
42 } 42 }
43 43
44 public NSArray arrayForKey (NSString defaultName) 44 public NSArray arrayForKey (NSString defaultName)
45 { 45 {
46 objc.id result = OS.objc_msgSend(this.id, OS.sel_arrayForKey_1, defaultName !is null ? defaultName.id : null); 46 objc.id result = OS.objc_msgSend(this.id_, OS.sel_arrayForKey_1, defaultName !is null ? defaultName.id_ : null);
47 return result !is null ? new NSArray(result) : null; 47 return result !is null ? new NSArray(result) : null;
48 } 48 }
49 49
50 public bool boolForKey (NSString defaultName) 50 public bool boolForKey (NSString defaultName)
51 { 51 {
52 return OS.objc_msgSend(this.id, OS.sel_boolForKey_1, defaultName !is null ? defaultName.id : null) !is null; 52 return OS.objc_msgSend(this.id_, OS.sel_boolForKey_1, defaultName !is null ? defaultName.id_ : null) !is null;
53 } 53 }
54 54
55 public NSData dataForKey (NSString defaultName) 55 public NSData dataForKey (NSString defaultName)
56 { 56 {
57 objc.id result = OS.objc_msgSend(this.id, OS.sel_dataForKey_1, defaultName !is null ? defaultName.id : null); 57 objc.id result = OS.objc_msgSend(this.id_, OS.sel_dataForKey_1, defaultName !is null ? defaultName.id_ : null);
58 return result !is null ? new NSData(result) : null; 58 return result !is null ? new NSData(result) : null;
59 } 59 }
60 60
61 public NSDictionary dictionaryForKey (NSString defaultName) 61 public NSDictionary dictionaryForKey (NSString defaultName)
62 { 62 {
63 objc.id result = OS.objc_msgSend(this.id, OS.sel_dictionaryForKey_1, defaultName !is null ? defaultName.id : null); 63 objc.id result = OS.objc_msgSend(this.id_, OS.sel_dictionaryForKey_1, defaultName !is null ? defaultName.id_ : null);
64 return result !is null ? new NSDictionary(result) : null; 64 return result !is null ? new NSDictionary(result) : null;
65 } 65 }
66 66
67 public NSDictionary dictionaryRepresentation () 67 public NSDictionary dictionaryRepresentation ()
68 { 68 {
69 objc.id result = OS.objc_msgSend(this.id, OS.sel_dictionaryRepresentation); 69 objc.id result = OS.objc_msgSend(this.id_, OS.sel_dictionaryRepresentation);
70 return result !is null ? new NSDictionary(result) : null; 70 return result !is null ? new NSDictionary(result) : null;
71 } 71 }
72 72
73 public double doubleForKey (NSString defaultName) 73 public double doubleForKey (NSString defaultName)
74 { 74 {
75 return cast(double) OS.objc_msgSend_fpret(this.id, OS.sel_doubleForKey_1, defaultName !is null ? defaultName.id : null); 75 return cast(double) OS.objc_msgSend_fpret(this.id_, OS.sel_doubleForKey_1, defaultName !is null ? defaultName.id_ : null);
76 } 76 }
77 77
78 public float floatForKey (NSString defaultName) 78 public float floatForKey (NSString defaultName)
79 { 79 {
80 return cast(float) OS.objc_msgSend_fpret(this.id, OS.sel_floatForKey_1, defaultName !is null ? defaultName.id : null); 80 return cast(float) OS.objc_msgSend_fpret(this.id_, OS.sel_floatForKey_1, defaultName !is null ? defaultName.id_ : null);
81 } 81 }
82 82
83 public id initWithUser (NSString username) 83 public id initWithUser (NSString username)
84 { 84 {
85 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithUser_1, username !is null ? username.id : null); 85 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithUser_1, username !is null ? username.id_ : null);
86 return result !is null ? new id(result) : null; 86 return result !is null ? new id(result) : null;
87 } 87 }
88 88
89 public NSInteger integerForKey (NSString defaultName) 89 public NSInteger integerForKey (NSString defaultName)
90 { 90 {
91 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_integerForKey_1, defaultName !is null ? defaultName.id : null); 91 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_integerForKey_1, defaultName !is null ? defaultName.id_ : null);
92 } 92 }
93 93
94 public id objectForKey (NSString defaultName) 94 public id objectForKey (NSString defaultName)
95 { 95 {
96 objc.id result = OS.objc_msgSend(this.id, OS.sel_objectForKey_1, defaultName !is null ? defaultName.id : null); 96 objc.id result = OS.objc_msgSend(this.id_, OS.sel_objectForKey_1, defaultName !is null ? defaultName.id_ : null);
97 return result !is null ? new id(result) : null; 97 return result !is null ? new id(result) : null;
98 } 98 }
99 99
100 public bool objectIsForcedForKey_ (NSString key) 100 public bool objectIsForcedForKey_ (NSString key)
101 { 101 {
102 return OS.objc_msgSend(this.id, OS.sel_objectIsForcedForKey_1, key !is null ? key.id : null) !is null; 102 return OS.objc_msgSend(this.id_, OS.sel_objectIsForcedForKey_1, key !is null ? key.id_ : null) !is null;
103 } 103 }
104 104
105 public bool objectIsForcedForKey_inDomain_ (NSString key, NSString domain) 105 public bool objectIsForcedForKey_inDomain_ (NSString key, NSString domain)
106 { 106 {
107 return OS.objc_msgSend(this.id, OS.sel_objectIsForcedForKey_1inDomain_1, key !is null ? key.id : null, domain !is null ? domain.id : null) !is null; 107 return OS.objc_msgSend(this.id_, OS.sel_objectIsForcedForKey_1inDomain_1, key !is null ? key.id_ : null, domain !is null ? domain.id_ : null) !is null;
108 } 108 }
109 109
110 public NSDictionary persistentDomainForName (NSString domainName) 110 public NSDictionary persistentDomainForName (NSString domainName)
111 { 111 {
112 objc.id result = OS.objc_msgSend(this.id, OS.sel_persistentDomainForName_1, domainName !is null ? domainName.id : null); 112 objc.id result = OS.objc_msgSend(this.id_, OS.sel_persistentDomainForName_1, domainName !is null ? domainName.id_ : null);
113 return result !is null ? new NSDictionary(result) : null; 113 return result !is null ? new NSDictionary(result) : null;
114 } 114 }
115 115
116 public NSArray persistentDomainNames () 116 public NSArray persistentDomainNames ()
117 { 117 {
118 objc.id result = OS.objc_msgSend(this.id, OS.sel_persistentDomainNames); 118 objc.id result = OS.objc_msgSend(this.id_, OS.sel_persistentDomainNames);
119 return result !is null ? new NSArray(result) : null; 119 return result !is null ? new NSArray(result) : null;
120 } 120 }
121 121
122 public void registerDefaults (NSDictionary registrationDictionary) 122 public void registerDefaults (NSDictionary registrationDictionary)
123 { 123 {
124 OS.objc_msgSend(this.id, OS.sel_registerDefaults_1, registrationDictionary !is null ? registrationDictionary.id : null); 124 OS.objc_msgSend(this.id_, OS.sel_registerDefaults_1, registrationDictionary !is null ? registrationDictionary.id_ : null);
125 } 125 }
126 126
127 public void removeObjectForKey (NSString defaultName) 127 public void removeObjectForKey (NSString defaultName)
128 { 128 {
129 OS.objc_msgSend(this.id, OS.sel_removeObjectForKey_1, defaultName !is null ? defaultName.id : null); 129 OS.objc_msgSend(this.id_, OS.sel_removeObjectForKey_1, defaultName !is null ? defaultName.id_ : null);
130 } 130 }
131 131
132 public void removePersistentDomainForName (NSString domainName) 132 public void removePersistentDomainForName (NSString domainName)
133 { 133 {
134 OS.objc_msgSend(this.id, OS.sel_removePersistentDomainForName_1, domainName !is null ? domainName.id : null); 134 OS.objc_msgSend(this.id_, OS.sel_removePersistentDomainForName_1, domainName !is null ? domainName.id_ : null);
135 } 135 }
136 136
137 public void removeSuiteNamed (NSString suiteName) 137 public void removeSuiteNamed (NSString suiteName)
138 { 138 {
139 OS.objc_msgSend(this.id, OS.sel_removeSuiteNamed_1, suiteName !is null ? suiteName.id : null); 139 OS.objc_msgSend(this.id_, OS.sel_removeSuiteNamed_1, suiteName !is null ? suiteName.id_ : null);
140 } 140 }
141 141
142 public void removeVolatileDomainForName (NSString domainName) 142 public void removeVolatileDomainForName (NSString domainName)
143 { 143 {
144 OS.objc_msgSend(this.id, OS.sel_removeVolatileDomainForName_1, domainName !is null ? domainName.id : null); 144 OS.objc_msgSend(this.id_, OS.sel_removeVolatileDomainForName_1, domainName !is null ? domainName.id_ : null);
145 } 145 }
146 146
147 public static void resetStandardUserDefaults () 147 public static void resetStandardUserDefaults ()
148 { 148 {
149 OS.objc_msgSend(OS.class_NSUserDefaults, OS.sel_resetStandardUserDefaults); 149 OS.objc_msgSend(OS.class_NSUserDefaults, OS.sel_resetStandardUserDefaults);
150 } 150 }
151 151
152 public void setBool (bool value, NSString defaultName) 152 public void setBool (bool value, NSString defaultName)
153 { 153 {
154 OS.objc_msgSend(this.id, OS.sel_setBool_1forKey_1, value, defaultName !is null ? defaultName.id : null); 154 OS.objc_msgSend(this.id_, OS.sel_setBool_1forKey_1, value, defaultName !is null ? defaultName.id_ : null);
155 } 155 }
156 156
157 public void setDouble (double value, NSString defaultName) 157 public void setDouble (double value, NSString defaultName)
158 { 158 {
159 OS.objc_msgSend(this.id, OS.sel_setDouble_1forKey_1, value, defaultName !is null ? defaultName.id : null); 159 OS.objc_msgSend(this.id_, OS.sel_setDouble_1forKey_1, value, defaultName !is null ? defaultName.id_ : null);
160 } 160 }
161 161
162 public void setFloat (float value, NSString defaultName) 162 public void setFloat (float value, NSString defaultName)
163 { 163 {
164 OS.objc_msgSend(this.id, OS.sel_setFloat_1forKey_1, value, defaultName !is null ? defaultName.id : null); 164 OS.objc_msgSend(this.id_, OS.sel_setFloat_1forKey_1, value, defaultName !is null ? defaultName.id_ : null);
165 } 165 }
166 166
167 public void setInteger (NSInteger value, NSString defaultName) 167 public void setInteger (NSInteger value, NSString defaultName)
168 { 168 {
169 OS.objc_msgSend(this.id, OS.sel_setInteger_1forKey_1, value, defaultName !is null ? defaultName.id : null); 169 OS.objc_msgSend(this.id_, OS.sel_setInteger_1forKey_1, value, defaultName !is null ? defaultName.id_ : null);
170 } 170 }
171 171
172 public void setObject (id value, NSString defaultName) 172 public void setObject (id value, NSString defaultName)
173 { 173 {
174 OS.objc_msgSend(this.id, OS.sel_setObject_1forKey_1, value !is null ? value.id : null, defaultName !is null ? defaultName.id : null); 174 OS.objc_msgSend(this.id_, OS.sel_setObject_1forKey_1, value !is null ? value.id_ : null, defaultName !is null ? defaultName.id_ : null);
175 } 175 }
176 176
177 public void setPersistentDomain (NSDictionary domain, NSString domainName) 177 public void setPersistentDomain (NSDictionary domain, NSString domainName)
178 { 178 {
179 OS.objc_msgSend(this.id, OS.sel_setPersistentDomain_1forName_1, domain !is null ? domain.id : null, 179 OS.objc_msgSend(this.id_, OS.sel_setPersistentDomain_1forName_1, domain !is null ? domain.id_ : null,
180 domainName !is null ? domainName.id : null); 180 domainName !is null ? domainName.id_ : null);
181 } 181 }
182 182
183 public void setVolatileDomain (NSDictionary domain, NSString domainName) 183 public void setVolatileDomain (NSDictionary domain, NSString domainName)
184 { 184 {
185 OS.objc_msgSend(this.id, OS.sel_setVolatileDomain_1forName_1, domain !is null ? domain.id : null, domainName !is null ? domainName.id : null); 185 OS.objc_msgSend(this.id_, OS.sel_setVolatileDomain_1forName_1, domain !is null ? domain.id_ : null, domainName !is null ? domainName.id_ : null);
186 } 186 }
187 187
188 public static NSUserDefaults standardUserDefaults () 188 public static NSUserDefaults standardUserDefaults ()
189 { 189 {
190 objc.id result = OS.objc_msgSend(OS.class_NSUserDefaults, OS.sel_standardUserDefaults); 190 objc.id result = OS.objc_msgSend(OS.class_NSUserDefaults, OS.sel_standardUserDefaults);
191 return result !is null ? new NSUserDefaults(result) : null; 191 return result !is null ? new NSUserDefaults(result) : null;
192 } 192 }
193 193
194 public NSArray stringArrayForKey (NSString defaultName) 194 public NSArray stringArrayForKey (NSString defaultName)
195 { 195 {
196 objc.id result = OS.objc_msgSend(this.id, OS.sel_stringArrayForKey_1, defaultName !is null ? defaultName.id : null); 196 objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringArrayForKey_1, defaultName !is null ? defaultName.id_ : null);
197 return result !is null ? new NSArray(result) : null; 197 return result !is null ? new NSArray(result) : null;
198 } 198 }
199 199
200 public NSString stringForKey (NSString defaultName) 200 public NSString stringForKey (NSString defaultName)
201 { 201 {
202 objc.id result = OS.objc_msgSend(this.id, OS.sel_stringForKey_1, defaultName !is null ? defaultName.id : null); 202 objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringForKey_1, defaultName !is null ? defaultName.id_ : null);
203 return result !is null ? new NSString(result) : null; 203 return result !is null ? new NSString(result) : null;
204 } 204 }
205 205
206 public bool synchronize () 206 public bool synchronize ()
207 { 207 {
208 return OS.objc_msgSend(this.id, OS.sel_synchronize) !is null; 208 return OS.objc_msgSend(this.id_, OS.sel_synchronize) !is null;
209 } 209 }
210 210
211 public NSDictionary volatileDomainForName (NSString domainName) 211 public NSDictionary volatileDomainForName (NSString domainName)
212 { 212 {
213 objc.id result = OS.objc_msgSend(this.id, OS.sel_volatileDomainForName_1, domainName !is null ? domainName.id : null); 213 objc.id result = OS.objc_msgSend(this.id_, OS.sel_volatileDomainForName_1, domainName !is null ? domainName.id_ : null);
214 return result !is null ? new NSDictionary(result) : null; 214 return result !is null ? new NSDictionary(result) : null;
215 } 215 }
216 216
217 public NSArray volatileDomainNames () 217 public NSArray volatileDomainNames ()
218 { 218 {
219 objc.id result = OS.objc_msgSend(this.id, OS.sel_volatileDomainNames); 219 objc.id result = OS.objc_msgSend(this.id_, OS.sel_volatileDomainNames);
220 return result !is null ? new NSArray(result) : null; 220 return result !is null ? new NSArray(result) : null;
221 } 221 }
222 222
223 } 223 }