home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IMSGBOX_
- #define _IMSGBOX_
- /*******************************************************************************
- * FILE NAME: imsgbox.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * IMessageBox - the message box class *
- * *
- * COPYRIGHT: *
- * Licensed Materials - Property of IBM *
- * (C) Copyright IBM Corporation 1992, 1993 *
- * All Rights Reserved *
- * US Government Users Restricted Rights - Use, duplication, or disclosure *
- * restricted by GSA ADP Schedule Contract with IBM Corp. *
- * *
- *$Log: R:/IBMCLASS/IBASEAPP/VCS/IMSGBOX.HPV $ *
- //
- // Rev 1.5 25 Oct 1992 19:30:58 nunn
- // Kevin's changes for external beta
- //
- // Rev 1.4 25 Oct 1992 18:00:42 nunn
- // Brad Broyles changes for external beta
-
- Rev 1.1 01 Apr 1992 12:00:00 KKL
- Initial Design and Code
- Rev 1.2 05 Sep 1992 12:00:00 KKL
- Update for IBMCPP & new IException
- Rev 1.3 22 Oct 1992 12:00:00 WBB
- Amend to match skeleton.hpp
- *******************************************************************************/
- #ifndef _IBASE_
- #include <ibase.hpp>
- #endif
-
- // Forward declarations for other classes:
- class IWindow;
- class IResourceId;
- class IException;
- #if !defined( _ISTRING_ ) && !defined( I_NO_RELATED_HPP )
- #include <istring.hpp>
- #endif
- #if !defined( _IBITFLAG_ ) && !defined( I_NO_RELATED_HPP )
- #include <ibitflag.hpp>
- #endif
-
- class IMessageBox : public IBase {
- /*******************************************************************************
- * The IMessageBox class deals with WinMessageBox and has functions to show *
- * different types of CUA message boxes and to accept an IException object. *
- *******************************************************************************/
- typedef IBase Inherited;
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is one way to construct instances of this class: |
- | 1. using an instance of IWindow |
- | the instance of IWindow becomes the owner of the new message box |
- ------------------------------------------------------------------------------*/
- IMessageBox(const IWindow* owner);
-
- /*-------------------------------- ACCESSORS -----------------------------------
- | These function provide means of getting and setting the accessible |
- | attributes of instances of this class: |
- | setTitle - sets the message box's title |
- | show - given a message text string, show the message box |
- ------------------------------------------------------------------------------*/
- INESTEDBITFLAGCLASSDEF0(Style, IMessageBox);
- static const Style
- okButton, // button
- okCancelButton,
- cancelButton,
- enterButton,
- enterCancelButton,
- retryCancelButton,
- abortRetryIgnoreButton,
- yesNoButton,
- yesNoCancelButton,
-
- defButton1, // default button action
- defButton2,
- defButton3,
-
- noIcon, // icon shown
- handIcon,
- questionIcon,
- exclamationIcon,
- asteriskIcon,
- informationIcon,
- queryIcon,
- warningIcon,
- errorIcon,
- criticalIcon,
- notificationIcon,
-
- applicationModal, // modality
- systemModal,
-
- moveable; // mobility
-
- void
- setTitle(const IString& title),
- setTitle(const IResourceId& title);
-
- enum Severity {information, warning, action, critical, catastrophic };
- enum Response {enter, ok, cancel, abort, retry, ignore, yes, no };
-
- IMessageBox::Response
- show(const char* msgText, Severity s, unsigned long helpId = 0),
- show(const IResourceId& resId, Severity s, unsigned long helpId = 0),
- show(const char* msgText, Style s, unsigned long helpId = 0),
- show(const IResourceId& resId, Style s, unsigned long helpId = 0),
- show(const IException& exceptionObj, unsigned long helpId = 0);
-
- private:
- /*--------------------------------- PRIVATE ----------------------------------*/
- static unsigned long
- convertSeverity(Severity s);
- static IMessageBox::Response
- convertResponse(unsigned long ulId);
- IString
- strClTitle;
- const IWindow*
- pwndClOwner;
- }; // IMessageBox
-
- #endif /* _IMSGBOX_ */