home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1998 February / PCOnline_02_1998.iso / filesbbs / dos / listz21s.exe / LSZ_APPL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-07  |  4.2 KB  |  105 lines

  1. /*
  2.  * This file is part of Listerz v2.0 (VE)
  3.  *
  4.  * Copyright (C) 1995-1997 by Branislav L. Slantchev
  5.  * A Product of Silicon Creations, Inc.
  6.  *
  7.  * This file is distributed under the terms and conditions of the GNU
  8.  * General Public License. For more information, refer to the file
  9.  * Copying.Doc which is included in the archive.
  10. */
  11. #ifndef INCLUDED_LSZ_APPL_H
  12. #define INCLUDED_LSZ_APPL_H
  13.  
  14. #include "dlist.h"
  15. #include "bucket.h"
  16. #include "lzconfig.h"
  17. #include "pbstruct.h"
  18. #include "useron.h"
  19. #include "cmdbar.h"
  20. #include "terminal.h"
  21. #include "listview.h"
  22. #include "keyboard.h"
  23. #include "febbs.h"
  24.  
  25. const ushort
  26.     cmExit     = 0x0100, cmSelectAll = 0x0101, cmGroups        = 0x0102,
  27.     cmMakeList = 0x0103, cmUntagAll  = 0x0104, cmToggleAll     = 0x0105,
  28.     cmZip      = 0x0106, cmRar       = 0x0107, cmArj           = 0x0108,
  29.     cmLha      = 0x0109, cmZoo       = 0x010A, cmNoCompression = 0x010B,
  30.     cmIgnore   = 0x010C;
  31.  
  32. class Application
  33. {
  34. public:
  35.     Application(const char *argv0);
  36.     ~Application();
  37.  
  38.     void run();
  39.  
  40.     LZCONFIG*         config() { return &m_Config; }
  41.     zBucket<FILECFG>* bucket() { return m_Bucket; }
  42.  
  43. private:
  44.     // DATA MEMBERS
  45.     LZCONFIG          m_Config;         // configuration record
  46.     zUserOnline      *m_Useron;         // useron information (if any)
  47.     zDoubleList      *m_AreaList;       // dynamic list of areas
  48.     zDoubleList      *m_GroupList;      // list of all file groups, if any
  49.     zBucket<FILECFG> *m_Bucket;         // bucket object tied to FILECFG.PRO
  50.     zCommandBar      *m_GroupBar;       // group menu command bar
  51.     zCommandBar      *m_AreaBar;        // area menu command bar
  52.     zCommandBar      *m_ArchiveBar;     // archive menu command bar
  53.     zListViewer      *m_GroupBox;       // group list box
  54.     zListViewer      *m_AreaBox;        // area list box
  55.     zKeyboard        *m_Keyboard;       // the keyboard handler
  56.     zTerminal         m_Terminal;       // the terminal emulator
  57.     ansi_interp       m_ans;            // the ANSi interpreter
  58.     avatar_interp     m_avt;            // the avatar interpreter
  59.     pcboard_interp    m_pcb;            // the pcboard/wildcat! interpreter
  60.     Boolean           m_adjusted;       // have we adjusted bounds already
  61.     FILE             *m_fp;             // file that we store the lists in
  62.     char              m_fileName[80];   // path to the listerz file
  63.     FILECFG           m_CurArea;        // current area configuration
  64.     short             m_CurAreaNo;      // current area number processed
  65.     ulong             m_AreaBytes;      // total bytes for the current area
  66.     ulong             m_AreaFdls;       // total downloads for current area
  67.     ulong             m_AreaFiles;      // total files for current area
  68.     ulong             m_TotalFiles;     // total files processed
  69.     ulong             m_TotalKbytes;    // total file sizes processed
  70.     ulong             m_TotalFdls;      // total number of downloads
  71.     short             m_TotalAreas;     // total number of tagged areas
  72.     int               m_DeltaBytes;     // adjustment for the KByte value
  73.     ulong             m_ListerSize;     // size of the created list
  74.  
  75.     char              m_MainScreen[80]; // complete name for the main screen
  76.     char              m_ProcScreen[80]; // complete name for the processing
  77.     char              m_MainHeader[80]; // complete name for main header
  78.     char              m_MainFooter[80]; // complete name for main footer
  79.     char              m_AreaHeader[80]; // complete name for area header
  80.     char              m_AreaFooter[80]; // complete name for area footer
  81.  
  82.     // PRIVATE METHODS
  83.     Boolean BelongsToGroup(short nGroup, const FILECFG &area);
  84.     Boolean LoadAreaDefs(short nGroup);
  85.     void    AdjustBounds();
  86.     ushort  Process();
  87.     ushort  SetNewGroup();
  88.     ushort  ProcessGroups();
  89.     void    MakeAreaList();
  90.     void    ProcessFileArea(short index);
  91.     Boolean CompressFile(ushort command);
  92.     void    FormatLine(zFbbsLine &fbbs);
  93.     char*   ParseLineWithMacros(char *line);
  94.     int     MakeMacro(char *dest, char *src, int maxlen, char justify);
  95.     void    WriteHeaderOrFooter(char *fileTemplate);
  96.  
  97. public:
  98.     // STATIC CONSTANTS
  99.     static const char *s_AppName;     // application name
  100.     static const char *s_DefaultText; // default useron text
  101.     static const char *s_Version;     // application version string
  102. };
  103.  
  104. #endif /* INCLUDED_LSZ_APPL_H */
  105.