home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / apps.to.go / DTS.Lib / DTS.Lib.headers / AEConnect.h next >
Encoding:
C/C++ Source or Header  |  1994-06-11  |  5.0 KB  |  148 lines  |  [TEXT/MPS ]

  1. #ifndef __AECONNECT__
  2. #define __AECONNECT__
  3.  
  4. #ifndef __TYPES__
  5. #include <Types.h>
  6. #endif
  7.  
  8. #ifndef __APPLEEVENTS__
  9. #include <AppleEvents.h>
  10. #endif
  11.  
  12. #ifndef __EVENTS__
  13. #include <Events.h>
  14. #endif
  15.  
  16. #ifndef __WINDOWS__
  17. #include <Windows.h>
  18. #endif
  19.  
  20.  
  21.  
  22. void            InitConnectAppleEvents(void);
  23.     /*
  24.     **    ¶ Initializes the connect AppsToGo AppleEvents support.
  25.     **
  26.     **    It needs to be called so that DTS.framework applications can connect with other
  27.     **    applications specific to a targeted window. */
  28.  
  29.  
  30.  
  31. OSErr            SendConnect(FileRecHndl frHndl, char *theLocNBPType);
  32.     /*
  33.     **    ¶ Establish a connection to another AppsToGo-based application.
  34.     **
  35.     **    INPUT:    frHndl            This is the document reference that will contain the
  36.     **                            connect information if a connection is established.
  37.     **            theLocNBPType    You may have registered an NBPAlias for the application.
  38.     **                            If so, then you may pass in an alias to this function.
  39.     **                            (Just a pascal-string.)  If you aren’t using aliases,
  40.     **                            then pass in nil.
  41.     **    RESULT:    OSErr
  42.     **
  43.     **    This is the function that is called to establish a connection to another AppsToGo-based
  44.     **    application.  The "other" AppsToGo application is probably the same application on another
  45.     **    machine.  This code does a bit more than simply connecting to another application.  It
  46.     **    targets a specific window within that application. It doesn’t just target
  47.     **    zone-machine-application, which is the granularity that AppleEvents gives you.  It also
  48.     **    passes back and forth some information that is kind of a pain to get, but is nice to have.
  49.     **
  50.     **    One such piece of information is the user name.  This needs to be sent.  It can’t be
  51.     **    determined from the message from an AppleEvent.  The sender sends the user name, and the
  52.     **    receiver returns the remote user name.  The user name is placed in the document record for
  53.     **    the window to be used if you wish. */
  54.  
  55.  
  56.  
  57. WindowPtr        GetAEWindow(long windID_0, long windID_1);
  58.     /*
  59.     **    ¶ Determine which window is the AppleEvent target window.
  60.     **
  61.     **    INPUT:    windID_0, windID_1        This function is called to determine which window,
  62.     **                                    if any, is the designated target window.  The
  63.     **                                    window ID’s are determined when the connection is
  64.     **                                    established.  The framework uses this function to
  65.     **                                    identify the proper target window.  There is
  66.     **                                    probably not much reason for the application to
  67.     **                                    make this call. */
  68.  
  69.  
  70.  
  71. void            GetFullPathAndAppName(StringPtr path, StringPtr app);
  72.     /*
  73.     **    ¶ Get the full pathname of the application.
  74.     **
  75.     **    OUTPUT:    path    The full path of the application.  This is used, for example, in
  76.     **                    the sample DTS.StyleChat for telling a remote Finder to
  77.     **                    automatically launch an application.  The Finder demands a full
  78.     **                    path name for this AppleEvent.
  79.     **            app        The name of the application. */
  80.  
  81.  
  82.  
  83. void            AllowAutoReconnect(FileRecHndl frHndl);
  84.     /*
  85.     **    ¶ Upon an 'odoc' event, auto-start and connect to a remote application.
  86.     **
  87.     **    INPUT:    frHndl        The document that will allow auto-launch/reconnecting of
  88.     **                        the application.
  89.     **
  90.     **    This function should be called prior to calling SendConnect if you want to pass the
  91.     **    application being connected to the information necessary to remotely restart
  92.     **    the application.  The mutual information will be returned. */
  93.  
  94.  
  95.  
  96. pascal Boolean    AEPortFilter(LocationNamePtr locationName, PortInfoPtr thePortInfo);
  97.     /*
  98.     **    ¶ Filter out applications other than self.
  99.     **
  100.     **    INPUT:    locationName    Unused by this implementation of the port filter.
  101.     **            thePortInfo        The port info record that is matched for determining if
  102.     **                            the PPCBrowser should filter the application or not.
  103.     **
  104.     **    This function filters out apps of type other than itself.  You can of course use a
  105.     **    different filter.  This is the default filter. */
  106.  
  107.  
  108.  
  109. typedef pascal Boolean    (*GRPTProcPtr)(LocationNamePtr locationName,
  110.                                        PortInfoPtr thePortInfo);
  111.     /*
  112.     **    ¶ Prototype for writing your own DoIPCListPorts filter.
  113.     **
  114.     **    This prototype is used for writing your own DoIPCListPorts filter.  Look up
  115.     **    DoIPCListPorts for information on this function. */
  116.  
  117.  
  118.  
  119. OSErr            GetRemoteProcessTarget(FileRecHndl frHndl, AEDesc *retDesc,
  120.                                        GRPTProcPtr proc);
  121.     /*
  122.     **    ¶ Get remote information from the machine that this document is connected to.
  123.     **
  124.     **    INPUT:    frHndl        Get remote information from the machine that this document is
  125.     **                        connected to.
  126.     **            proc        The filter that is passed to DoIPCListPorts (which this
  127.     **                        function calls).
  128.     **    OUTPUT:    retDesc        Return the AEDesc of the remote target.
  129.     **    RESULT:    OSErr
  130.     **
  131.     **    Get the target of a remote process, given location information in the frHndl. */
  132.  
  133.  
  134.  
  135. OSErr            LaunchRemoteApp(FileRecHndl frHndl);
  136.     /*
  137.     **    ¶ Auto-launch pre-recorded remote application.
  138.     **
  139.     **    INPUT:    frHndl    Assuming that the proper information is in the frHndl, then use
  140.     **                    this information to auto-launch the remote application.  Once
  141.     **                    launched, then the appcation can be connected to.
  142.     **                    (See DTS.StyleChat for an example of this being used.)
  143.     **    RESULT:    OSErr
  144.     */
  145.  
  146.  
  147. #endif
  148.