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

  1. #ifndef _IHELPHDR_
  2. #define _IHELPHDR_
  3. /*******************************************************************************
  4. * FILE NAME: ihelphdr.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IHelpHandler - This class deals with help events                         *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   Licensed Materials - Property of IBM                                       *
  12. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  13. *   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. #ifndef _IHANDLER_
  19.   #include <ihandler.hpp>
  20. #endif
  21.  
  22. #ifndef _IHELPEVT_
  23.   #include <ihelpevt.hpp>
  24. #endif
  25.  
  26. #ifndef _IFRAME_
  27.   #include <iframe.hpp>
  28. #endif
  29.  
  30. /*----------------------------------------------------------------------------*/
  31. /* Align classes on four byte boundary.                                       */
  32. /*----------------------------------------------------------------------------*/
  33. #pragma pack(4)
  34.  
  35. // Forward declarations for other classes:
  36. class IHelpHandler;
  37. class ICommandEvent;
  38. class IFrameWindow;
  39.  
  40.  
  41. class IHelpHandler : public IHandler {
  42. /*******************************************************************************
  43. * The IHelpHandler class deals with help window events.                        *
  44. *******************************************************************************/
  45. typedef IHandler Inherited;
  46. public:
  47.  
  48. /*---------------------------- Destructor ------------------------------------*/
  49.  ~IHelpHandler ();
  50.  
  51.  
  52. /*---------------------------- Event Handling ----------------------------------
  53. | These functions provide means of handling help events                        |
  54. |                                                                              |
  55. |   hypertextSelect - Called when the user selects a hypertext field.  The     |
  56. |                     default action does nothing.                             |
  57. |   subitemNotFound - Called when the user requests help on a field that IPF   |
  58. |                     cannot find in the help subtable.  The default action    |
  59. |                     sets the event result to 0, indicating to IPF to do      |
  60. |                     nothing.                                                 |
  61. |   menuBarCommand  - Called when the user has selected a customized menu bar  |
  62. |                     item.  The default action does nothing.                  |
  63. |   handleError     - Called when an error is caused by a user interaction.    |
  64. |                     The default action displays a message box that           |
  65. |                     indicates the ErrorType of the IHelpErrorEvent.          |
  66. |   helpUndefined   - Called when the user requests general help and it is     |
  67. |                     not defined.  The default action does nothing.  The      |
  68. |                     application can override this and either:                |
  69. |                       - Display its own window, or                           |
  70. |                       - Use IHelpWindow::show to display a particular        |
  71. |                         window.                                              |
  72. |   showTutorial    - Called when the user selects the Tutorial choice from    |
  73. |                     a help window.  The default action does nothing.         |
  74. |   keysHelpId      - Called when the user selects the Keys Help choice from   |
  75. |                     a help window.  The default action sets the event        |
  76. |                     result to 0, indicating to IPF to do nothing.  The       |
  77. |                     application can override the default action and set the  |
  78. |                     result to the ID of the help window it wants IPF to      |
  79. |                     display.                                                 |
  80. |   showContents    - Called when the table of contents window is displayed.   |
  81. |                     The default action sets the event result to false and    |
  82. |                     allows IPF to process the event.                         |
  83. |   showCoverPage   - Called when the cover page is displayed.  The default    |
  84. |                     action sets the event result to false and allows IPF to  |
  85. |                     process the event.                                       |
  86. |   showPage        - Called when a child window of the cover page is opened.  |
  87. |                     The default action sets the event result to false and    |
  88. |                     allows IPF to process the event.                         |
  89. |   swapPage        - Called when a child window of the cover page is          |
  90. |                     swapped.  The default action sets the event result to    |
  91. |                     false and allows IPF to process the event.               |
  92. |   showIndex       - Called when the index window is displayed.  The default  |
  93. |                     action sets the event result to false and allows IPF to  |
  94. |                     process the event.                                       |
  95. |   showHistory     - Called when the history window is displayed.  The        |
  96. |                     default action sets the event result to false and        |
  97. |                     allows IPF to process the event.                         |
  98. |   showSearchLis   - Called when the search list is displayed.  The default   |
  99. |                     action sets the event result to false and allows IPF to  |
  100. |                     process the event.                                       |
  101. |   openLibrary     - Called when a new library is opened.  The default        |
  102. |                     action sets the event result to false and allows IPF to  |
  103. |                     process the event.                                       |
  104. |   controlSelect   - Called when a control was selected.  The default action  |
  105. |                     sets the event result to false and allows IPF to         |
  106. |                     process the event.                                       |
  107. ------------------------------------------------------------------------------*/
  108. virtual Boolean
  109.   hypertextSelect  (IHelpHypertextEvent&        hypertextEvent),
  110.   subitemNotFound  (IHelpSubitemNotFoundEvent&  event),
  111.   menuBarCommand   (IHelpMenuBarEvent&          menuBarEvent),
  112.   handleError      (IHelpErrorEvent&            errorEvent),
  113.   helpUndefined    (IEvent&                     event),
  114.   showTutorial     (IHelpTutorialEvent&         tutorialEvent),
  115.   keysHelpId       (IEvent&                     event),
  116.   showContents     (IHelpNotifyEvent&           notifyEvent),
  117.   showCoverPage    (IHelpNotifyEvent&           notifyEvent),
  118.   showPage         (IHelpNotifyEvent&           notifyEvent),
  119.   swapPage         (IHelpNotifyEvent&           notifyEvent),
  120.   showIndex        (IHelpNotifyEvent&           notifyEvent),
  121.   showHistory      (IHelpNotifyEvent&           notifyEvent),
  122.   showSearchList   (IHelpNotifyEvent&           notifyEvent),
  123.   openLibrary      (IHelpNotifyEvent&           notifyEvent),
  124.   controlSelect    (IHelpNotifyEvent&           notifyEvent);
  125.  
  126. /*---------------------------- Window Attachment -------------------------------
  127. | These functions permit attaching and detaching the handler object to and from|
  128. | a help application window.                                                   |
  129. |   handleEventsFor       - Attaches the handler to the application window.    |
  130. |   stopHandlingEventsFor - Detaches the handler from the application window.  |
  131. ------------------------------------------------------------------------------*/
  132. virtual IHelpHandler
  133.  &handleEventsFor       ( IFrameWindow* applicationWindow ),
  134.  &stopHandlingEventsFor ( IFrameWindow* applicationWindow );
  135.  
  136.  
  137. protected:
  138. /*-------------------------------- Overrides -----------------------------------
  139. | This class overrides the following inherited function:                       |
  140. |   dispatchHandlerEvent -  Processes help error messages and dispatches       |
  141. |                           help event handling functions.                     |
  142. ------------------------------------------------------------------------------*/
  143. virtual Boolean
  144.   dispatchHandlerEvent(IEvent& evt);
  145.  
  146. private:
  147. /* Hidden functions */
  148. virtual IHandler
  149.  &handleEventsFor       ( IWindow* window  ),
  150.  &stopHandlingEventsFor ( IWindow* window  );
  151. };
  152.  
  153. /*----------------------------------------------------------------------------*/
  154. /* Resume compiler default packing.                                           */
  155. /*----------------------------------------------------------------------------*/
  156. #pragma pack()
  157.  
  158. #endif /* IHELPHDR */
  159.