comparison dstep/coreservices/osservices/CSIdentity.d @ 11:07194b026fa4

Added bindings to a couple of frameworks, new license + some other things
author Jacob Carlborg <doob@me.com>
date Sat, 01 Aug 2009 15:03:28 +0200
parents
children
comparison
equal deleted inserted replaced
10:27e00625790b 11:07194b026fa4
1 /**
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
3 * Authors: Jacob Carlborg
4 * Version: Initial created: Jul 22, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */
7 module dstep.coreservices.osservices.CSIdentity;
8
9 //import dstep.AvailabilityMacros;
10 import dstep.corefoundation.CoreFoundation;
11 import dstep.coreservices.osservices.CSIdentityAuthority;
12 import dstep.security.Authorization;
13 import dstep.security.SecBase;
14 //import dstep.sys.types;
15
16 struct __CSIdentity;
17 struct __CSIdentityQuery;
18
19 alias __CSIdentity* CSIdentityRef;
20 alias __CSIdentityQuery* CSIdentityQueryRef;
21 alias int CSIdentityClass;
22 alias uint CSIdentityFlags;
23
24 extern (C)
25 {
26 alias void function (CSIdentityRef, int, CFErrorRef, void*) CSIdentityStatusUpdatedCallback;
27 }
28
29 extern (C)
30 {
31 extern
32 {
33 const CFStringRef kCSIdentityErrorDomain;
34 const CFStringRef kCSIdentityGeneratePosixName;
35 }
36 }
37
38 enum
39 {
40 kCSIdentityUnknownAuthorityErr = -1,
41 kCSIdentityAuthorityNotAccessibleErr = -2,
42 kCSIdentityPermissionErr = -3,
43 kCSIdentityDeletedErr = -4,
44 kCSIdentityInvalidFullNameErr = -5,
45 kCSIdentityDuplicateFullNameErr = -6,
46 kCSIdentityInvalidPosixNameErr = -7,
47 kCSIdentityDuplicatePosixNameErr = -8
48 }
49
50 enum
51 {
52 kCSIdentityClassUser = 1,
53 kCSIdentityClassGroup = 2
54 }
55
56 enum
57 {
58 kCSIdentityFlagNone = 0,
59 kCSIdentityFlagHidden = 1
60 }
61
62 enum
63 {
64 kCSIdentityCommitCompleted = 1
65 }
66
67 struct CSIdentityClientContext
68 {
69 int version_;
70 void* info;
71 CFAllocatorRetainCallBack retain;
72 CFAllocatorReleaseCallBack release;
73 CFAllocatorCopyDescriptionCallBack copyDescription;
74 CSIdentityStatusUpdatedCallback statusUpdated;
75 }
76
77 extern (C)
78 {
79 uint CSIdentityGetTypeID ();
80 CSIdentityRef CSIdentityCreate (CFAllocatorRef allocator, int identityClass, CFStringRef fullName, CFStringRef posixName, uint flags, CSIdentityAuthorityRef authority);
81 CSIdentityRef CSIdentityCreateCopy (CFAllocatorRef allocator, CSIdentityRef identity);
82 int CSIdentityGetClass (CSIdentityRef identity);
83 CSIdentityAuthorityRef CSIdentityGetAuthority (CSIdentityRef identity);
84 CFUUIDRef CSIdentityGetUUID (CSIdentityRef identity);
85 CFStringRef CSIdentityGetFullName (CSIdentityRef identity);
86 uint CSIdentityGetPosixID (CSIdentityRef identity);
87 CFStringRef CSIdentityGetPosixName (CSIdentityRef identity);
88 CFStringRef CSIdentityGetEmailAddress (CSIdentityRef identity);
89 CFURLRef CSIdentityGetImageURL (CSIdentityRef identity);
90 CFDataRef CSIdentityGetImageData (CSIdentityRef identity);
91 CFStringRef CSIdentityGetImageDataType (CSIdentityRef identity);
92 CFArrayRef CSIdentityGetAliases (CSIdentityRef identity);
93 ubyte CSIdentityIsMemberOfGroup (CSIdentityRef identity, CSIdentityRef group);
94 ubyte CSIdentityIsHidden (CSIdentityRef identity);
95 CFDataRef CSIdentityCreatePersistentReference (CFAllocatorRef allocator, CSIdentityRef identity);
96 ubyte CSIdentityIsEnabled (CSIdentityRef user);
97 ubyte CSIdentityAuthenticateUsingPassword (CSIdentityRef user, CFStringRef password);
98 SecCertificateRef CSIdentityGetCertificate (CSIdentityRef user);
99 CSIdentityQueryRef CSIdentityCreateGroupMembershipQuery (CFAllocatorRef allocator, CSIdentityRef group);
100 void CSIdentitySetFullName (CSIdentityRef identity, CFStringRef fullName);
101 void CSIdentitySetEmailAddress (CSIdentityRef identity, CFStringRef emailAddress);
102 void CSIdentitySetImageURL (CSIdentityRef identity, CFURLRef url);
103 void CSIdentitySetImageData (CSIdentityRef identity, CFDataRef imageData, CFStringRef imageDataType);
104 void CSIdentityAddAlias (CSIdentityRef identity, CFStringRef alias_);
105 void CSIdentityRemoveAlias (CSIdentityRef identity, CFStringRef alias_);
106 void CSIdentityAddMember (CSIdentityRef group, CSIdentityRef member);
107 void CSIdentityRemoveMember (CSIdentityRef group, CSIdentityRef member);
108 void CSIdentitySetIsEnabled (CSIdentityRef user, ubyte isEnabled);
109 void CSIdentitySetPassword (CSIdentityRef user, CFStringRef password);
110 void CSIdentitySetCertificate (CSIdentityRef user, SecCertificateRef certificate);
111 void CSIdentityDelete (CSIdentityRef identity);
112 ubyte CSIdentityCommit (CSIdentityRef identity, AuthorizationRef authorization, CFErrorRef* error);
113 ubyte CSIdentityCommitAsynchronously (CSIdentityRef identity, CSIdentityClientContext* clientContext, CFRunLoopRef runLoop, CFStringRef runLoopMode, AuthorizationRef authorization);
114 ubyte CSIdentityIsCommitting (CSIdentityRef identity);
115 void CSIdentityRemoveClient (CSIdentityRef identity);
116 }