home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / imsgbox.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  4.3 KB  |  149 lines

  1. #ifndef _IMSGBOX_
  2. #define _IMSGBOX_
  3. /*******************************************************************************
  4. * FILE NAME: imsgbox.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IMessageBox                                                              *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18. #include <ivbase.hpp>
  19. #include <ibitflag.hpp>
  20. #include <iexcept.hpp>
  21. #include <istring.hpp>
  22.  
  23. class IMessageBoxData;
  24. class IResourceId;
  25. class IWindow;
  26.  
  27. #pragma pack(4)
  28.  
  29. class IMessageBox : public IVBase {
  30. typedef IVBase
  31.   Inherited;
  32. public:
  33. /*------------------------------- Constructors -------------------------------*/
  34.   IMessageBox ( IWindow* owner );
  35.  
  36. virtual
  37.  ~IMessageBox ( );
  38.  
  39. /*---------------------------------- Styles ----------------------------------*/
  40. INESTEDBITFLAGCLASSDEF0(Style, IMessageBox);
  41. static const Style
  42.   IC_IMPORTU okButton,
  43.   IC_IMPORTU okCancelButton,
  44. #ifndef IC_WIN_FLAGNOP
  45.   IC_IMPORTU cancelButton,
  46.   IC_IMPORTU enterButton,
  47.   IC_IMPORTU enterCancelButton,
  48. #endif
  49.   IC_IMPORTU retryCancelButton,
  50.   IC_IMPORTU abortRetryIgnoreButton,
  51.   IC_IMPORTU yesNoButton,
  52.   IC_IMPORTU yesNoCancelButton,
  53.   IC_IMPORTU defButton1,
  54.   IC_IMPORTU defButton2,
  55.   IC_IMPORTU defButton3,
  56.   IC_IMPORTU noIcon,
  57.   IC_IMPORTU informationIcon,
  58.   IC_IMPORTU queryIcon,
  59.   IC_IMPORTU warningIcon,
  60.   IC_IMPORTU errorIcon,
  61.   IC_IMPORTU applicationModal,
  62.   IC_IMPORTU systemModal
  63. #ifndef IC_WIN_FLAGNOP
  64.   ,
  65.   IC_IMPORTU moveable
  66. #endif
  67.   ;
  68.  
  69. /*-------------------------------- Title Text --------------------------------*/
  70. virtual IMessageBox
  71.  &setTitle( const char*        title ),
  72.  &setTitle( const IResourceId& title );
  73.  
  74. /*------------------------- Showing the Message Box --------------------------*/
  75. enum Response {
  76. #ifndef IC_WIN_FLAGNOP
  77.   enter,
  78. #endif
  79.   ok,
  80.   cancel,
  81.   abort,
  82.   retry,
  83.   ignore,
  84.   yes,
  85.   no,
  86.   unknown
  87.   };
  88.  
  89. enum Severity {
  90.   information,
  91.   warning,
  92.   action,
  93.   critical,
  94.   catastrophic
  95.   };
  96.  
  97. virtual IMessageBox::Response
  98.   show ( const char*        message,
  99.          Severity           severity,
  100.          unsigned long      helpId = 0 ),
  101.  
  102.   show ( const IResourceId& message,
  103.          Severity           severity,
  104.          unsigned long      helpId = 0 ),
  105.  
  106.   show ( const IResourceId& message,
  107.          const Style&       style,
  108.          unsigned long      helpId = 0 ),
  109.  
  110.   show ( const char*        message,
  111.          const Style&       style,
  112.          unsigned long      helpId = 0 ),
  113.  
  114.   show ( const IException&  exception,
  115.          unsigned long      helpId = 0 ),
  116.  
  117.   show ( const IBaseErrorInfo&  error,
  118.          unsigned long      helpId = 0 );
  119.  
  120. private:
  121. /*------------------------------ Hidden Members ------------------------------*/
  122.   IMessageBox ( const IMessageBox& messageBox );
  123. IMessageBox
  124.  &operator=   ( const IMessageBox& messageBox );
  125.  
  126. /*--------------------------------- Private ----------------------------------*/
  127.   unsigned long
  128.     showMessageBox  ( const char*   message,
  129.                       const char*   title,
  130.                       unsigned long helpPanelId,
  131.                       const Style&  style );
  132.  
  133.   static Style
  134.     convertSeverity ( Severity      severity );
  135. static IMessageBox::Response
  136.   convertResponse ( unsigned long buttonId );
  137. IString
  138.   strClTitle;
  139. IWindow
  140.  *pwndClOwner;
  141.  
  142. IMessageBoxData
  143.  *fMessageBoxData;
  144. }; // IMessageBox
  145.  
  146. #pragma pack()
  147.  
  148. #endif  /* _IMSGBOX_  */
  149.