home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / phonekit / NXPhone.h next >
Text File  |  1992-07-08  |  3KB  |  94 lines

  1. /*
  2.  *    ISDN/POTS Project
  3.  *    Copyright 1991, NeXT, Inc.
  4.  *
  5.  *    NXPhone.h
  6.  *
  7.  *    Interactions with the POTS/ISDN server are handled by
  8.  *    three object classes, the NXPhone object, NXPhoneChannel objects
  9.  *    and NXPhoneCall    objects.
  10.  *    
  11.  *    All communication between the server and application is handled via
  12.  *    remote objects, so a simple objective-C API is presented.  Applications
  13.  *    must subclass the NXPhoneCall object to receive messages from the
  14.  *    server. 
  15.  *    
  16.  *    The NXPhone object is repsonsible for establishing a connection to
  17.  *     the POTS/ISDN server and for maintaining a list of channels objects.
  18.  *    
  19.  *    The NXPhoneChannel object roughly corresponds to an ISDN B channel, or
  20.  *     a POTS connection.  It maintains a list of call objects that actually
  21.  *    receive and can send signalling information to the phone server.
  22.  *     
  23.  *    An NXPhoneCall object gives access to call control functions and
  24.  *    gives access to a data reception and transmission on a device.
  25.  *    To establish a connection you must create phone object and create
  26.  *    at least one data or voice channel.
  27.  *    
  28.  *    Only one NXPhone object is required to control all data and
  29.  *    voice channels.
  30.  *    
  31.  *    There is a rough analogy between the NXPhonePhone, NXPhoneChannel,
  32.  *    NXPhoneCall hierarchy and the Application, Window, View hierarchy
  33.  *    in the appkit.    
  34.  */
  35.  
  36. #import <mach/port.h>
  37. #import <objc/Object.h>
  38.  
  39. #import "phoneTypes.h"
  40.  
  41. @interface NXPhone : Object
  42. {
  43.     void *_private;
  44.     port_t local_port;        // This instance variable will be removed.
  45. }
  46.  
  47. /*
  48.  *  Create a connection to the phone server.
  49.  *  The -active method should be used to determine if the
  50.  *  connection to the phone server was successful.
  51.  */    
  52. - init;
  53. - initType: (NXPhoneDeviceType)device_type;
  54. - initDevice: (NXPhoneDeviceType)device_type;    // Obsolete will be removed
  55.                         // Use initType:
  56.  
  57. - run;
  58. - runFromAppKit;
  59.  
  60. /*
  61.  * -isActive returns nil if the Phone object can not connect
  62.  *  to the PhoneServer.
  63.  */
  64. - (BOOL)isActive;
  65.  
  66. /*
  67.  * Use DSPAddPort() if -runFromAppkit is toEused.
  68.  */
  69. - addPort: (port_t)port receiver: t method: (SEL)sel;
  70.  
  71. // To be removed.  These methods are obsolete.
  72. - addPort: (port_t) port;
  73. - addAppkitPort: (port_t)port;
  74. - removePort: (port_t)port;
  75. - removeAppkitPort: (port_t)port;
  76.  
  77. @end
  78.  
  79. @interface NXPhone (RemoteMethods)
  80. /*
  81.  *  These methods are forwarded to the phone server.  Actually they
  82.  *  are forwarded to a phone object in the phone server.
  83.  */
  84.     
  85. /*
  86.  *  Channel Management
  87.  */
  88. - (void)addChannel: (id)channel;
  89. - (void)removeChannel: (id)channel;
  90. - (BOOL)acquireChannel: (id)channel;
  91. - (void)releaseChannel: (id)channel;
  92.  
  93. @end
  94.