comparison dwt/internal/cocoa/NSURLHandle.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
48 super(id); 48 super(id);
49 } 49 }
50 50
51 public static objc.Class URLHandleClassForURL (NSURL anURL) 51 public static objc.Class URLHandleClassForURL (NSURL anURL)
52 { 52 {
53 return cast(objc.Class) OS.objc_msgSend(OS.class_NSURLHandle, OS.sel_URLHandleClassForURL_1, anURL !is null ? anURL.id : null); 53 return cast(objc.Class) OS.objc_msgSend(OS.class_NSURLHandle, OS.sel_URLHandleClassForURL_1, anURL !is null ? anURL.id_ : null);
54 } 54 }
55 55
56 public void addClient (id client) 56 public void addClient (id client)
57 { 57 {
58 OS.objc_msgSend(this.id, OS.sel_addClient_1, client !is null ? client.id : null); 58 OS.objc_msgSend(this.id_, OS.sel_addClient_1, client !is null ? client.id_ : null);
59 } 59 }
60 60
61 public NSData availableResourceData () 61 public NSData availableResourceData ()
62 { 62 {
63 objc.id result = OS.objc_msgSend(this.id, OS.sel_availableResourceData); 63 objc.id result = OS.objc_msgSend(this.id_, OS.sel_availableResourceData);
64 return result !is null ? new NSData(result) : null; 64 return result !is null ? new NSData(result) : null;
65 } 65 }
66 66
67 public void backgroundLoadDidFailWithReason (NSString reason) 67 public void backgroundLoadDidFailWithReason (NSString reason)
68 { 68 {
69 OS.objc_msgSend(this.id, OS.sel_backgroundLoadDidFailWithReason_1, reason !is null ? reason.id : null); 69 OS.objc_msgSend(this.id_, OS.sel_backgroundLoadDidFailWithReason_1, reason !is null ? reason.id_ : null);
70 } 70 }
71 71
72 public void beginLoadInBackground () 72 public void beginLoadInBackground ()
73 { 73 {
74 OS.objc_msgSend(this.id, OS.sel_beginLoadInBackground); 74 OS.objc_msgSend(this.id_, OS.sel_beginLoadInBackground);
75 } 75 }
76 76
77 public static NSURLHandle cachedHandleForURL (NSURL anURL) 77 public static NSURLHandle cachedHandleForURL (NSURL anURL)
78 { 78 {
79 objc.id result = OS.objc_msgSend(OS.class_NSURLHandle, OS.sel_cachedHandleForURL_1, anURL !is null ? anURL.id : null); 79 objc.id result = OS.objc_msgSend(OS.class_NSURLHandle, OS.sel_cachedHandleForURL_1, anURL !is null ? anURL.id_ : null);
80 return result !is null ? new NSURLHandle(result) : null; 80 return result !is null ? new NSURLHandle(result) : null;
81 } 81 }
82 82
83 public static bool canInitWithURL (NSURL anURL) 83 public static bool canInitWithURL (NSURL anURL)
84 { 84 {
85 return OS.objc_msgSend(OS.class_NSURLHandle, OS.sel_canInitWithURL_1, anURL !is null ? anURL.id : null) !is null; 85 return OS.objc_msgSend(OS.class_NSURLHandle, OS.sel_canInitWithURL_1, anURL !is null ? anURL.id_ : null) !is null;
86 } 86 }
87 87
88 public void cancelLoadInBackground () 88 public void cancelLoadInBackground ()
89 { 89 {
90 OS.objc_msgSend(this.id, OS.sel_cancelLoadInBackground); 90 OS.objc_msgSend(this.id_, OS.sel_cancelLoadInBackground);
91 } 91 }
92 92
93 public void didLoadBytes (NSData newBytes, bool yorn) 93 public void didLoadBytes (NSData newBytes, bool yorn)
94 { 94 {
95 OS.objc_msgSend(this.id, OS.sel_didLoadBytes_1loadComplete_1, newBytes !is null ? newBytes.id : null, yorn); 95 OS.objc_msgSend(this.id_, OS.sel_didLoadBytes_1loadComplete_1, newBytes !is null ? newBytes.id_ : null, yorn);
96 } 96 }
97 97
98 public void endLoadInBackground () 98 public void endLoadInBackground ()
99 { 99 {
100 OS.objc_msgSend(this.id, OS.sel_endLoadInBackground); 100 OS.objc_msgSend(this.id_, OS.sel_endLoadInBackground);
101 } 101 }
102 102
103 public long expectedResourceDataSize () 103 public long expectedResourceDataSize ()
104 { 104 {
105 return cast(long) OS.objc_msgSend(this.id, OS.sel_expectedResourceDataSize); 105 return cast(long) OS.objc_msgSend(this.id_, OS.sel_expectedResourceDataSize);
106 } 106 }
107 107
108 public NSString failureReason () 108 public NSString failureReason ()
109 { 109 {
110 objc.id result = OS.objc_msgSend(this.id, OS.sel_failureReason); 110 objc.id result = OS.objc_msgSend(this.id_, OS.sel_failureReason);
111 return result !is null ? new NSString(result) : null; 111 return result !is null ? new NSString(result) : null;
112 } 112 }
113 113
114 public void flushCachedData () 114 public void flushCachedData ()
115 { 115 {
116 OS.objc_msgSend(this.id, OS.sel_flushCachedData); 116 OS.objc_msgSend(this.id_, OS.sel_flushCachedData);
117 } 117 }
118 118
119 public id initWithURL (NSURL anURL, bool willCache) 119 public id initWithURL (NSURL anURL, bool willCache)
120 { 120 {
121 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithURL_1cached_1, anURL !is null ? anURL.id : null, willCache); 121 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithURL_1cached_1, anURL !is null ? anURL.id_ : null, willCache);
122 return result !is null ? new id(result) : null; 122 return result !is null ? new id(result) : null;
123 } 123 }
124 124
125 public void loadInBackground () 125 public void loadInBackground ()
126 { 126 {
127 OS.objc_msgSend(this.id, OS.sel_loadInBackground); 127 OS.objc_msgSend(this.id_, OS.sel_loadInBackground);
128 } 128 }
129 129
130 public NSData loadInForeground () 130 public NSData loadInForeground ()
131 { 131 {
132 objc.id result = OS.objc_msgSend(this.id, OS.sel_loadInForeground); 132 objc.id result = OS.objc_msgSend(this.id_, OS.sel_loadInForeground);
133 return result !is null ? new NSData(result) : null; 133 return result !is null ? new NSData(result) : null;
134 } 134 }
135 135
136 public id propertyForKey (NSString propertyKey) 136 public id propertyForKey (NSString propertyKey)
137 { 137 {
138 objc.id result = OS.objc_msgSend(this.id, OS.sel_propertyForKey_1, propertyKey !is null ? propertyKey.id : null); 138 objc.id result = OS.objc_msgSend(this.id_, OS.sel_propertyForKey_1, propertyKey !is null ? propertyKey.id_ : null);
139 return result !is null ? new id(result) : null; 139 return result !is null ? new id(result) : null;
140 } 140 }
141 141
142 public id propertyForKeyIfAvailable (NSString propertyKey) 142 public id propertyForKeyIfAvailable (NSString propertyKey)
143 { 143 {
144 objc.id result = OS.objc_msgSend(this.id, OS.sel_propertyForKeyIfAvailable_1, propertyKey !is null ? propertyKey.id : null); 144 objc.id result = OS.objc_msgSend(this.id_, OS.sel_propertyForKeyIfAvailable_1, propertyKey !is null ? propertyKey.id_ : null);
145 return result !is null ? new id(result) : null; 145 return result !is null ? new id(result) : null;
146 } 146 }
147 147
148 public static void registerURLHandleClass (objc.Class anURLHandleSubclass) 148 public static void registerURLHandleClass (objc.Class anURLHandleSubclass)
149 { 149 {
150 OS.objc_msgSend(OS.class_NSURLHandle, OS.sel_registerURLHandleClass_1, anURLHandleSubclass); 150 OS.objc_msgSend(OS.class_NSURLHandle, OS.sel_registerURLHandleClass_1, anURLHandleSubclass);
151 } 151 }
152 152
153 public void removeClient (id client) 153 public void removeClient (id client)
154 { 154 {
155 OS.objc_msgSend(this.id, OS.sel_removeClient_1, client !is null ? client.id : null); 155 OS.objc_msgSend(this.id_, OS.sel_removeClient_1, client !is null ? client.id_ : null);
156 } 156 }
157 157
158 public NSData resourceData () 158 public NSData resourceData ()
159 { 159 {
160 objc.id result = OS.objc_msgSend(this.id, OS.sel_resourceData); 160 objc.id result = OS.objc_msgSend(this.id_, OS.sel_resourceData);
161 return result !is null ? new NSData(result) : null; 161 return result !is null ? new NSData(result) : null;
162 } 162 }
163 163
164 public NSURLHandleStatus status () 164 public NSURLHandleStatus status ()
165 { 165 {
166 return cast(NSURLHandleStatus) OS.objc_msgSend(this.id, OS.sel_status); 166 return cast(NSURLHandleStatus) OS.objc_msgSend(this.id_, OS.sel_status);
167 } 167 }
168 168
169 public bool writeData (NSData data) 169 public bool writeData (NSData data)
170 { 170 {
171 return OS.objc_msgSend(this.id, OS.sel_writeData_1, data !is null ? data.id : null) !is null; 171 return OS.objc_msgSend(this.id_, OS.sel_writeData_1, data !is null ? data.id_ : null) !is null;
172 } 172 }
173 173
174 public bool writeProperty (id propertyValue, NSString propertyKey) 174 public bool writeProperty (id propertyValue, NSString propertyKey)
175 { 175 {
176 return OS.objc_msgSend(this.id, OS.sel_writeProperty_1forKey_1, propertyValue !is null ? propertyValue.id : null, 176 return OS.objc_msgSend(this.id_, OS.sel_writeProperty_1forKey_1, propertyValue !is null ? propertyValue.id_ : null,
177 propertyKey !is null ? propertyKey.id : null) !is null; 177 propertyKey !is null ? propertyKey.id_ : null) !is null;
178 } 178 }
179 179
180 } 180 }