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

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // OApp.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/OApp.hpp 1.1 1996/08/12 00:01:08 B.STEIN Release $
  33.  
  34. #ifndef OAPP_INCLUDED
  35.   #define OAPP_INCLUDED
  36.  
  37.  
  38. #ifndef OPMINIT_INCLUDED
  39.   #include <OPMinit.hpp>
  40. #endif
  41.  
  42. #ifndef OAPPBASE_INCLUDED
  43.   #include <OAppBase.hpp>
  44. #endif
  45.  
  46. #ifndef OCOMMAND_INCLUDED
  47.   #include <OCommand.hpp>
  48. #endif
  49.  
  50.  
  51. // classes
  52.  
  53.  
  54. typedef class OApp *pOApp;
  55.  
  56. class __CPP_EXPORT__ OApp
  57.   : public OAppBase
  58.     
  59. {
  60.  private:
  61.    OCommandHandler    OCMD_NullHandler;
  62.  
  63.  protected:
  64.    QMSG               qmsg;
  65.    OPMinit            init;
  66.  
  67.  public:
  68.  
  69.    static pOApp       currentOApp;
  70.  
  71.  
  72.       OApp           (ULONG queueSize = 10);      
  73.       OApp           (const ULONG num,
  74.                       CHAR *Parms[],
  75.                       ULONG queueSize = 10);
  76.  
  77.    virtual
  78.       ~OApp          ();
  79.  
  80.    virtual
  81.       PSZ isOfType   () const; 
  82.  
  83.    virtual
  84.       void run       ();       // enhanced message loop
  85.  
  86.    HAB
  87.       anchor         ();
  88.  
  89.    HMQ
  90.       mqueue         ();   
  91.  
  92.    virtual BOOL
  93.       QuitPosted     (),       // a window posted a quit message,  default is ret FALSE = to quit
  94.       TasklistKill   (),       // user tried to close a window from the tasklist,  default is ret FALSE = to quit
  95.       ShutdownPosted ();       // system posted shutdown-message,  default is ret FALSE = to quit
  96.  
  97.  
  98.    pOCommandHandler
  99.       NullHandler    ();
  100.  
  101.  
  102.    static OApp&
  103.       current        ();
  104.  
  105.    // although public this function is for internal use only and must not be used !!
  106.  
  107.    static BOOL
  108.       OCMDTrace      (const HWND hwnd,
  109.                       const ULONG msg,
  110.                       const MPARAM mp1, 
  111.                       const MPARAM mp2);
  112.  
  113. // overloaded from OAppBase
  114.  
  115.    virtual void 
  116.       forceQuit      (),      // force OApp::run() to return
  117.       Shutdown       (),      // force PM-Shutdown
  118.       Reboot         ();      // force DOS-Shutdown and reboot
  119. };
  120.  
  121.  
  122. #endif // OAPP_INCLUDED
  123.  
  124.  
  125. // end of source
  126.