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

  1. #ifndef _IKEYEVT_
  2.   #define _IKEYEVT_
  3. /*******************************************************************************
  4. * FILE NAME: ikeyevt.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IKeyboardEvent                                                           *
  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 <ievent.hpp>
  19.  
  20. class IString;
  21. class IKeyboardHandler;
  22. class IKeyboardEventPrivateData;
  23.  
  24. #pragma pack(4)
  25.  
  26. class IKeyboardEvent : public IEvent {
  27. typedef IEvent
  28.   Inherited;
  29. public:
  30. /*------------------------------ Constructors --------------------------------*/
  31.   IKeyboardEvent     ( const IEvent& event );
  32. virtual
  33.  ~IKeyboardEvent     ( );
  34.  
  35. /*--------------------------------- Testing ----------------------------------*/
  36. Boolean
  37.   isCharacter        ( ) const,
  38.   isScanCode         ( ) const,
  39.   isVirtual          ( ) const,
  40.   isUpTransition     ( ) const,
  41.   isRepeat           ( ) const,
  42.   isShiftDown        ( ) const,
  43.   isCtrlDown         ( ) const,
  44.   isAltDown          ( ) const,
  45.   isForComposite     ( ) const,
  46.   isComposite        ( ) const,
  47.   isInvalidComposite ( ) const;
  48. #ifndef IC_WIN_FLAGNOP
  49. Boolean
  50.   isUncombined       ( ) const;
  51. #endif
  52.  
  53. /*-------------------------------- Accessors ---------------------------------*/
  54. char
  55.   character          ( ) const;
  56. IString
  57.   mixedCharacter     ( ) const;
  58. unsigned long
  59.   scanCode           ( ) const;
  60.  
  61. enum VirtualKey
  62. {
  63.   esc, tab, backTab, space, backSpace, enter, newLine,
  64.   shift, ctrl, altGraf, insert, deleteKey, home, end,
  65.   pageUp, pageDown, left, right, up, down,
  66.   capsLock, numLock, scrollLock, pause,
  67. #ifndef IC_WIN_FLAGNOP
  68.   sysRq,
  69. #endif
  70.   breakKey,
  71.   f2, f3, f4, f5, f6, f7, f8, f9, f11, f12,
  72.   f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24,
  73.   button1, button2, button3, other
  74.   , f1, f10
  75. };
  76.  
  77. VirtualKey
  78.   virtualKey         ( ) const;
  79.  
  80. unsigned long
  81.   repeatCount        ( ) const;
  82.  
  83.  
  84. protected:
  85. /*------------------------------ Implementation ------------------------------*/
  86. static const unsigned long
  87. #ifndef IC_WIN_FLAGNOP
  88.   IC_IMPORTU ulCharacterFlag,
  89.   IC_IMPORTU ulScanCodeFlag,
  90.   IC_IMPORTU ulVirtualFlag,
  91.   IC_IMPORTU ulRepeatFlag,
  92.   IC_IMPORTU ulUncombinedFlag,
  93.   IC_IMPORTU ulShiftFlag,
  94.   IC_IMPORTU ulCtrlFlag,
  95.   IC_IMPORTU ulForCompositeFlag,
  96.   IC_IMPORTU ulCompositeFlag,
  97.   IC_IMPORTU ulInvalidCompositeFlag,
  98. #endif
  99.   IC_IMPORTU ulUpTransitionFlag,
  100.   IC_IMPORTU ulAltFlag;
  101.  
  102. private:
  103. friend IKeyboardHandler;
  104. Boolean
  105.   fValidComposite,
  106.   fInvalidComposite;
  107. IKeyboardEventPrivateData
  108.  *pData;
  109. }; // IKeyboardEvent
  110.  
  111. #pragma pack()
  112.  
  113. /*----------------------------- Inline Functions -----------------------------*/
  114.   #include <ikeyevt.inl>
  115.  
  116. #endif /* _IKEYEVT_ */
  117.