home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IACCEL_
- #define _IACCEL_
- /**************************************************************/
- /* FILE NAME: iaccel.hpp */
- /* */
- /* DESCRIPTION: */
- /* Declaration of the class: */
- /* IAccelertor - wrapper for menu accelerators */
- /* */
- /* COPYRIGHT: */
- /* Licensed Materials - Property of IBM */
- /* (c) Copyright IBM Corporation 1992, 1993 */
- /* US Government Users Restricted Rights - Use duplication */
- /* or disclosure restricted by GSA ADP Schedule Contract */
- /* with IBM Corp. */
- /* */
- /* $Log: G:/IBMCLASS/IBASEAPP/VCS/IACCEL.HPV $ */
- //
- // Rev 1.3 26 Oct 1992 10:07:32 HARPERSP
- // Updates for documentation.
- //
- // Rev 1.2 16 Oct 1992 18:48:14 HARPERSP
- // Removed all the "system" member functions (ie. setSystemAccel(), etc.).
- // Now pass an IWindow* if the accelerator applies to a given window, or
- // just leave off the IWindow* on the cstor and it will apply to all
- // windows.
- /* */
- /**************************************************************/
-
- #ifndef _IBASETYP_
- #include <ibasetyp.hpp>
- #endif
-
- #ifndef _IWINDOW_
- #include <iwindow.hpp>
- #endif
-
- #ifndef _IHANDLE_
- #include <ihandle.hpp>
- #endif
-
- // Forward declarations for other classes
- class IAccelerator; /* ac */
- class IResourceId;
-
- class IAccelerator
- {
-
- /**********************************************************************
- * Wrapper for menu accelerators *
- * *
- * *
- **********************************************************************/
-
- public:
-
- /*------------------ CONSTRUCTORS/DESTRUCTORS -------------------------
- | There are 2 ways to construct instances of this class: |
- | |
- | 1. From an IAccelTblHandle |
- | |
- | 2. From an IResourceId |
- | |
- | All constructors take an optional second parameter that is a |
- | const IWindow*. If this IWindow* is supplied then the accelerator |
- | will only be in effect when that IWindow object has the focus. |
- | If the second parameter is omitted on the constructor, the the |
- | IAccelerator will apply to all Windows in the application but |
- | will have no effect on other applications that are currently |
- | running. |
- ---------------------------------------------------------------------*/
-
- IAccelerator(const IAccelTblHandle& haccel = 0,
- const IWindow* const pwndOwner = 0);
-
- IAccelerator(const IResourceId& accelResId,
- const IWindow* const pwndOwner = 0);
-
- IAccelerator(unsigned long accelResId,
- const IWindow* const pwndOwner = 0);
-
- ~IAccelerator();
-
-
- /*---------------------- ACCESSORS ------------------------------------
- | |
- | setAccel - changes the IAccelerator to specified setting |
- | |
- | removeAccel - removes the Accelerator and does not restore to |
- | the one previously in effect. |
- | |
- | unsetAccel - removes the Accelerator but restores the one that |
- | was previously in effect |
- | |
- | isAccelSet - returns true if the Accelerator is in effect |
- | |
- | accel - returns the IAccelTblHandle of the Accelerator in effect |
- | |
- | ownerHandle - returns the IWindowHandle to which the Accelerator |
- | applies |
- ---------------------------------------------------------------------*/
-
- void setAccel(const IAccelTblHandle& haccel);
- void setAccel(const IResourceId& accelResId);
- void setAccel(unsigned long accelResId);
-
- void removeAccel();
- void unsetAccel();
-
- Boolean isAccelSet();
- IAccelTblHandle const accel();
- IWindowHandle ownerHandle();
-
-
- /*----------------------- PRIVATE -----------------------------------*/
- private:
-
- IAccelerator(const IAccelerator& acCopy);
- create(const IWindow* const pwndOwner);
-
- const IWindow* pwndClOwner;
- IAccelTblHandle haccelCl;
- IAccelTblHandle haccelClPrior;
- IAccelTblHandle haccelClOriginal;
- };
- #endif /* ifndef _IACCEL_ */