home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spiele Shareware / os2games.iso / os2games / addons / pmics / src / wcomm.hh < prev    next >
Encoding:
Text File  |  1994-12-14  |  3.2 KB  |  127 lines

  1. #ifndef WCOMM_DEFINED
  2. #define WCOMM_DEFINED
  3. //**************************************************************************
  4. // Class:   CommWindow                                                     *
  5. //                                                                         *
  6. // Purpose: Terminal emulation window.                                     *
  7. //                                                                         *
  8. //**************************************************************************
  9.  
  10. #include <iframe.hpp>
  11. #include <icmdhdr.hpp>
  12. #include <iedithdr.hpp>
  13. #include <ientryfd.hpp>
  14. #include <istattxt.hpp>
  15. #include <icheckbx.hpp>
  16. #include <iradiobt.hpp>
  17. #include <iselhdr.hpp>
  18. #include <ilistbox.hpp>
  19. #include <ikeyhdr.hpp>
  20. #include <istring.hpp>
  21.  
  22. class ACommFilter;
  23. class CommEditHandler;
  24. class CommMsgHandler;
  25.  
  26. class CommWindow : public IListBox,
  27.            public IKeyboardHandler
  28. {
  29. public:                               //Define the public Information
  30.   CommWindow(unsigned long windowId, //Constructor for this class
  31.          IWindow *parent);
  32.   Boolean         key(IKeyboardEvent &evt);
  33.   void            lookForChallenge (IString &line);
  34.   void            fontDialog();
  35.   ACommFilter     *commFilter;
  36.   void            timerTick(int count = -1);
  37.   Boolean         cr2lf,
  38.                   bs2del,
  39.                   localecho;
  40.   char crChar() { return cr2lf ? (char)10 : (char)13; }
  41. private:                              //Define the private Information
  42.   CommEditHandler     *editHandler;
  43.   CommMsgHandler      *msgHandler;
  44. };
  45.  
  46.  
  47. class ACommFilter
  48. {
  49. public:
  50.   virtual Boolean filter(IString &) = 0;
  51. };
  52.  
  53.  
  54. class ACommFilterStyle12 : public ACommFilter
  55. {
  56. public:
  57.   Boolean filter(IString &);
  58. };
  59.  
  60.  
  61.  
  62. class CommMsgHandler : public IHandler
  63. {
  64. public:
  65.   CommMsgHandler(CommWindow *w) { commWindow = w; }
  66.   Boolean dispatchHandlerEvent(IEvent &evt);
  67. private:
  68.   CommWindow    *commWindow;
  69. };
  70.  
  71.  
  72. class CommEditHandler : public IEditHandler
  73. {
  74. public:
  75.   Boolean edit (IControlEvent &evt);
  76. };
  77.  
  78.  
  79. class AMatchSelectHandler;
  80.  
  81. class AMatchDialog : public IFrameWindow, public ICommandHandler
  82. {
  83.   public:                               //Define the public Information
  84.     AMatchDialog(IWindow *parent,
  85.          IWindow *owner,
  86.          IWindow *commWin,
  87.          IString cName,
  88.          int     cIsRated,
  89.          int     cWildType,
  90.          int     isWhite,
  91.          int     isBlack,
  92.          IString cClock,
  93.          IString cOddsClock);        //Constructor for this class
  94.  
  95.     IEntryField    *clock,
  96.                    *oddsClock,
  97.                    *wildType;
  98.     IRadioButton   *white,
  99.                    *black,
  100.                    *neutral;
  101.     IStaticText    *opponent;
  102.     ICheckBox      *rated,
  103.                    *wild;
  104.     IWindow        *commWind;   // save so we can set focus at end
  105.     Boolean        initialRated,
  106.                    initialWhite,
  107.                    initialBlack;
  108.     int            initialWildType;
  109.     IString        initialClock,
  110.                    initialOddsClock;
  111.  
  112.     AMatchSelectHandler *selectHdr;
  113.  
  114.   protected:
  115.     Boolean command (ICommandEvent& cmdEvent);
  116. };
  117.  
  118.  
  119. class AMatchSelectHandler : public ISelectHandler
  120. {
  121. protected:
  122.   virtual Boolean selected( IControlEvent &evt );
  123. };
  124.  
  125. #endif
  126.  
  127.