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

  1. #ifndef _IHELPEVT_
  2. #define _IHELPEVT_
  3. /*******************************************************************************
  4. * FILE NAME: ihelpevt.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the declaration(s) of the class(es):                    *
  8. *     IHelpMenuBarEvent                                                        *
  9. *     IHelpErrorEvent                                                          *
  10. *     IHelpHypertextEvent                                                      *
  11. *     IHelpSubitemNotFoundEvent                                                *
  12. *     IHelpTutorialEvent                                                       *
  13. *     IHelpNotifyEvent                                                         *
  14. *                                                                              *
  15. * COPYRIGHT:                                                                   *
  16. *   Licensed Materials - Property of IBM                                       *
  17. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  18. *   All Rights Reserved                                                        *
  19. *   US Government Users Restricted Rights - Use, duplication, or               *
  20. *   disclosure                                                                 *
  21. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  22. *                                                                              *
  23. *******************************************************************************/
  24. #ifndef _IEVENT_
  25.   #include <ievent.hpp>
  26. #endif
  27.  
  28. /*----------------------------------------------------------------------------*/
  29. /* Align classes on four byte boundary.                                       */
  30. /*----------------------------------------------------------------------------*/
  31. #pragma pack(4)
  32.  
  33. // Forward declarations for other classes:
  34. class IEvent;
  35.  
  36.  
  37. class IHelpMenuBarEvent : public IEvent
  38. {
  39. typedef IEvent Inherited;
  40. /*******************************************************************************
  41. * The IHelpMenuBarEvent class is dispatched when the user has selected a       *
  42. * tailored menu bar item.                                                      *
  43. *******************************************************************************/
  44. public:
  45. /*------------------------ Constructor -----------------------------------------
  46. | The only way to construct an instance of this class is from an IEvent class. |
  47. ------------------------------------------------------------------------------*/
  48.   IHelpMenuBarEvent (IEvent& event);
  49.  ~IHelpMenuBarEvent ();
  50.  
  51. /*-------------------------------- Accessors -----------------------------------
  52. | This function provides a means of getting and setting the accessible         |
  53. | attributes of instances of this class:                                       |
  54. |                                                                              |
  55. |   commandId - Returns the ID of the menu bar item selected.                  |
  56. ------------------------------------------------------------------------------*/
  57. unsigned long
  58.   commandId()  const;
  59. };
  60.  
  61.  
  62. class IHelpErrorEvent : public IEvent
  63. {
  64. typedef IEvent Inherited;
  65. /*******************************************************************************
  66. * The IHelpErrorEvent class is dispatched when a help error is caused by user  *
  67. * interaction.                                                                 *
  68. *******************************************************************************/
  69. public:
  70. /*------------------------ Constructor -----------------------------------------
  71. | The only way to construct an instance of this class is from an IEvent class. |
  72. ------------------------------------------------------------------------------*/
  73.   IHelpErrorEvent (IEvent& event);
  74.  ~IHelpErrorEvent ();
  75.  
  76. enum ErrorType
  77.   { loadingDLL, noWindow, invalidAppHandle, invalidInstanceHandle,
  78.     noHelpInstance, invalidQueryHandle, noHelpTable,
  79.     invalidId, noIndex, noContent, openHelpFile,
  80.     readHelpFile, closeHelpFile, invalidHelpFile, notEnoughMemory,
  81.     unableFreeMemory, invalidHelpWindow, unopenDatabase, unknown };
  82.  
  83. /*-------------------------------- Accessor ------------------------------------
  84. | This function provides a means of getting and setting the accessible         |
  85. | attributes of instances of this class:                                       |
  86. |                                                                              |
  87. |   error - Returns the ErrorType caused by user interaction.                  |
  88. ------------------------------------------------------------------------------*/
  89. IHelpErrorEvent::ErrorType
  90.   error() const;
  91. };
  92.  
  93.  
  94. class IHelpHypertextEvent : public IEvent
  95. {
  96. typedef IEvent Inherited;
  97. /*******************************************************************************
  98. * The IHelpHypertextEvent class is dispatched when the user selects a          *
  99. * hypertext field that was specified with the reftype=inform attribute of the  *
  100. * IPF :link tag.                                                               *
  101. *******************************************************************************/
  102. public:
  103. /*------------------------ Constructor -----------------------------------------
  104. | The only way to construct an instance of this class is from an IEvent class. |                                                       |
  105. ------------------------------------------------------------------------------*/
  106.   IHelpHypertextEvent (IEvent& event);
  107.  ~IHelpHypertextEvent ();
  108.  
  109. /*-------------------------------- Accessor ------------------------------------
  110. | This function provides a means of getting and setting the accessible         |
  111. | attributes of instances of this class:                                       |
  112. |                                                                              |
  113. |   id - Returns the ID of the hypertext field.                                |
  114. ------------------------------------------------------------------------------*/
  115. unsigned long
  116.   id()  const;
  117. };
  118.  
  119.  
  120. class IHelpSubitemNotFoundEvent : public IEvent
  121. {
  122. typedef IEvent Inherited;
  123. /*******************************************************************************
  124. * The IHelpSubitemNotFoundEvent class is dispatched when the user has          *
  125. * requested help on a field for which IPF cannot find a related entry in the   *
  126. * help subtable.                                                               *
  127. *******************************************************************************/
  128. public:
  129. /*------------------------ Constructor -----------------------------------------
  130. | The only way to construct an instance of this class is from an IEvent class. |
  131. ------------------------------------------------------------------------------*/
  132.   IHelpSubitemNotFoundEvent (IEvent& event);
  133.  ~IHelpSubitemNotFoundEvent ();
  134.  
  135. /*-------------------------------- Accessors -----------------------------------
  136. | These functions provide means of getting and setting the accessible          |
  137. | attributes of instances of this class:                                       |
  138. |                                                                              |
  139. |    isWindow   - Queries whether help was requested on an application window. |
  140. |    isFrame    - Queries whether help was requested on a frame window.        |
  141. |    isMenu     - Queries whether help was requested on a menu window.         |
  142. |    topicId    - Returns the ID of the window or menu that contains the       |
  143. |                 field upon which help was requested.                         |
  144. |    subtopicId - If help was requested on an application window, the control  |
  145. |                 ID of the cursored field is returned.  If help was           |
  146. |                 requested from a menu window, the menu ID of the currently   |
  147. |                 selected submenu item is returned.                           |
  148. ------------------------------------------------------------------------------*/
  149. Boolean
  150.   isWindow            ( )  const,
  151.   isFrame             ( )  const,
  152.   isMenu              ( )  const;
  153.  
  154. unsigned long
  155.   topicId             ( )  const,
  156.   subtopicId          ( )  const;
  157. };
  158.  
  159.  
  160. class IHelpTutorialEvent : public IEvent
  161. {
  162. typedef IEvent Inherited;
  163. /*******************************************************************************
  164. * The IHelpTutorialEvent class is dispatched when the user selects the         *
  165. * Tutorial choice from the Help menu.                                          *
  166. *******************************************************************************/
  167. public:
  168. /*------------------------ Constructor -----------------------------------------
  169. | The only way to construct an instance of this class is from an IEvent class. |
  170. ------------------------------------------------------------------------------*/
  171.   IHelpTutorialEvent  ( IEvent& event);
  172.  ~IHelpTutorialEvent  ( );
  173.  
  174. /*-------------------------------- Accessor ------------------------------------
  175. | This function provides a means of getting and setting the accessible         |
  176. | attributes of instances of this class:                                       |
  177. |                                                                              |
  178. |    tutorialName - Returns the default tutorial program name specified upon   |
  179. |                   creating the IHelpWindow.                                  |
  180. ------------------------------------------------------------------------------*/
  181. IString
  182.   tutorialName        ( )  const;
  183. };
  184.  
  185.  
  186. class IHelpNotifyEvent : public IEvent {
  187. typedef IEvent Inherited;
  188. /*******************************************************************************
  189. * The IHelpNotifyEvent class is dispatched when the user initiates an event    *
  190. * that the owner might be interested in controlling.                           *
  191. *******************************************************************************/
  192. public:
  193. /*------------------------ Constructor -----------------------------------------
  194. | The only way to construct an instance of this class is from an IEvent class. |
  195. ------------------------------------------------------------------------------*/
  196.   IHelpNotifyEvent  ( IEvent& event);
  197.  ~IHelpNotifyEvent  ( );
  198.  
  199. /*-------------------------------- Accessors -----------------------------------
  200. | These functions provide means of getting and setting the accessible          |
  201. | attributes of instances of this class:                                       |
  202. |                                                                              |
  203. |    windowHandle - Returns the relevant window handle associated with this    |
  204. |                   specific IHelpNotifyEvent.                                 |
  205. |    controlId    - Returns the resource ID of the control that was selected.  |
  206. ------------------------------------------------------------------------------*/
  207. IWindowHandle
  208.   windowHandle      ( )  const;
  209. unsigned short
  210.   controlId         ( )  const;
  211. };
  212.  
  213. /*----------------------------------------------------------------------------*/
  214. /* Resume compiler default packing.                                           */
  215. /*----------------------------------------------------------------------------*/
  216. #pragma pack()
  217.  
  218. #endif // _IHELPEVT_
  219.