home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / ALERTDRV.ZIP / ALERTOBJ.H < prev    next >
C/C++ Source or Header  |  1994-01-25  |  4KB  |  99 lines

  1. #ifndef ALERTOBJ_H
  2. #define ALERTOBJ_H
  3.  
  4.  
  5.  
  6. /*------------------------------------------------------------------------------
  7.    Copyright           : (c)1993 by Logical Operators
  8.                          All Rights Reserved.
  9.    Filename            : AlertObj.H
  10.    Header File         : AlertObj.H
  11.    Purpose             : Header file for the AlertableObject classes. An
  12.                          AlertableObject object can use an AlertDriver object
  13.                          to alert the user of errors or program conditions.
  14.                          Because the AlertDriver object handles the details of
  15.                          presenting the output to the user, descendants of
  16.                          AlertableObject can be constructed to produce these
  17.                          "user alerts" in a device-independent manner which can
  18.                          then be determined or altered at run-time.
  19.    Compiler Directives : None
  20.  
  21.    Modification History:
  22.    Version   Date    Programmer and Description of Changes
  23.    ------- --------  --------------------------------------------------------
  24.     1.00   01/15/94  Original version by Warren J. Hairston.
  25.    ---------------------------------------------------------------------------*/
  26.  
  27.  
  28.  
  29.    //included files
  30.    //--------------
  31.    #ifndef ALERTDRV_H
  32.       #include <ALERTDRV.H>   //AlertDriver and related class declarations
  33.    #endif   //ALERTDRV_H
  34.  
  35.  
  36.  
  37.    /*constants - used to denote common error, info, message, and warning
  38.                  conditions for all classes*/
  39.    //-------------------------------------------------------------------
  40.    const long errOK = 0x00;    //no error
  41.    const long infoOK = 0x00;   //no information
  42.    const long msgOK = 0x00;    //no message
  43.    const long warnOK = 0x00;   //no warning
  44.  
  45.  
  46.  
  47.    //class declarations
  48.    //------------------
  49.    class AlertableObject : public AlertDriverLink
  50.    {
  51.       public:
  52.          //constructor(s)
  53.          //--------------
  54.          AlertableObject(void);
  55.  
  56.          //member functions
  57.          //----------------
  58.                  void           ChangeAlertProcFlags(
  59.                                    const unsigned short newFlags,
  60.                                    const unsigned short options =
  61.                                       cfoCHAIN | cfoOVERWRITE);
  62.                  void           ClearMessage(void) const {ReportMessage("");}
  63.                  unsigned short GetAlertProcFlags(void) const
  64.                                    {return ((linkedAlertDriver)
  65.                                        ? linkedAlertDriver->GetProcFlags()
  66.                                        : 0);}
  67.          virtual void           GetErrorText(const long errorCode, char *text);
  68.          virtual void           GetInfoText(const long infoCode, char *text);
  69.          virtual void           GetMessageText(const long msgCode, char *text);
  70.          virtual void           GetWarningText(const long warnCode, char *text);
  71.                  void           HandleError(const long errorCode);
  72.                  void           HandleInfo(const long infoCode);
  73.                  void           HandleMessage(const long msgCode);
  74.                  unsigned short HandleWarning(const long warnCode,
  75.                                               const unsigned short
  76.                                                  defaultChoice);
  77.                  void           ReportError(const char *text) const;
  78.                  void           ReportInfo(const char *text) const;
  79.                  void           ReportMessage(const char *text) const;
  80.                  unsigned short ReportWarning(const char *text,
  81.                                               unsigned short defaultChoice)
  82.                                    const;
  83.  
  84.          //platform-specific member functions
  85.          //----------------------------------
  86.          #ifdef BORLAND_CONTAIN
  87.             virtual hashValueType hashValue() const {return 0;}
  88.             virtual classType     isA() const {return 0;}
  89.             virtual int           isEqual (const Object& testObject) const
  90.                                      {return 0;}
  91.             virtual char*         nameOf() const {return "AlertableObject";}
  92.             virtual void          printOn(ostream& outputStream) const {}
  93.          #endif   //BORLAND_CONTAIN
  94.    };   //class AlertableObject
  95.  
  96.  
  97.  
  98. #endif //ALERTOBJ_H
  99.