home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Utilities / Remotes / Source / HostListManager.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-22  |  6.4 KB  |  172 lines

  1. /*---------------------------------------------------------------------------
  2. HostListManager.h - Header file for HostListManager class.
  3. -----------------------------------------------------------------------------*/
  4. #import <objc/Object.h>
  5.  
  6. #define CFGVERSION 2        /* Verion number of configuration file */
  7.  
  8. #define HOSTENTRYLEN sizeof(struct hostEntry) /* Max hostname length */
  9.  
  10. #define MAXCOMARGS 50           /* Max # of command line arguments */
  11.  
  12. #define MAXIDLEN 8        /* Max length of a login ID */
  13. #define MAXPOPLEN 15        /* Max length of a button name in popup list */
  14.  
  15. #define MINCOLS 10        /* Min # columns in Terminal/Stuart window */
  16. #define MAXCOLS 220        /* Max # columns in Terminal/Stuart window */
  17.  
  18. #define MINLINES 1        /* Min # lines in Terminal/Stuart window */
  19. #define MAXLINES 90        /* Max # lines in Terminal/Stuart window */
  20.  
  21. #define MINFONTSIZE 8        /* Minimum font size  */
  22. #define MAXFONTSIZE 24        /* Maximum font size  */
  23.  
  24. #define COURIER 1        /* Courier font */
  25. #define OHLFS 2            /* Ohlfs font */
  26.  
  27. #define TERMINAL 1        /* Terminal application */
  28. #define STUART 2        /* Stuart application */
  29.  
  30. #define TERMLAB   "Terminal Settings" /* Terminal box view label */
  31. #define STUARTLAB "Stuart Settings"   /* Stuart box view label */
  32.  
  33. #define METAESC 27        /* Meta key value for escape */
  34. #define SMETADEF 1        /* Stuart meta default radio tag */
  35. #define TMETADEF 1        /* Terminal meta default radio tag */
  36.  
  37. #define SSTRICTEM 00001        /* Stuart Strict */
  38. #define SKEYPAD   00002        /* Stuart Keypad */
  39. #define SSCROLLBK 00004        /* Stuart Scrollback */
  40. #define STRANSLAT 00010        /* Stuart Translate */
  41. #define SREVERSE  00020        /* Stuart Reverse */
  42. #define SKEYBDFOC 00040        /* Stuart KeyboardFocus */
  43. #define STERMSPAC 00100        /* Stuart TerminalSpacing */
  44. #define SMOUSEFOC 00200        /* Stuart MouseFocus */
  45. #define SSOURCEDL 00400        /* Stuart SourceDotLogin */
  46. #define STESTEXIT 01000        /* Stuart TestExit */
  47.  
  48. #define TTRANSLAT 00001        /* Terminal Translate */
  49. #define TKEYPAD   00002        /* Terminal Keypad */
  50. #define TSTRICTEM 00004        /* Terminal StrictEmulation */
  51. #define TAUTOWRAP 00010        /* Terminal Autowrap */
  52. #define TSCROLLBK 00020        /* Terminal Scrollback */
  53. #define TAUTOFOCS 00040        /* Terminal AutoFocus */
  54. #define TSOURCEDL 00100        /* Terminal SourceDotLogin */
  55.  
  56. #define RLOGIN 1        /* Remote login */
  57. #define TELNET 2        /* Telnet */
  58. #define TN3270 3        /* TN3270 */
  59.  
  60. #define DEFHEIGHT 55.0            /* Default hosts window height */
  61. #define MINHEIGHT 50.0            /* Minimum hosts window height */
  62. #define MAXHEIGHT 100.0         /* Maximum hosts window height */
  63.  
  64. #define DEFWIDTH 130.0        /* Default hosts window width */
  65. #define MINWIDTH 90.0        /* Minimum hosts window width */
  66. #define MAXWIDTH 200.0        /* Maximum hosts window width */
  67.  
  68. #define DEBUGOFF 0        /* Debug level off */
  69. #define DEBUGLOW 1        /* Debug level low */
  70. #define DEBUGHIGH 2        /* Debug level high */
  71. #define DEBUGMAX 3        /* Debug level maximum */
  72.  
  73. #define MAXCONFIGLEN 128    /* Maximum config pathname length */
  74. #define MAXRECLEN 512        /* Maximum config record length */
  75.  
  76. #define XDEFAULT 150        /* Default for configuration window X field */
  77. #define YDEFAULT 820        /* Default for configuration window Y field */
  78.  
  79. /* Structure of each host entry */
  80. struct hostEntry {        
  81.    char popUpName[MAXPOPLEN+1];    /* Button name to appear in popup list */
  82.    char hostName[MAXHOSTNAMELEN+1]; /* Real host name to connect to */
  83.    char loginName[MAXIDLEN+1];    /* Remote login ID to use in connection */
  84.    short int appType;        /* Application (e.g., Terminal, Stuart) */
  85.    short int protocolType;    /* Type (e.g., rlogin, telnet) */
  86.    short int locX;        /* Horizontal location for window */
  87.    short int locY;        /* Vertical location for window */
  88.    short int nCols;        /* Number of columns in window */
  89.    short int nLines;        /* Number of lines in window */
  90.    short int fontType;        /* Font type (e.g., courier, ohlfs) */
  91.    short int fontSize;        /* Font size */
  92.    short int autoStart;        /* Automatic launch flag */
  93.    unsigned int flags;        /* Terminal or Stuart flags */
  94.    short int meta;        /* Meta key value */
  95.    struct hostEntry *nextHost;    /* Pointer to the next host entry */
  96.    struct hostEntry *prevHost;    /* Pointer to the previous host entry */
  97. };
  98.  
  99. /* Establish the interface definition and methods for this class */
  100. @interface HostListManager:Object
  101. {
  102.    int debugLevel;        /* Debugging level */
  103.    int nHosts;            /* Total number of hosts in list */
  104.    struct hostEntry *begHost;    /* Pointer to beginning of host list */
  105. }
  106.  
  107. - init;
  108.  
  109. - (int)addHost:(const char *)buttonName
  110.    fullHostName:(const char *)fullName
  111.    loginName:(const char *)userId
  112.    application:(short int)app   
  113.    protocol:(short int)prot
  114.    locX:(short int)x
  115.    locY:(short int)y
  116.    nLines:(short int)lines
  117.    nCols:(short int)columns
  118.    font:(short int)aFont
  119.    fontSize:(short int)fontNum
  120.    autoStart:(short int)autoLaunch
  121.    flags:(unsigned int)flagValues
  122.    meta:(short int)metaNum
  123.    updateConfigFile:(short int)updConfigFile;
  124. - (int)addLocalHost:sender;
  125. - (int)changeHost:(const char *)buttonName
  126.    fullHostName:(const char *)fullName
  127.    loginName:(const char *)userId
  128.    application:(short int)app
  129.    protocol:(short int)prot
  130.    locX:(short int)x
  131.    locY:(short int)y
  132.    nLines:(short int)lines
  133.    nCols:(short int)columns
  134.    font:(short int)aFont
  135.    fontSize:(short int)fontNum
  136.    autoStart:(short int)autoLaunch
  137.    flags:(unsigned int)flagValues
  138.    meta:(short int)metaNum;
  139. - (int)deleteHost:(int)slotNum;
  140. - errPrint:(char *)fieldName recNum:(int)recordNum;
  141. - (int)getAppType:(int)slotNum;
  142. - (int)getAutoStart:(int)slotNum;
  143. - (char *)getButtonName:(int)slotNum;
  144. - (int)getColumns:(int)slotNum;
  145. - (const char *)getConfigFile:sender;
  146. - (int)getDebugLevel:sender;
  147. - (unsigned int)getFlags:(int)slotNum;
  148. - (int)getFontType:(int)slotNum;
  149. - (int)getFontSize:(int)slotNum;
  150. - (char *)getFullHostName:(int)slotNum;
  151. - (int)getHostSlotNum:(const char *)buttonName;
  152. - (int)getLines:(int)slotNum;
  153. - (int)getMeta:(int)slotNum;
  154. - (int)getNumHosts:sender;
  155. - (int)getProtocolType:(int)slotNum;
  156. - (char *)getPopUpName:(int)slotNum;
  157. - (char *)getUserID:(int)slotNum;
  158. - (int)getX:(int)slotNum;
  159. - (int)getY:(int)slotNum;
  160. - initHLMObject:sender;
  161. - (int)insert:(struct hostEntry *)hEntry;
  162. - loadPopUpList:anObject;
  163. - autoStart:sender;
  164. - loginToHost:(const char *)buttonName activate:(BOOL)actWindow;
  165. - (FILE *)openConfigFile:(const char *)mode;
  166. - setConfigFile:(const char *)configFile;
  167. - setDebugLevel:(short int)debugNum;
  168. - setStuartDefault:aStuart default:(const char *)defaultV as:(const char *)asV;
  169. - writeConfigFile:sender;
  170.  
  171. @end
  172.