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

  1. #ifndef _ICMDHDR_
  2. #define _ICMDHDR_
  3. /*******************************************************************************
  4. * FILE NAME: icmdhdr.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class:                                                  *
  8. *     ICommandHandler                                                          *
  9. *     ICommandConnectionTo                                                     *
  10. *                                                                              *
  11. * COPYRIGHT:                                                                   *
  12. *   IBM Open Class Library                                                     *
  13. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  14. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  15. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. *******************************************************************************/
  19. #include <ihandler.hpp>
  20. #include <icmdevt.hpp>
  21.  
  22. class IEvent;
  23.  
  24. #pragma pack(4)
  25.  
  26. class ICommandHandler : public IHandler {
  27. typedef IHandler
  28.   Inherited;
  29. public:
  30. /*------------------------------- Constructors -------------------------------*/
  31.   ICommandHandler ( );
  32. virtual
  33.  ~ICommandHandler ( );
  34.  
  35. protected:
  36. /*---------------------------- Event Dispatching -----------------------------*/
  37. virtual Boolean
  38.   dispatchHandlerEvent ( IEvent& event );
  39.  
  40. /*----------------------------- Event Processing -----------------------------*/
  41. virtual Boolean
  42.   command       ( ICommandEvent& event ),
  43.   systemCommand ( ICommandEvent& event );
  44. }; // ICommandHandler
  45.  
  46. #pragma info(nocpy)
  47.  
  48. template <class ATarget>
  49. class ICommandConnectionTo : public ICommandHandler {
  50. typedef ICommandHandler
  51.   Inherited;
  52. public:
  53. /*----------------------------- Type Definitions -----------------------------*/
  54. typedef Boolean  (ATarget::* MemberFunction)( ICommandEvent& );
  55.  
  56. /*------------------------------- Constructors -------------------------------*/
  57.   ICommandConnectionTo ( ATarget&       target,
  58.                          MemberFunction memberFunction );
  59. virtual
  60.  ~ICommandConnectionTo ( );
  61.  
  62. protected:
  63. /*----------------------------- Event Processing -----------------------------*/
  64. virtual Boolean
  65.   command       ( ICommandEvent& event ),
  66.   systemCommand ( ICommandEvent& event );
  67.  
  68. private:
  69. /*--------------------------------- Private ----------------------------------*/
  70. ATarget
  71.  &fTarget;
  72. MemberFunction
  73.   fConnectedMember;
  74. }; // ICommandConnectionTo
  75.  
  76. #ifndef __TEMPINC__
  77.   #include <icmdhdr.c>
  78. #endif
  79.  
  80. #pragma info(restore)
  81.  
  82. #pragma pack()
  83.  
  84. #endif /* _ICMDHDR_ */
  85.