~ubuntu-branches/ubuntu/trusty/gnustep-base/trusty

« back to all changes in this revision

Viewing changes to Headers/Foundation/NSConnection.h

Tags: upstream-1.11.2
ImportĀ upstreamĀ versionĀ 1.11.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
   
20
20
   You should have received a copy of the GNU Library General Public
21
21
   License along with this library; if not, write to the Free
22
 
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
 
22
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
23
23
   */ 
24
24
 
25
25
#ifndef __NSConnection_h_GNUSTEP_BASE_INCLUDE
94
94
  BOOL                  _authenticateIn;
95
95
  BOOL                  _authenticateOut;
96
96
  BOOL                  _multipleThreads;
 
97
  BOOL                  _shuttingDown;
 
98
  BOOL                  _dummy1;
 
99
  BOOL                  _dummy2;
97
100
  NSPort                *_receivePort;
98
101
  NSPort                *_sendPort;
99
102
  unsigned              _requestDepth;
183
186
 
184
187
/**
185
188
 *  Alternative convenience constructor, not specified in OpenStep, where you
186
 
 *  registe root anObject under given name in one step.
 
189
 *  register root anObject under given name in one step.
187
190
 */
188
191
+ (NSConnection*) newRegisteringAtName: (NSString*)name
189
192
                        withRootObject: (id)anObject;
214
217
 
215
218
@end
216
219
 
217
 
 
218
 
@interface Object (NSConnectionDelegate)
219
 
/**
220
 
 *      This method may be used to ask a delegate's permission to create
221
 
 *      a new connection from the old one.
222
 
 *      This method should be implemented in preference to the
223
 
 *      [makeNewConnection:sender:] which is obsolete.
224
 
 */
225
 
- (BOOL) connection: (NSConnection*)parent
 
220
/**
 
221
 * This category represents an informal protocol to which NSConnection
 
222
 * delegates may conform ... These methods are not actually implemented
 
223
 * by NSObject, so implementing these methods in your class has the effect
 
224
 * documented.
 
225
 */
 
226
@interface      NSObject (NSConnectionDelegate)
 
227
 
 
228
/**
 
229
 * <p>
 
230
 *   This is not an NSConnection method, but is a method that may
 
231
 *   be implemented by the delegate of an NSConnection object.
 
232
 * </p>
 
233
 * <p>
 
234
 *   If the delegate implements this method, the NSConnection will
 
235
 *   invoke the method for every message request or reply it receives
 
236
 *   from the remote NSConnection.  The delegate should use the
 
237
 *   authentication data to check all the NSData objects
 
238
 *   in the components array (ignoring NSPort objects),
 
239
 *   and return YES if they are valid, NO otherwise.
 
240
 * </p>
 
241
 * <p>
 
242
 *   If the method returns NO then an
 
243
 *   NSFailedAuthentication exception will be raised.
 
244
 * </p>
 
245
 * <p>
 
246
 *   In GNUstep the components array is mutable, allowing
 
247
 *   you to replace the NSData objects with your own version.
 
248
 * </p>
 
249
 */
 
250
- (BOOL) authenticateComponents: (NSMutableArray*)components
 
251
                       withData: (NSData*)authenticationData;
 
252
 
 
253
/**
 
254
 * <p>
 
255
 *   This is not an NSConnection method, but is a method that may
 
256
 *   be implemented by the delegate of an NSConnection object.
 
257
 * </p>
 
258
 * <p>
 
259
 *   If the delegate implements this method, the NSConnection will
 
260
 *   invoke the method for every message request to reply it sends
 
261
 *   to the remote NSConnection.  The delegate should generate
 
262
 *   authentication data by examining all the NSData objects
 
263
 *   in the components array (ignoring NSPort objects),
 
264
 *   and return the authentication data that can be used by the
 
265
 *   remote NSConnection.
 
266
 * </p>
 
267
 * <p>
 
268
 *   If the method returns nil then an
 
269
 *   NSGenericException exception will be raised.
 
270
 * </p>
 
271
 * <p>
 
272
 *   In GNUstep the components array is mutable, allowing
 
273
 *   you to replace the NSData objects with your own version.
 
274
 * </p>
 
275
 */
 
276
- (NSData*) authenticationDataForComponents: (NSMutableArray*)components;
 
277
 
 
278
/**
 
279
 * <p>
 
280
 *   This is not an NSConnection method, but is a method that may
 
281
 *   be implemented by the delegate of an NSConnection object.
 
282
 * </p>
 
283
 * <p>
 
284
 *   If the delegate implements this method, it will be called
 
285
 *   whenever a new NSConnection is created that has this
 
286
 *   NSConnection as its parent.  The delegate may take this
 
287
 *   opportunity to adjust the configuration of the new
 
288
 *   connection and may return a boolean value to tell the
 
289
 *   parent whether the creation of the new connection is to
 
290
 *   be permitted or not.
 
291
 * </p>
 
292
 */
 
293
 - (BOOL) connection: (NSConnection*)parent
226
294
  shouldMakeNewConnection: (NSConnection*)newConnection;
227
295
 
228
 
/**
229
 
 *      This is the old way of doing the same thing as
230
 
 *      [connection:shouldMakeNewConnection:]
231
 
 *      It is obsolete - don't use it.
232
 
 */
233
 
- (BOOL) makeNewConnection: (NSConnection*)newConnection
234
 
                    sender: (NSConnection*)parent;
235
 
 
236
 
/**
237
 
 *      If the delegate responds to this method, it will be used to ask the
238
 
 *      delegate's permission to establish a new connection from the old one.
239
 
 *      Often this is used so that the delegate can register for invalidation 
240
 
 *      notification on new child connections.
241
 
 *      This is a GNUstep extension
242
 
 *      Normally return newConn.
243
 
 */
244
296
- (NSConnection*) connection: (NSConnection*)ancestorConn
245
297
                  didConnect: (NSConnection*)newConn;
246
298
 
247
299
/**
248
 
 * These are like the MacOS-X delegate methods, except that we provide the
249
 
 * components in mutable arrays, so that the delegate can alter the data
250
 
 * items in the array.  Of course, you must do that WITH CARE.
251
 
 */ 
252
 
- (BOOL) authenticateComponents: (NSMutableArray*)components
253
 
                       withData: (NSData*)authenticationData;
254
 
 
255
 
/**
256
 
 * These are like the MacOS-X delegate methods, except that we provide the
257
 
 * components in mutable arrays, so that the delegate can alter the data
258
 
 * items in the array.  Of course, you must do that WITH CARE.
259
 
 */ 
260
 
- (NSData*) authenticationDataForComponents: (NSMutableArray*)components;
261
 
 
262
 
@end
263
 
 
264
 
/**
265
 
 * This informal protocol allows an object to control the details of how an
266
 
 * object is sent over the wire in distributed objects Port communications.
267
 
 */
268
 
@interface Object (NSPortCoder)
269
 
/**
270
 
 *      Must return the class that will be created on the remote side
271
 
 *      of the connection.  If the class to be created is not the same
272
 
 *      as that of the object returned by replacementObjectForPortCoder:
273
 
 *      then the class must be capable of recognising the object it
274
 
 *      actually gets in its initWithCoder: method.
275
 
 *      The default operation is to return NSDistantObject unless the
276
 
 *      object is being sent bycopy, in which case the objects actual
277
 
 *      class is returned.  To force bycopy operation the object should
278
 
 *      return its own class.
279
 
 */
280
 
- (Class) classForPortCoder;
281
 
 
282
 
/**
283
 
 *      This message is sent to an object about to be encoded for sending
284
 
 *      over the wire.  The default action is to return an NSDistantObject
285
 
 *      which is a local proxy for the object unless the object is being
286
 
 *      sent bycopy, in which case the actual object is returned.
287
 
 *      To force bycopy, an object should return itself.
288
 
 */
289
 
- (id) replacementObjectForPortCoder: (NSPortCoder*)aCoder;
290
 
 
 
300
 * An old fashioned synonym for -connection:shouldMakeNewConnection: -
 
301
 * don't use this.
 
302
 */
 
303
- (BOOL) makeNewConnection: (NSConnection*)newConnection
 
304
                    sender: (NSConnection*)parent;
291
305
@end
292
306
 
293
307
/*