home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / lora299s.zip / LORA.H < prev    next >
C/C++ Source or Header  |  1998-05-12  |  20KB  |  801 lines

  1.  
  2. // LoraBBS Version 2.99 Free Edition
  3. // Copyright (C) 1987-98 Marco Maccaferri
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation; either version 2 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19. #ifndef _LORA_H
  20. #define _LORA_H
  21.  
  22. #include "bluewave.h"
  23. #include "combase.h"
  24. #include "collect.h"
  25. #include "ftrans.h"
  26. #include "lora_api.h"
  27. #include "menu.h"
  28. #include "msgbase.h"
  29.  
  30. #define INP_FIELD       0x0001
  31. #define INP_FANCY       0x0002
  32. #define INP_NOCRLF      0x0004
  33. #define INP_PWD         0x0008
  34. #define INP_NOCOLOR     0x0010
  35. #define INP_HOTKEY      0x0020
  36. #define INP_NUMERIC     0x0040
  37. #define INP_NONUMHOT    0x0080
  38.  
  39. #define ASK_DEFYES      0x0001
  40. #define ASK_DEFNO       0x0002
  41. #define ASK_HELP        0x0004
  42.  
  43. #define ANSWER_YES      1
  44. #define ANSWER_NO       2
  45. #define ANSWER_HELP     3
  46.  
  47. class TEmbedded
  48. {
  49. public:
  50.    TEmbedded (void);
  51.    ~TEmbedded (void);
  52.  
  53.    USHORT Task;
  54.    USHORT EndRun, Hangup, TimeLimit;
  55.    ULONG  StartCall;
  56.    USHORT Ansi, Avatar, Color, Rip;
  57.    USHORT HotKey, More, ScreenHeight;
  58.    CHAR   Path[64], AltPath[64];
  59.    ULONG  CarrierSpeed;
  60.    class  TCom *Com, *Snoop;
  61.    class  TUser *User;
  62.    class  TLanguage *Language;
  63.    class  TConfig *Cfg;
  64.    class  TLog *Log;
  65.    class  TMsgData *MsgArea;
  66.    class  TFileData *FileArea;
  67.  
  68.    USHORT AbortSession (VOID);
  69.    VOID   BufferedPrintf (PSZ pszFormat, ...);
  70.    VOID   BufferedPrintfAt (USHORT usRow, USHORT usColumn, PSZ pszFormat, ...);
  71.    VOID   ClrEol (VOID);
  72.    USHORT DisplayFile (PSZ pszFile);
  73.    USHORT DisplayPrompt (PSZ pszString, USHORT usColor, USHORT usHilight, USHORT usUnbuffer = FALSE);
  74.    USHORT DisplayString (PSZ pszString);
  75.    USHORT GetAnswer (USHORT flQuestion);
  76.    USHORT Getch ();
  77.    PSZ    GetString (PSZ pszBuffer, USHORT usMaxlen, USHORT flAttrib = 0);
  78.    USHORT KBHit ();
  79.    VOID   Idle (VOID);
  80.    PSZ    Input (PSZ pszBuffer, USHORT usMaxlen, USHORT flAttrib = 0);
  81.    SHORT  MoreQuestion (SHORT nLine);
  82.    VOID   OutString (PSZ pszFormat, ...);
  83.    VOID   PressEnter (VOID);
  84.    VOID   Printf (PSZ pszFormat, ...);
  85.    VOID   PrintfAt (USHORT usRow, USHORT usColumn, PSZ pszFormat, ...);
  86.    VOID   Putch (UCHAR ucByte);
  87.    VOID   RunExternal (PSZ Command);
  88.    VOID   SetColor (USHORT usColor);
  89.    ULONG  TimeRemain (USHORT seconds = FALSE);
  90.    VOID   UnbufferBytes ();
  91.  
  92. private:
  93.    FILE   *fp, *AnswerFile;
  94.    USHORT LastColor, IsMec, TrasLen, IsDown, Required;
  95.    SHORT  LastChar, Stop, StopNested, Nested, Line;
  96.    CHAR   Temp[512], Temp2[128], Response;
  97.    CHAR   OnExit[128];
  98.    PSZ    Position;
  99.    ULONG  LastActivity;
  100.    CHAR   Traslate[64], *TrasPtr;
  101.    time_t last_time;
  102.  
  103.    SHORT  GetNextChar (VOID);
  104.    FILE  *OpenFile (PSZ pszName, PSZ pszAccess = "rb");
  105.    SHORT  PeekNextChar (VOID);
  106.    VOID   ProcessControl (UCHAR ucControl);
  107.    VOID   ProcessControlF (VOID);
  108.    VOID   ProcessControlO (VOID);
  109.    VOID   ProcessControlP (VOID);
  110.    VOID   ProcessControlK (VOID);
  111.    VOID   ProcessControlW (VOID);
  112.    VOID   TranslateKeyword (VOID);
  113. };
  114.  
  115.  
  116. // ---------------------------------------------------------------------------
  117.  
  118. class TMessage
  119. {
  120. public:
  121.    TMessage (PSZ pszDataFile);
  122.    ~TMessage (void);
  123.  
  124.    USHORT ShowKludges;
  125.    USHORT Width, Height, More, DoCls;
  126.    class  TMsgData  *Current;
  127.    class  TConfig   *Cfg;
  128.    class  TLog      *Log;
  129.    class  TEmbedded *Embedded;
  130.    class  TLanguage *Language;
  131.    class  TUser     *User;
  132.    class  TMsgBase  *Msg;
  133.  
  134.    VOID   BriefList (VOID);
  135.    VOID   BuildDate (PSZ format, PSZ dest, MDATE *date);
  136.    VOID   Delete (VOID);
  137.    VOID   DisplayCurrent (VOID);
  138.    VOID   DisplayText (VOID);
  139.    VOID   GetOrigin (class TMsgData *Data, PSZ Origin);
  140.    VOID   OpenArea (PSZ area);
  141.    VOID   Read (ULONG Number);
  142.    VOID   ReadMessages (VOID);
  143.    VOID   ReadNext (VOID);
  144.    VOID   ReadNonStop (VOID);
  145.    VOID   ReadOriginal (VOID);
  146.    VOID   ReadPrevious (VOID);
  147.    VOID   ReadReply (VOID);
  148.    VOID   Reply (VOID);
  149.    USHORT SelectArea (PSZ pszArea);
  150.    USHORT SelectNewArea (PSZ pszArea);
  151.    VOID   StartMessageQuestion (ULONG ulFirst, ULONG ulLast, USHORT fNewMessages, ULONG &ulMsg, USHORT &fForward);
  152.    VOID   TitleList (VOID);
  153.    VOID   Unreceive (VOID);
  154.    VOID   Write (VOID);
  155.  
  156. private:
  157.    CHAR   DataPath[128];
  158. };
  159.  
  160. #define RANGE_UNDEFINED       0
  161. #define RANGE_ALL             1
  162. #define RANGE_TAGGED          2
  163. #define RANGE_CURRENT         3
  164.  
  165. #define ACTION_UNDEFINED      0
  166. #define ACTION_READ           1
  167. #define ACTION_LIST           2
  168.  
  169. #define TYPE_ALL              0
  170. #define TYPE_PERSONAL         1
  171. #define TYPE_KEYWORD          2
  172. #define TYPE_NEW              3
  173. #define TYPE_PERSONALNEW      4
  174.  
  175. class TInquire
  176. {
  177. public:
  178.    TInquire (void);
  179.    ~TInquire (void);
  180.  
  181.    USHORT Type, Action, Range, Stop;
  182.    USHORT ShowKludges;
  183.    CHAR   Keyword[64];
  184.    class  TConfig *Cfg;
  185.    class  TEmbedded *Embedded;
  186.    class  TUser *User;
  187.    class  TLanguage *Language;
  188.    class  TMsgData *Current;
  189.    class  TLog *Log;
  190.  
  191.    VOID   DeleteCurrent (VOID);
  192.    VOID   DisplayCurrent (VOID);
  193.    USHORT First (VOID);
  194.    USHORT Next (VOID);
  195.    USHORT Previous (VOID);
  196.    VOID   Query (VOID);
  197.  
  198. private:
  199.    ULONG  Number;
  200.    class  TMsgBase *Msg;
  201.    class  TMsgData *Data;
  202.  
  203.    VOID   BuildDate (PSZ format, PSZ dest, MDATE *date);
  204.    USHORT FirstMessage (VOID);
  205.    USHORT NextMessage (VOID);
  206.    USHORT PreviousMessage (VOID);
  207.    USHORT SearchAction (VOID);
  208.    USHORT SearchRange (VOID);
  209. };
  210.  
  211. // ---------------------------------------------------------------------------
  212.  
  213. class TLibrary
  214. {
  215. public:
  216.    TLibrary (PSZ pszDataFile);
  217.    ~TLibrary (void);
  218.  
  219.    USHORT Task;
  220.    ULONG  CarrierSpeed;
  221.    class  TConfig *Cfg;
  222.    class  TEmbedded *Embedded;
  223.    class  TLog *Log;
  224.    class  TUser *User;
  225.    class  TFileData *Current;
  226.    class  TProgress *Progress;
  227.    class  TLanguage *Language;
  228.  
  229.    VOID   Download (class TFileTag *Files = NULL, USHORT AnyLibrary = FALSE);
  230.    USHORT DownloadFile (PSZ pszFile, PSZ pszName, ULONG ulSize);
  231.    VOID   DownloadList (VOID);
  232.    VOID   ExternalProtocols (USHORT Batch);
  233.    VOID   FileDetails (class TFileBase *File);
  234.    VOID   ListDownloadedFiles (VOID);
  235.    VOID   ListFiles (class TFileBase *Data = NULL);
  236.    VOID   ListRecentFiles (VOID);
  237.    VOID   AddTagged (VOID);
  238.    VOID   ListTagged (VOID);
  239.    VOID   DeleteTagged (VOID);
  240.    VOID   DeleteAllTagged (VOID);
  241.    VOID   RemoveFiles (VOID);
  242.    VOID   SearchFileName (VOID);
  243.    VOID   SearchKeyword (VOID);
  244.    VOID   SearchNewFiles (VOID);
  245.    USHORT SearchRange (VOID);
  246.    VOID   SearchText (VOID);
  247.    USHORT SelectArea (PSZ pszArea);
  248.    VOID   TypeFile (VOID);
  249.    VOID   Upload (VOID);
  250.    VOID   UploadUser (PSZ user);
  251.  
  252. private:
  253.    CHAR   DataPath[128];
  254.    class  TStatistics *Stats;
  255.  
  256.    SHORT  MoreQuestion (SHORT nLine);
  257.    VOID   TagListed (VOID);
  258. };
  259.  
  260. // ---------------------------------------------------------------------------
  261.  
  262. class TEMail
  263. {
  264. public:
  265.    TEMail (void);
  266.    ~TEMail (void);
  267.  
  268.    USHORT ShowKludges, Storage;
  269.    USHORT Width, Height, More, DoCls;
  270.    CHAR   BasePath[128];
  271.    class  TConfig   *Cfg;
  272.    class  TLog      *Log;
  273.    class  TEmbedded *Embedded;
  274.    class  TLanguage *Language;
  275.    class  TUser     *User;
  276.    class  TMsgBase  *Msg;
  277.  
  278.    VOID   BriefList (VOID);
  279.    VOID   BuildDate (PSZ format, PSZ dest, MDATE *date);
  280.    VOID   CheckUnread (VOID);
  281.    VOID   Delete (VOID);
  282.    VOID   DisplayCurrent (VOID);
  283.    VOID   DisplayText (VOID);
  284.    VOID   Read (ULONG Number);
  285.    VOID   ReadMessages (USHORT fUnreaded = FALSE);
  286.    VOID   ReadNext (VOID);
  287.    VOID   ReadNonStop (VOID);
  288.    VOID   ReadPrevious (VOID);
  289.    VOID   Reply (USHORT ToCurrent = FALSE);
  290.    VOID   StartMessageQuestion (ULONG ulFirst, ULONG ulLast, ULONG &ulMsg, USHORT &fForward);
  291.    VOID   Write (USHORT Type, PSZ Argument = NULL);
  292. };
  293.  
  294. // ---------------------------------------------------------------------------
  295.  
  296. class DLL_EXPORT TMailerStatus
  297. {
  298. public:
  299.    TMailerStatus (void);
  300.    virtual ~TMailerStatus (void);
  301.  
  302.    CHAR   SystemName[64];
  303.    CHAR   SysopName[64];
  304.    CHAR   Location[64];
  305.    CHAR   Address[48], Akas[128];
  306.    CHAR   Program[48];
  307.    USHORT InPktFiles, InDataFiles;
  308.    USHORT OutPktFiles, OutDataFiles;
  309.    ULONG  InPktBytes, InDataBytes;
  310.    ULONG  OutPktBytes, OutDataBytes;
  311.    ULONG  Speed;
  312.  
  313.    virtual VOID   Update (VOID);
  314. };
  315.  
  316. // ---------------------------------------------------------------------------
  317.  
  318. class DLL_EXPORT TStatus
  319. {
  320. public:
  321.    TStatus (void);
  322.    virtual ~TStatus (void);
  323.  
  324.    virtual VOID   Clear (VOID);
  325.    virtual VOID   SetLine (USHORT line, PSZ text, ...);
  326. };
  327.  
  328. // ---------------------------------------------------------------------------
  329.  
  330. class DLL_EXPORT TBbs
  331. {
  332. public:
  333.    TBbs (void);
  334.    ~TBbs (void);
  335.  
  336.    USHORT Task, AutoDetect, TimeLimit, Remote, Local;
  337.    USHORT FancyNames, Logoff;
  338.    ULONG  Speed, StartCall;
  339.    class  TCom *Com, *Snoop;
  340.    class  TLog *Log;
  341.    class  TEvents *Events;
  342.    class  TConfig *Cfg;
  343.    class  TEmbedded *Embedded;
  344.    class  TProgress *Progress;
  345.    class  TMailerStatus *MailerStatus;
  346.    class  TStatus *Status;
  347.  
  348.    VOID   ExecuteCommand (class TMenu *Menu);
  349.    USHORT FileExist (PSZ FileName);
  350.    VOID   IEMSILogin (VOID);
  351.    USHORT Login (VOID);
  352.    VOID   Run (VOID);
  353.  
  354. private:
  355.    USHORT whStatus, Reload;
  356.    CHAR   Name[36], Password[16], Cmd[128];
  357.    CHAR   MenuName[32];
  358.    class  TCollection Stack;
  359.    class  TScreen *Screen;
  360.    class  TUser *User;
  361.    class  TLanguage *Language;
  362.    class  TMenu *Menu;
  363.    class  TMessage *Message;
  364.    class  TLibrary *Library;
  365.    class  TEMail *EMail;
  366.  
  367.    VOID   CheckBirthday (VOID);
  368.    VOID   DisableUseronRecord (VOID);
  369.    VOID   SetBirthDate (VOID);
  370.    VOID   SetUseronRecord (PSZ pszStatus);
  371.    VOID   ToggleNoDisturb (VOID);
  372. };
  373.  
  374. // ---------------------------------------------------------------------------
  375.  
  376. #define REMOTE_NONE           0
  377. #define REMOTE_USER           1
  378. #define REMOTE_MAILER         2
  379. #define REMOTE_MAILRECEIVED   3
  380. #define REMOTE_PPP            4
  381.  
  382. class DLL_EXPORT TDetect
  383. {
  384. public:
  385.    TDetect (void);
  386.    ~TDetect (void);
  387.  
  388.    USHORT Task, Remote;
  389.    UCHAR  Ansi, Avatar, Rip, FullEd, MorePrompt;
  390.    UCHAR  IBMChars, HotKeys, ScreenClear, MailCheck, FileCheck;
  391.    USHORT EMSI, YooHoo, IEMSI;
  392.    USHORT Capabilities;
  393.    CHAR   Name[48], RealName[48], City[48];
  394.    CHAR   Password[48];
  395.    CHAR   RemoteSystem[48], RemoteSysop[48], RemoteLocation[48];
  396.    CHAR   RemoteProgram[48];
  397.    CHAR   Inbound[48];
  398.    ULONG  Speed;
  399.    class  TAddress Address;
  400.    class  TCom *Com;
  401.    class  TEvents *Events;
  402.    class  TConfig *Cfg;
  403.    class  TLog *Log;
  404.    class  TProgress *Progress;
  405.    class  TMailerStatus *MailerStatus;
  406.    class  TStatus *Status;
  407.  
  408.    USHORT AbortSession (VOID);
  409.    USHORT EMSIReceiver (VOID);
  410.    USHORT EMSISender (VOID);
  411.    VOID   IEMSIReceiver (VOID);
  412.    USHORT RemoteMailer (VOID);
  413.    VOID   Terminal (VOID);
  414.    USHORT WaZOOReceiver (VOID);
  415.    USHORT WaZOOSender (VOID);
  416.  
  417. private:
  418.    CHAR   ReceiveIEMSI[2048], *ReceiveEMSI;
  419.    CHAR   SendIEMSI[2048], *SendEMSI;
  420.    ULONG  StartCall, LastPktName;
  421.  
  422.    USHORT CheckEMSIPacket (VOID);
  423.    VOID   ParseEMSIPacket (VOID);
  424.    VOID   ParseIEMSIPacket (VOID);
  425.    USHORT ReceiveHello (VOID);
  426.    USHORT ReceiveEMSIPacket (VOID);
  427.    USHORT ReceiveIEMSIPacket (VOID);
  428.    VOID   Receiver (VOID);
  429.    VOID   Sender (VOID);
  430.    USHORT SendHello (VOID);
  431.    VOID   SendEMSIPacket (VOID);
  432.    VOID   SendIEMSIPacket (VOID);
  433.    SHORT  TimedRead (VOID);
  434. };
  435.  
  436. // ---------------------------------------------------------------------------
  437.  
  438. #define FTP_PORT           21
  439. #define TELNET_PORT        23
  440. #define FINGER_PORT        79
  441. #define FTPDATA_PORT       2048
  442. #define VMODEM_PORT        3141
  443. #define IRC_PORT           6667
  444.  
  445. class TInternet
  446. {
  447. public:
  448.    TInternet (void);
  449.    ~TInternet (void);
  450.  
  451.    class  TConfig *Cfg;
  452.    class  TCom *Com, *Snoop;
  453.    class  TEmbedded *Embedded;
  454.    class  TLog *Log;
  455.    class  TUser *User;
  456.  
  457.    VOID   Finger (PSZ pszServer = NULL, USHORT usPort = FINGER_PORT);
  458.    VOID   FTP (PSZ pszServer = NULL, USHORT usPort = FTP_PORT);
  459.    VOID   IRC (PSZ pszServer = NULL, PSZ pszNick = NULL, USHORT usPort = IRC_PORT);
  460.    VOID   Telnet (PSZ pszServer = NULL, USHORT usPort = TELNET_PORT);
  461.  
  462. private:
  463.    USHORT Hash, Binary, DataPort;
  464.    CHAR   Temp[128], Cmd[48], Host[32];
  465.    UCHAR  Buffer[2048];
  466.    CHAR   *Tokens[256];
  467.    class  TTcpip *Tcp;
  468.    class  TTcpip *Data;
  469.  
  470.    USHORT GetResponse (PSZ pszResponse, USHORT usMaxLen);
  471.    VOID   FTP_GET (PSZ pszFile, PSZ pszName, USHORT fHash);
  472.    VOID   FTP_MGET (PSZ pszFile);
  473.    VOID   FTP_PUT (PSZ pszFile, USHORT fHash, USHORT fBinary);
  474. };
  475.  
  476. // ---------------------------------------------------------------------------
  477.  
  478. class TEditor
  479. {
  480. public:
  481.    TEditor (void);
  482.    virtual ~TEditor (void);
  483.  
  484.    USHORT UseFullScreen;
  485.    USHORT StartCol, StartRow;
  486.    USHORT Width, Height;
  487.    class  TEmbedded *Embedded;
  488.    class  TLanguage *Language;
  489.  
  490.    virtual USHORT AppendText (VOID);
  491.    virtual VOID   ChangeText (VOID);
  492.    virtual VOID   Clear (VOID);
  493.    virtual VOID   DeleteLine (VOID);
  494.    virtual VOID   DisplayScreen (VOID);
  495.    virtual USHORT ExternalEditor (PSZ EditorCmd);
  496.    virtual USHORT FullScreen (VOID);
  497.    virtual USHORT InputText (VOID);
  498.    virtual USHORT InsertLines (VOID);
  499.    virtual VOID   ListText (VOID);
  500.    virtual VOID   RetypeLine (VOID);
  501.  
  502. protected:
  503.    USHORT cx, cy;
  504.    CHAR   Wrap[128], *Buffer, *Cursor;
  505.    CHAR   ActualLine[128];
  506.    ULONG  LineCrc[51];
  507.    class  TCollection Text;
  508.  
  509.    VOID   BuildDate (PSZ format, PSZ dest, MDATE *date);
  510.    VOID   Display (USHORT line);
  511.    PSZ    GetFirstChar (USHORT start, USHORT line);
  512.    PSZ    GetString (CHAR *pszBuffer, USHORT usMaxlen);
  513.    VOID   GotoXY (USHORT x, USHORT y);
  514.    VOID   MoveCursor (USHORT start);
  515.    VOID   SetCursor (USHORT start);
  516.    PSZ    StringReplace (PSZ pszStr, PSZ pszSearch, PSZ pszReplace);
  517.    VOID   UpdateLine (USHORT y, PSZ pszLine);
  518. };
  519.  
  520. class TMsgEditor : public TEditor
  521. {
  522. public:
  523.    TMsgEditor (void);
  524.    ~TMsgEditor (void);
  525.  
  526.    USHORT EchoMail;
  527.    CHAR   AreaKey[16];
  528.    CHAR   AreaTitle[128];
  529.    CHAR   UserName[48];
  530.    CHAR   Address[64];
  531.    CHAR   Origin[64];
  532.    class  TConfig *Cfg;
  533.    class  TLog *Log;
  534.    class  TMsgBase *Msg;
  535.  
  536.    VOID   DisplayScreen (VOID);
  537.    VOID   Forward (VOID);
  538.    VOID   InputSubject (VOID);
  539.    USHORT InputTo (VOID);
  540.    VOID   Menu (VOID);
  541.    USHORT Modify (VOID);
  542.    VOID   QuoteText (VOID);
  543.    USHORT Reply (VOID);
  544.    VOID   Save (VOID);
  545.    USHORT Write (VOID);
  546.  
  547. private:
  548.    CHAR   To[36];
  549.    CHAR   Subject[72];
  550.    ULONG  Number, Msgn;
  551.    struct dosdate_t d_date;
  552.    struct dostime_t d_time;
  553. };
  554.  
  555. class TCommentEditor : public TEditor
  556. {
  557. public:
  558.    TCommentEditor (void);
  559.    ~TCommentEditor (void);
  560.  
  561.    class  TFileBase *File;
  562.  
  563.    VOID   Menu (VOID);
  564.    VOID   Save (VOID);
  565.    USHORT Write (VOID);
  566. };
  567.  
  568. #define MAIL_LOCAL         0
  569. #define MAIL_FIDONET       1
  570. #define MAIL_INTERNET      2
  571.  
  572. class TMailEditor : public TEditor
  573. {
  574. public:
  575.    TMailEditor (void);
  576.    ~TMailEditor (void);
  577.  
  578.    USHORT Type, Storage;
  579.    UCHAR  Private;
  580.    CHAR   BasePath[128];
  581.    CHAR   UserName[48];
  582.    CHAR   Origin[64];
  583.    CHAR   Address[64];
  584.    CHAR   AreaTitle[128];
  585.    CHAR   To[36];
  586.    CHAR   ToAddress[64];
  587.    CHAR   Subject[72];
  588.    class  TConfig *Cfg;
  589.    class  TLog *Log;
  590.    class  TMsgBase *Msg;
  591.  
  592.    VOID   DisplayScreen (VOID);
  593.    VOID   Forward (VOID);
  594.    USHORT InputAddress (VOID);
  595.    USHORT InputSubject (VOID);
  596.    USHORT InputTo (VOID);
  597.    VOID   Menu (VOID);
  598.    USHORT Modify (VOID);
  599.    VOID   QuoteText (VOID);
  600.    USHORT Reply (VOID);
  601.    VOID   Save (VOID);
  602.    USHORT Write (VOID);
  603.  
  604. private:
  605.    ULONG  Number;
  606.    struct dosdate_t d_date;
  607.    struct dostime_t d_time;
  608. };
  609.  
  610. // ---------------------------------------------------------------------------
  611.  
  612. class TOffline
  613. {
  614. public:
  615.    TOffline (void);
  616.    virtual ~TOffline (void);
  617.  
  618.    USHORT Area;
  619.    CHAR   Id[16], Path[128];
  620.    ULONG  Limit, CarrierSpeed;
  621.    ULONG  Current, Total;
  622.    ULONG  Personal, TotalPersonal;
  623.    ULONG  Reply;
  624.    class  TConfig *Cfg;
  625.    class  TLog *Log;
  626.    class  TEmbedded *Embedded;
  627.    class  TUser *User;
  628.    class  TLanguage *Language;
  629.    class  TProgress *Progress;
  630.  
  631.    virtual VOID   AddConference (VOID);
  632.    virtual VOID   AddKludges (class TCollection &Text, class TMsgData *Data);
  633.    virtual USHORT Create (VOID);
  634.    virtual USHORT Compress (PSZ pszPacket);
  635.    virtual VOID   Display (VOID);
  636.    virtual VOID   Download (PSZ pszFile, PSZ pszName);
  637.    virtual VOID   ManageTagged (VOID);
  638.    virtual USHORT FetchReply (VOID);
  639.    virtual VOID   PackArea (ULONG &ulLast);
  640.    virtual VOID   PackEMail (ULONG &ulLast);
  641.    virtual USHORT Prescan (VOID);
  642.    virtual VOID   RemoveArea (VOID);
  643.    virtual VOID   RestrictDate (VOID);
  644.    virtual VOID   Scan (PSZ pszKey, ULONG ulLast);
  645.    virtual USHORT TooOld (ULONG Restrict, class TMsgBase *Msg);
  646.    virtual VOID   Upload (VOID);
  647.  
  648. protected:
  649.    CHAR   Work[128];
  650.    USHORT BarWidth;
  651.    ULONG  TotalPack;
  652.    class  TMsgData *MsgArea;
  653.    class  TMsgBase *Msg;
  654.    class  TMsgTag NewMsgTag;
  655.    class  TMsgTag *MsgTag;
  656. };
  657.  
  658. class TBlueWave : public TOffline
  659. {
  660. public:
  661.    TBlueWave (void);
  662.    ~TBlueWave (void);
  663.  
  664.    USHORT Create (VOID);
  665.    USHORT FetchReply (VOID);
  666.    VOID   PackArea (ULONG &ulLast);
  667.  
  668. private:
  669.    INF_HEADER    Inf;
  670.    INF_AREA_INFO AreaInf;
  671.    MIX_REC       Mix;
  672.    FTI_REC       Fti;
  673.    UPI_HEADER    Upih;
  674.    UPI_REC       Upir;
  675.    UPL_HEADER    Uplh;
  676.    UPL_REC       Uplr;
  677. };
  678.  
  679. typedef struct {
  680.    UCHAR  Msgstat;
  681.    UCHAR  Msgnum[7];
  682.    UCHAR  Msgdate[8];
  683.    UCHAR  Msgtime[5];
  684.    CHAR   MsgTo[25];
  685.    CHAR   MsgFrom[25];
  686.    CHAR   MsgSubj[25];
  687.    UCHAR  Msgpass[12];
  688.    UCHAR  Msgrply[8];
  689.    UCHAR  Msgrecs[6];
  690.    UCHAR  Msglive;
  691.    UCHAR  Msgarealo;
  692.    UCHAR  Msgareahi;
  693.    UCHAR  Msgfiller[3];
  694. } QWKHDR;
  695.  
  696. typedef union {
  697.    UCHAR  uc[10];
  698.    USHORT ui[5];
  699.    ULONG  ul[2];
  700.    float  f[2];
  701.    double d[1];
  702. } QWKCONV;
  703.  
  704. class TQWK : public TOffline
  705. {
  706. public:
  707.    TQWK (void);
  708.    ~TQWK (void);
  709.  
  710.    USHORT Create (VOID);
  711.    USHORT FetchReply (VOID);
  712.    VOID   PackArea (ULONG &ulLast);
  713.  
  714. private:
  715.    CHAR   TempStr[32];
  716.    ULONG  Blocks;
  717.    QWKHDR Qwk;
  718.  
  719.    float  IEEToMSBIN (float f);
  720.    PSZ    StripSpaces (PSZ pszString, USHORT usSize);
  721. };
  722.  
  723. class TAscii : public TOffline
  724. {
  725. public:
  726.    TAscii (void);
  727.    ~TAscii (void);
  728.  
  729.    USHORT Create (VOID);
  730.    VOID   PackArea (ULONG &ulLast);
  731. };
  732.  
  733. class TPoint : public TOffline
  734. {
  735. public:
  736.    TPoint (void);
  737.    ~TPoint (void);
  738.  
  739.    USHORT Create (VOID);
  740.    USHORT FetchReply (VOID);
  741.    VOID   PackArea (ULONG &ulLast);
  742. };
  743.  
  744. // ---------------------------------------------------------------------------
  745.  
  746. typedef struct {
  747.    CHAR   Key[16];
  748.    ULONG  ActiveFiles;
  749.    ULONG  ActiveMsgs;
  750.    CHAR   Display[128];
  751. } LISTDATA;
  752.  
  753. class TListings
  754. {
  755. public:
  756.    TListings (void);
  757.    virtual ~TListings (void);
  758.  
  759.    class  TEmbedded *Embedded;
  760.    class  TLog *Log;
  761.    class  TUser *User;
  762.    class  TLanguage *Language;
  763.  
  764.    virtual VOID   Begin (VOID);
  765.    virtual VOID   Down (VOID);
  766.    virtual VOID   Exit (VOID);
  767.    virtual VOID   DownloadTag (VOID);
  768.    virtual USHORT DrawScreen (VOID);
  769.    virtual VOID   PageDown (VOID);
  770.    virtual VOID   PageUp (VOID);
  771.    virtual VOID   PrintCursor (USHORT y);
  772.    virtual VOID   PrintLine (VOID);
  773.    virtual VOID   PrintTitles (VOID);
  774.    virtual VOID   RemoveCursor (USHORT y);
  775.    virtual USHORT Run (VOID);
  776.    virtual VOID   Select (VOID);
  777.    virtual VOID   Tag (VOID);
  778.    virtual VOID   Up (VOID);
  779.  
  780. protected:
  781.    USHORT y;
  782.    USHORT RetVal, End, Found;
  783.    USHORT Redraw, Titles;
  784.    class  TCollection List;
  785.    class  TCollection Data;
  786.    LISTDATA *pld;
  787. };
  788.  
  789. // ----------------------------------------------------------------------
  790.  
  791. #if defined(__OS2__)
  792. VOID CallRexx (class TBbs *lpBbs, PSZ Name);
  793. VOID CallRexx (class TEmbedded *lpEmbed, PSZ Name);
  794. #endif
  795.  
  796. VOID ParseAddress (PSZ text, PSZ name, PSZ address);
  797.  
  798. #endif
  799.  
  800.  
  801.