home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / ICNRHDR.HPP < prev    next >
C/C++ Source or Header  |  1993-10-22  |  8KB  |  129 lines

  1. #ifndef _ICNRHDR_
  2. #define _ICNRHDR_
  3. /*******************************************************************************
  4. * FILE NAME: icnrhdr.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     ICnrHandler                                                              *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   (C) Copyright IBM Corporation 1992                                         *
  12. *   All Rights Reserved                                                        *
  13. *   Licensed Materials * Property of IBM                                       *
  14. *                                                                              *
  15. * HISTORY:                                                                     *
  16. *******************************************************************************/
  17. #ifndef _IHANDLER_
  18.   #include <ihandler.hpp>
  19. #endif
  20.  
  21. #ifndef _ICNREVT_
  22.   #include <icnrevt.hpp>
  23. #endif
  24.  
  25. /*----------------------------------------------------------------------------*/
  26. /* Align classes on four byte boundary.                                       */
  27. /*----------------------------------------------------------------------------*/
  28. #pragma pack(4)
  29.  
  30. class ICnrHandler : public IHandler
  31. {
  32. /*******************************************************************************
  33. * The ICnrHandler class provides basic event handling capability for the       *
  34. * container.  It dispatches the following events in the container:             *
  35. *                                                                              *
  36. *   - Scrolling past the container's delta value.                              *
  37. *   - Expanding and collapsing of nodes in a tree view.                        *
  38. *   - An Enter operation using either the keyboard or the mouse.               *
  39. *   - A change in selection, in-use, or cursored emphasis of an object in the  *
  40. *     container.                                                               *
  41. *   - Scrolling of the container window.                                       *
  42. *   - A help request in the container.                                         *
  43. *******************************************************************************/
  44. public:
  45.  
  46. /*------------------------ Constructors ----------------------------------------
  47. | The only way to construct an instance of this class is to use the default    |
  48. | constructor.                                                                 |
  49. ------------------------------------------------------------------------------*/
  50.   ICnrHandler();
  51.  ~ICnrHandler();
  52.  
  53. /*------------------------ Event Processing Functions --------------------------
  54. | These functions must be supplied by a derived class in order to provide      |
  55. | processing for an edit event:                                                |
  56. |   deltaReached    - Called when the container is scrolled to the predefined  |
  57. |                     delta.                                                   |
  58. |   treeCollapsed   - Called when an object is being collapsed in the          |
  59. |                     container.  The default behavior is to call the          |
  60. |                     IContainerObject::handleTreeCollapsed function.          |
  61. |   treeExpanded    - Called when an object is being expanded in the container.|
  62. |                     The default behavior is to call the                      |
  63. |                     IContainerObject::handleTreeExpanded function.           |
  64. |   enter           - Called when the Enter key or the mouse select button is  |
  65. |                     used on an object. If the Enter occurs over an object,   |
  66. |                     the default behavior is to call the                      |
  67. |                     IContainerObject::handleOpen function. Otherwise, the    |
  68. |                     Enter is ignored.                                        |
  69. |   selectedChanged - Called when the selection emphasis of an object changes. |
  70. |                     The default behavior is to call the                      |
  71. |                     IContainerObject::handleSelectChange function.           |
  72. |   inuseChanged    - Called when the in-use emphasis of an object changes.    |
  73. |                     The default behavior is to call the                      |
  74. |                     IContainerObject::handleInuseChange function.            |
  75. |   cursoredChanged - Called when the cursored emphasis of an object changes.  |
  76. |                     The default behavior is to call the                      |
  77. |                     IContainerObject::handleCursoredChange function.         |
  78. |   windowScrolled  - Called when the container window is scrolled. The        |
  79. |                     default behavior is to do nothing.                       |
  80. |   help            - Called when help is requested in a container. The        |
  81. |                     default behavior is to do nothing.                       |
  82. ------------------------------------------------------------------------------*/
  83. virtual Boolean
  84.   deltaReached(ICnrQueryDeltaEvent& event),
  85.   treeCollapsed(IContainerObject* collapsedObject, IContainerControl* container),
  86.   treeExpanded(IContainerObject* expandedObject, IContainerControl* container),
  87.   enter(ICnrEnterEvent& event),
  88.   selectedChanged(ICnrEmphasisEvent& event),
  89.   inuseChanged(ICnrEmphasisEvent& event),
  90.   cursoredChanged(ICnrEmphasisEvent& event),
  91.   windowScrolled(ICnrScrollEvent& event),
  92.   help(ICnrHelpEvent& event);
  93.  
  94. /*---------------------------- Window Attachment -------------------------------
  95. | These functions permit attaching and detaching the handler object to and from|
  96. | a container window:                                                          |
  97. |   handleEventsFor       - Attaches the handler to the container control      |
  98. |                           passed in the argument.                            |
  99. |   stopHandlingEventsFor - Detaches the handler from the container control    |
  100. |                           passed in the argument.                            |
  101. ------------------------------------------------------------------------------*/
  102. virtual ICnrHandler
  103.  &handleEventsFor       ( IContainerControl* container ),
  104.  &stopHandlingEventsFor ( IContainerControl* container );
  105.  
  106. protected:
  107. /*----------------------------- Implementation ---------------------------------
  108. | This function is used to implement the class:                                |
  109. |   dispatchHandlerEvent - Routes the edit events to the appropriate event     |
  110. |                          functions.                                          |
  111. ------------------------------------------------------------------------------*/
  112. virtual Boolean
  113.   dispatchHandlerEvent(IEvent& event);
  114.  
  115. private:
  116. /* Hidden functions */
  117. virtual IHandler
  118.  &handleEventsFor       ( IWindow* window  ),
  119.  &stopHandlingEventsFor ( IWindow* window  );
  120.  
  121. };
  122.  
  123. /*----------------------------------------------------------------------------*/
  124. /* Resume compiler default packing.                                           */
  125. /*----------------------------------------------------------------------------*/
  126. #pragma pack()
  127.  
  128. #endif
  129.