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

  1. #ifndef _ICNREVT_
  2.    #define _ICNREVT_
  3. /*******************************************************************************
  4. * FILE NAME: icnrevt.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     ICnrEvent                                                                *
  9. *     ICnrEnterEvent                                                           *
  10. *     ICnrEmphasisEvent
  11. *     ICnrHelpEvent                                                            *
  12. *     ICnrQueryDeltaEvent                                                      *
  13. *     ICnrScrollEvent                                                          *
  14. *     ICnrPaintBackground                                                      *
  15. *                                                                              *
  16. * COPYRIGHT:                                                                   *
  17. *   (C) Copyright IBM Corporation 1992                                         *
  18. *   All Rights Reserved                                                        *
  19. *   Licensed Materials * Property of IBM                                       *
  20. *                                                                              *
  21. * HISTORY:                                                                     *
  22. *******************************************************************************/
  23.  
  24.  
  25.  
  26. #ifndef  _ICTLEVT_
  27.    #include <ictlevt.hpp>
  28. #endif
  29.  
  30. #ifndef _ICNROBJ_
  31.    #include <icnrobj.hpp>
  32. #endif
  33.  
  34. /*----------------------------------------------------------------------------*/
  35. /* Align classes on four byte boundary.                                       */
  36. /*----------------------------------------------------------------------------*/
  37. #pragma pack(4)
  38.  
  39. //    Forward Declarations
  40. class ICnrEnterEvent;
  41. class ICnrEvent;
  42. class ICnrHelpEvent;
  43. class ICnrQueryDeltaEvent;
  44. class IContainerObject;
  45. class IContainerControl;
  46. class IContainerColumn;
  47.  
  48.  
  49.  
  50. class ICnrEvent : public IControlEvent
  51. {
  52. typedef IControlEvent Inherited;
  53. /*******************************************************************************
  54. * The ICnrEvent class forms the base of the container event classes.           *
  55. *******************************************************************************/
  56. public:
  57. /*------------------------ Constructors ----------------------------------------
  58. | The only way to construct an instance of this class is from the              |
  59. | IControlEvent class.                                                         |
  60. ------------------------------------------------------------------------------*/
  61.   ICnrEvent      ( IControlEvent& evt);
  62.  ~ICnrEvent      ( );
  63.  
  64.    protected:
  65. /*----------------------------- Implementation ---------------------------------
  66. | This function is used to implement the class:                                |
  67. |   containerId   - Returns the control identifier for the container.          |
  68. ------------------------------------------------------------------------------*/
  69. unsigned long
  70.   containerId    ( ) const;
  71.  
  72. };
  73.  
  74.  
  75. class ICnrEnterEvent : public ICnrEvent
  76. {
  77. typedef ICnrEvent Inherited;
  78. /*******************************************************************************
  79. * The ICnrEnterEvent class is dispatched when an Enter operation occurs in the *
  80. * container. This can be as a result of:                                       *
  81. *        - The Enter key, or                                                   *
  82. *        - A double click of the mouse select button.                          *
  83. *******************************************************************************/
  84. public:
  85. /*------------------------ Constructors ----------------------------------------
  86. | The only way to construct an instance of this class is by                    |
  87. | ICnrHandler::dispatchHandlerEvent from an IControlEvent in response to an    |
  88. | Enter notification from the container.                                       |
  89. ------------------------------------------------------------------------------*/
  90.   ICnrEnterEvent  ( IControlEvent& evt);
  91.  ~ICnrEnterEvent ();
  92.  
  93. /*-------------------------------- Accessors -----------------------------------
  94. | These functions provide a means of getting and setting the accessible        |
  95. | attributes of instances of this class:                                       |
  96. |   object       - Returns the object over which the Enter occurred. If the    |
  97. |                  Enter occurred on the container white space, 0 is returned. |
  98. |   enterPressed - Returns true if the event was the result of the keyboard    |
  99. |                  Enter key. Otherwise the event occurred because the select  |
  100. |                  button was double clicked.                                  |
  101. |   validObject  - Returns true if the event occurred over an object.          |
  102. ------------------------------------------------------------------------------*/
  103. IContainerObject
  104.  *object          ( );
  105. Boolean
  106.   enterPressed    ( ) const,
  107.   validObject     ( ) const;
  108.  
  109.  
  110. };
  111.  
  112. class ICnrEmphasisEvent : public ICnrEvent
  113. {
  114. typedef ICnrEvent Inherited;
  115. /*******************************************************************************
  116. * The ICnrEmphasisEvent class is dispatched whenever a container record's      *
  117. * attributes change.  Emphasis is a visable indication of the condition of an  *
  118. * object that can affect the ability of a user to interact with that object.   *
  119. *******************************************************************************/
  120. public:
  121. /*------------------------ Constructors ----------------------------------------
  122. | Instances of this class are typically constructed by the                     |
  123. | ICnrHandler::dispatchHandlerEvent function from an IControlEvent in          |
  124. | response to a change in emphasis notification from a container.              |
  125. ------------------------------------------------------------------------------*/
  126.   ICnrEmphasisEvent  ( IControlEvent& evt);
  127.  ~ICnrEmphasisEvent  ( );
  128.  
  129. /*-------------------------------- Accessors -----------------------------------
  130. | These functions provide a means of getting and setting the accessible        |
  131. | attributes of instances of this class:                                       |
  132. |   object       - Returns the object that has changed its emphasis.           |
  133. |   changed      - Returns true if the passed emphasis value has changed.      |
  134. ------------------------------------------------------------------------------*/
  135. Boolean
  136.   changed          ( IContainerObject::Emphasis) const;
  137. IContainerObject
  138.  *object           ( );
  139. };
  140.  
  141. class ICnrQueryDeltaEvent : public ICnrEvent
  142. {
  143. typedef ICnrEvent Inherited;
  144. /*******************************************************************************
  145. * An instance of the ICnrQueryDeltaEvent class is dispatched when the delta    *
  146. * value is reached in the container.                                           *
  147. *******************************************************************************/
  148. public:
  149. /*------------------------ Constructors ----------------------------------------
  150. | The only way to construct an instance of this class is by                    |
  151. | ICnrHandler::dispatchHandlerEvent from an IControlEvent in response to a     |
  152. | notification from the container that the pre-set delta value has been        |
  153. | reached.                                                                     |
  154. ------------------------------------------------------------------------------*/
  155.   ICnrQueryDeltaEvent ( IControlEvent& evt);
  156.  ~ICnrQueryDeltaEvent ( );
  157.  
  158. /*-------------------------------- Accessors -----------------------------------
  159. | These functions provide a means of getting and setting the accessible        |
  160. | attributes of instances of this class:                                       |
  161. |   atTopDelta    - Returns true if the object that represents the delta       |
  162. |                   value scrolls into view at the top of the client area.     |
  163. |   atBottomDelta - Returns true if the object that represents the delta       |
  164. |                   value scrolls into view at the bottom of the client area.  |
  165. |   atFirstObject - Returns true if the container has scrolled to the first    |
  166. |                   object in the container.                                   |
  167. |   atLastObject  - Returns true if the container has scrolled to the last     |
  168. |                   object in the container.                                   |
  169. ------------------------------------------------------------------------------*/
  170. Boolean
  171.   atTopDelta       ( ) const,
  172.   atBottomDelta    ( ) const,
  173.   atFirstObject    ( ) const,
  174.   atLastObject     ( ) const;
  175. };
  176.  
  177. class ICnrScrollEvent : public ICnrEvent
  178. {
  179. typedef ICnrEvent Inherited;
  180. /*******************************************************************************
  181. * The ICnrScrollEvent class is dispatched when scrolling is requested in the   *
  182. * container.                                                                   *
  183. *******************************************************************************/
  184. public:
  185.  
  186. /*------------------------ Constructors ----------------------------------------
  187. | The only way to construct an instance of this class is by                    |
  188. | ICnrHandler::dispatchHandlerEvent from an IControlEvent in response to a     |
  189. | notification from the container that one of the container's windows has      |
  190. | been scrolled.                                                               |
  191. ------------------------------------------------------------------------------*/
  192.   ICnrScrollEvent ( IControlEvent& chpevt);
  193.  ~ICnrScrollEvent ( );
  194.  
  195. /*-------------------------------- Accessors -----------------------------------
  196. | These functions provide a means of getting and setting the accessible        |
  197. | attributes of instances of this class:                                       |
  198. |   amount         - Returns the amount the window has scrolled, in pixels.    |
  199. |   isLeftDetails  - Returns true if the scrolling occurred in the left (or    |
  200. |                    only) side of the details view.                           |
  201. |   isRightDetails - Returns true if the scrolling occurred in the right side  |
  202. |                    of a split details view.                                  |
  203. |   isHorizontal   - Returns true if scrolling in the horizontal direction.    |
  204. |   isVertical     - Returns true if scrolling in the vertical direction.      |
  205. ------------------------------------------------------------------------------*/
  206. long
  207.   amount            ( ) const;
  208. Boolean
  209.   isLeftDetails     ( ) const,
  210.   isRightDetails    ( ) const,
  211.   isHorizontal      ( ) const,
  212.   isVertical        ( ) const;
  213. };
  214.  
  215.  
  216. class ICnrHelpEvent : public ICnrEvent
  217. {
  218. typedef ICnrEvent Inherited;
  219. /*******************************************************************************
  220. * The ICnrHelpEvent class is dispatched when help is requested in the          *
  221. * container.                                                                   *
  222. *******************************************************************************/
  223. public:
  224.  
  225. /*------------------------ Constructors ----------------------------------------
  226. | Instances of this class are typically constructed by the function            |
  227. | ICnrHandler::dispatchHandlerEvent from an IControlEvent in response to a     |
  228. | notification by the container that the user has requested help.              |
  229. ------------------------------------------------------------------------------*/
  230.   ICnrHelpEvent ( IControlEvent& chpevt);
  231.  ~ICnrHelpEvent ( );
  232.  
  233. /*-------------------------------- Accessors -----------------------------------
  234. | This function provides a means of getting and setting the accessible         |
  235. | attributes of instances of this class:                                       |
  236. |   object       - Returns the object over which help is requested.            |
  237. |   column       - Returns the column that was being edited if help was        |
  238. |                  requested within a multiple-line entry field; otherwise,    |
  239. |                  0 is returned.                                              |
  240. ------------------------------------------------------------------------------*/
  241. IContainerObject
  242.  *object       ( ) ;
  243. IContainerColumn
  244.  *column       ( ) ;
  245.  
  246. };
  247.  
  248. /*----------------------------------------------------------------------------*/
  249. /* Resume compiler default packing.                                           */
  250. /*----------------------------------------------------------------------------*/
  251. #pragma pack()
  252.  
  253. #endif /* _ICNREVT_ */
  254.