home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / oclsrc15.zip / OCL / Include / OMessage.hpp < prev    next >
C/C++ Source or Header  |  1996-08-12  |  4KB  |  118 lines

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // OMessage.hpp
  5.  
  6.  
  7. /*
  8.  * Redistribution and use in source and binary forms, with or without
  9.  * modification, are permitted provided that the following conditions
  10.  * are met:
  11.  * 1. Redistributions of source code must retain the above copyright
  12.  *    notice, this list of conditions and the following disclaimer.
  13.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  14.  *    endorse or promote products derived from this software
  15.  *    without specific prior written permission.
  16.  * 3. See OCL.INF for a detailed copyright notice.
  17.  *
  18.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  19.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  20.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  21.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  22.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  24.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  25.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  26.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  27.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28.  * SUCH DAMAGE.
  29.  */
  30.  
  31.  
  32. // $Header: W:/Projects/OCL/Include/rcs/OMessage.hpp 1.50 1996/08/11 23:47:22 B.STEIN Release $
  33.  
  34. #ifndef OMESSAGE_INCLUDED
  35.   #define OMESSAGE_INCLUDED
  36.  
  37.  
  38. #ifndef OMESSAGE_H_INCLUDED
  39.   #include <OMessage.h>
  40. #endif
  41.  
  42. #ifndef OVIOEXCEPTION_INCLUDED
  43.   #include <OVioException.hpp>
  44. #endif
  45.  
  46.  
  47. #define OCL_MAXMESSAGE  512
  48.  
  49.  
  50. // classes
  51.  
  52.  
  53. typedef class OMessage *pOMessage;
  54.  
  55.  
  56. class __CPP_EXPORT__ OMessage
  57.   : public OCLObject
  58. {
  59.  private:
  60.    OString          message;
  61.    ULONG            msglen;
  62.  
  63.    OMessage&
  64.       retrieve      (ULONG,
  65.                      PSZ, PSZ, PSZ, PSZ, PSZ,
  66.                      PSZ, PSZ, PSZ, PSZ, PSZ);
  67.  public:
  68.  
  69.    OMessage            ();
  70.  
  71.    OMessage            (ULONG msgId,
  72.                         PSZ   msgFileName = "OSO001.MSG",
  73.                         PSZ   textInsert1 = NULL,
  74.                         PSZ   textInsert2 = NULL,
  75.                         PSZ   textInsert3 = NULL,
  76.                         PSZ   textInsert4 = NULL,
  77.                         PSZ   textInsert5 = NULL,
  78.                         PSZ   textInsert6 = NULL,
  79.                         PSZ   textInsert7 = NULL,
  80.                         PSZ   textInsert8 = NULL,
  81.                         PSZ   textInsert9 = NULL);
  82.  
  83.  
  84.    virtual
  85.       ~OMessage        ();
  86.  
  87.    virtual
  88.       PSZ isOfType     () const; 
  89.  
  90.  
  91.       ULONG getLen     ();
  92.       PSZ   getText    ();
  93.       PSZ   getMessage (ULONG msgId,
  94.                         PSZ   msgFileName = "OSO001.MSG",
  95.                         PSZ   textInsert1 = NULL,
  96.                         PSZ   textInsert2 = NULL,
  97.                         PSZ   textInsert3 = NULL,
  98.                         PSZ   textInsert4 = NULL,
  99.                         PSZ   textInsert5 = NULL,
  100.                         PSZ   textInsert6 = NULL,
  101.                         PSZ   textInsert7 = NULL,
  102.                         PSZ   textInsert8 = NULL,
  103.                         PSZ   textInsert9 = NULL);
  104.  
  105.    friend ostream
  106.       &operator <<  (ostream& out, pOMessage s);
  107.  
  108.    inline
  109.       operator PSZ     () const { return(message.getText()); }
  110.  
  111. };
  112.  
  113.  
  114. #endif // OMESSAGE_INCLUDED
  115.  
  116.  
  117. // end of source
  118.