Mercurial > projects > dstep
annotate dstep/foundation/NSURLCredential.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 | 7ff919f595d5 |
children | b9de51448c6b |
rev | line source |
---|---|
14 | 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.NSURLCredential; | |
8 | |
9 import dstep.foundation.NSObject; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
10 import dstep.foundation.NSObjCRuntime; |
14 | 11 import dstep.foundation.NSString; |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
12 import dstep.foundation.NSZone; |
14 | 13 import dstep.objc.bridge.Bridge; |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
14 import dstep.objc.objc; |
14 | 15 |
16 alias NSUInteger NSURLCredentialPersistence; | |
17 | |
18 enum | |
19 { | |
20 NSURLCredentialPersistenceNone, | |
21 NSURLCredentialPersistenceForSession, | |
22 NSURLCredentialPersistencePermanent | |
23 } | |
24 | |
25 class NSURLCredential : NSObject, INSCopying | |
26 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
27 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
28 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
29 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
30 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
31 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
32 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
33 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
34 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
35 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
36 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
37 } |
14 | 38 |
39 Object initWithUser (NSString user, NSString password, uint persistence) | |
40 { | |
41 return invokeObjcSelf!(Object, "initWithUser:password:persistence:", NSString, NSString, uint)(user, password, persistence); | |
42 } | |
43 | |
44 this (NSString user, NSString password, uint persistence) | |
45 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
46 typeof(this).alloc.initWithUser(user, password, persistence); |
14 | 47 } |
48 | |
49 static NSURLCredential credentialWithUser (NSString user, NSString password, uint persistence) | |
50 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
51 return invokeObjcSuperClass!(NSURLCredential, "credentialWithUser:password:persistence:", NSString, NSString, uint)(user, password, persistence); |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
52 } |
14 | 53 |
54 NSString user () | |
55 { | |
56 return invokeObjcSelf!(NSString, "user"); | |
57 } | |
58 | |
59 NSString password () | |
60 { | |
61 return invokeObjcSelf!(NSString, "password"); | |
62 } | |
63 | |
64 bool hasPassword () | |
65 { | |
66 return invokeObjcSelf!(bool, "hasPassword"); | |
67 } | |
68 | |
69 uint persistence () | |
70 { | |
71 return invokeObjcSelf!(uint, "persistence"); | |
72 } | |
73 | |
74 Object copyWithZone (NSZone* zone) | |
75 { | |
76 return invokeObjcSelf!(Object, "copyWithZone:", NSZone*)(zone); | |
77 } | |
78 } | |
79 |