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

  1. #ifndef _IACCELKY_
  2.   #define _IACCELKY_
  3. /*******************************************************************************
  4. * FILE NAME: iaccelky.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IAcceleratorKey                                                          *
  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 <ibase.hpp>
  19. #include <icmd.hpp>
  20. #include <ikey.hpp>
  21.  
  22.  
  23. class IAcceleratorKeyData;
  24. class IString;
  25. struct _ACCEL;
  26. struct tagACCEL;
  27. typedef struct tagACCEL ACCEL;
  28.  
  29. #pragma pack(4)
  30.  
  31. class IAcceleratorKey : public IBase {
  32. typedef IBase
  33.   Inherited;
  34. public:
  35. /*------------------------------- Constructors -------------------------------*/
  36.   IAcceleratorKey ( IKey::VirtualKey         virtualKey,
  37.                     const IKey::KeyModifier& modifier,
  38.                     ICommand::ActionType     actionType = ICommand::applicationCommand,
  39.                     ICommand::CommandId      commandId = 0 );
  40.   IAcceleratorKey ( const IString&           characterKey,
  41.                     const IKey::KeyModifier& modifier,
  42.                     ICommand::ActionType     actionType = ICommand::applicationCommand,
  43.                     ICommand::CommandId      commandId = 0 );
  44.   IAcceleratorKey ( const ACCEL&             accelerator );
  45.   IAcceleratorKey ( const IAcceleratorKey&   key );
  46. IAcceleratorKey
  47.  &operator=       ( const IAcceleratorKey&   key );
  48.  
  49.  ~IAcceleratorKey ( );
  50.  
  51. /*------------------------------- Comparisons --------------------------------*/
  52. Boolean
  53.   operator== ( const IAcceleratorKey& key ) const,
  54.   operator!= ( const IAcceleratorKey& key ) const,
  55.   isLike     ( const IAcceleratorKey& key ) const;
  56.  
  57. /*----------------------------- Key Definitions ------------------------------*/
  58. IAcceleratorKey
  59.  &setKey         ( const IString&           accelKey,
  60.                    const IKey::KeyModifier& modifier = IKey::noModifier ),
  61.  &setKey         ( IKey::VirtualKey         virtualKey,
  62.                    const IKey::KeyModifier& modifier = IKey::noModifier );
  63. IString
  64.   character      ( ) const;
  65. IKey::VirtualKey
  66.   virtualKey     ( ) const;
  67. IKey::KeyModifier
  68.   keyModifier    ( ) const;
  69.  
  70. /*---------------------------- Action Definitions ----------------------------*/
  71. IAcceleratorKey
  72.  &setCommand       ( ICommand::CommandId commandId ),
  73.  &setSystemCommand ( ICommand::CommandId commandId ),
  74.  &setHelpKey       ( );
  75.  
  76. ICommand::ActionType
  77.   actionType       ( ) const;
  78.  
  79. ICommand::CommandId
  80.   commandId        ( ) const;
  81.  
  82. /*------------------------------- Conversions --------------------------------*/
  83. ACCEL
  84.   asACCEL        ( ) const;
  85.  
  86. protected:
  87. /*-------------------------------- Identifier --------------------------------*/
  88. static unsigned long
  89.   uniqueKeyFor   ( const IAcceleratorKey& key );
  90.  
  91. private:
  92. /*--------------------------------- Private ----------------------------------*/
  93. friend unsigned long const
  94.  &key            ( IAcceleratorKey const&   item );
  95. IAcceleratorKey
  96.  &setKeyModifier ( const IKey::KeyModifier& modifier );
  97. IAcceleratorKeyData
  98.  *fData;
  99. };  // IAcceleratorKey
  100.  
  101. #pragma pack()
  102.  
  103.   #include <iaccelky.inl>
  104.  
  105. #endif /* _IACCELKY_ */
  106.