home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Mail / mailapp-utilities-2.1-MIHS / Source / MailSpeaker.h < prev    next >
Encoding:
Text File  |  1998-02-14  |  3.4 KB  |  99 lines

  1. //----------------------------------------------------------------------------------------------------
  2. //
  3. //    MailSpeaker
  4. //
  5. //    Inherits From:        Speaker
  6. //
  7. //    Declared In:        MailSpeaker.h
  8. //
  9. //    Class Description
  10. //
  11. //        MailSpeaker is a custom Speaker subclass that supports
  12. //        remote messages implemented in Mail.app's custom Listener
  13. //        subclass MailListener.  After setting its send port (via the method
  14. //        "setSendPort: (port_t) aPort" ) to named port "MailSendDemo", 
  15. //        you may message an instance of this class with one of the 
  16. //        methods declared in this interface. It will in turn send Mail.app's 
  17. //        MailListener instance the corresponding message (via a Mach 
  18. //        message), which will be interpreted, and subsequently executed 
  19. //        in Mail.app.
  20. //
  21. //        MailListener (and this class) support compose methods that both 
  22. //        do and do not take a window number as an argument.  You can 
  23. //        manage multiple compose windows by using those that do.  A
  24. //        unique window number is returned by reference in the method
  25. //        'openSend:'.  This is then used as the argument for methods that
  26. //        take a window number.
  27. //
  28. //        Port information...  You should first set an instance's send port to
  29. //        the named port "Mail".  This will launch Mail.app if not already.
  30. //        Then, to perform the methods declared in this interface, set the 
  31. //        send port to "MailSendDemo".
  32. //         
  33. //        This class is generated by the Unix 'msgwrap' utility.  It has been 
  34. //        reformatted for readability.  Mail.msg was the original file passed
  35. //        to msgwrap.
  36. //
  37. //    Disclaimer
  38. //
  39. //        You may freely copy, distribute and reuse this software and its
  40. //        associated documentation. I disclaim any warranty of any kind, 
  41. //        expressed or implied, as to its fitness for any particular use.
  42. //
  43. //----------------------------------------------------------------------------------------------------
  44.  
  45. #import "compat.h"
  46. #if NEXTSTEP
  47.  
  48. #  import <appkit/Speaker.h>
  49. #  import <appkit/Listener.h>
  50. #  define S_(string)  (string)
  51.  
  52. #elif OPENSTEP
  53.  
  54. #  warning Using obsolete Speaker/Listener classes.
  55. #  import <AppKit/obsoleteSpeaker.h>
  56. #  import <AppKit/obsoleteListener.h>
  57. #  define S_(string)  [NSString stringWithCString:(string)]
  58. #  define NXPortFromName(port,host) NXPortFromName(S_(port), S_(host)) 
  59. #  define NXPortNameLookup(port,host) NXPortNameLookup(S_(port), S_(host)) 
  60.  
  61. #elif RHAPSODY
  62.  
  63. #  error No MailSpeaker equivalent for Rhapsody.
  64.  
  65. #else
  66. #  error unknown NEXTSTEP/OPENSTEP version.
  67. #endif
  68.  
  69. #define MAILSEND_PORTNAME  "MailSendDemo"
  70.  
  71.  
  72. @interface MailSpeaker : Speaker
  73. {
  74. }
  75.  
  76. - (int)incorporateNewMail;
  77.  
  78. //----------------------------------------------------------------------------------------------------
  79. //  Compose Methods (window not specified)
  80. //----------------------------------------------------------------------------------------------------
  81. - (int)deliver;
  82. - (int)openSend;
  83. - (int)setBody:(char *)aString;
  84. - (int)setCc:(char *)aString;
  85. - (int)setSubject:(char *)aString;
  86. - (int)setTo:(char *)aString;
  87.  
  88. //----------------------------------------------------------------------------------------------------
  89. //  Compose Methods (window specified)
  90. //----------------------------------------------------------------------------------------------------
  91. - (int)deliver:(int)aWindow;
  92. - (int)openSend:(int *)aWindow;
  93. - (int)setBody:(char *)aString inWindow:(int)aWindow;
  94. - (int)setCc:(char *)aString inWindow:(int)aWindow;
  95. - (int)setSubject:(char *)aString inWindow:(int)aWindow;
  96. - (int)setTo:(char *)aString inWindow:(int)aWindow;
  97.  
  98. @end // MailSpeaker
  99.