home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / uicldd.zip / IDMCNREV.HPP < prev    next >
Text File  |  1993-09-03  |  12KB  |  281 lines

  1. #ifndef _IDMCNREV_
  2.   #define _IDMCNREV_
  3. /*******************************************************************************
  4. * FILE NAME: idmcnrev.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the definition of the following container direct        *
  8. *   manipulation event classes:                                                *
  9. *                                                                              *
  10. *   Declaration of the classes:                                                *
  11. *     IDMCnrInitEvent       - Container drag-init event.                       *
  12. *     IDMCnrOverAfterEvent  - Container drag-over and drag-after events.       *
  13. *     IDMCnrDropEvent       - Container drop-on event.                         *
  14. *                                                                              *
  15. *                                                                              *
  16. * COPYRIGHT:                                                                   *
  17. *   Licensed Materials - Property of IBM                                       *
  18. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  19. *   All Rights Reserved                                                        *
  20. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  21. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  22. *                                                                              *
  23. * $Log:   M:/ibmclass/idrag/vcs/idmcnrev.hpv  $                         *
  24. //
  25. //   Rev 1.1   03 Sep 1993 20:08:20   banzai
  26. //Container related changes
  27. //
  28. //   Rev 1.0   02 Sep 1993 20:29:58   banzai
  29. //Initial Drop
  30. //
  31. //   Rev 1.0   03 Aug 1993 20:21:50   banzai
  32. //First pass at CNR DM events
  33. //
  34. *******************************************************************************/
  35. #ifndef _ICTLEVT_
  36.   #include <ictlevt.hpp>
  37. #endif
  38.  
  39. #ifndef _ICNRCTL_
  40.   #include <icnrctl.hpp>
  41. #endif
  42.  
  43. #ifndef _ICNROBJ_
  44.   #include <icnrobj.hpp>
  45. #endif
  46.  
  47. #ifndef _IDMEVENT_
  48.   #include <idmevent.hpp>
  49. #endif
  50.  
  51.  
  52. /* Forward Declarations */
  53. struct _CNRDRAGINIT;
  54. struct _CNRDRAGINFO;
  55. struct _DRAGINFO;
  56. class IDMCnrItemHandle;
  57.  
  58.  
  59. class IDMCnrInitEvent : public IDMSourceBeginEvent {
  60. typedef IDMSourceBeginEvent
  61.   Inherited;
  62. /*******************************************************************************
  63. * Objects of this class represent the event that occurs upon initiation        *
  64. * of a direct manipulation event within a source container.                         *
  65. *                                                                              *
  66. * EXAMPLE:                                                                     *
  67. *                                                                              *
  68. *   Provide example here!                                                      *
  69. *                                                                              *
  70. *******************************************************************************/
  71. public:
  72.  
  73. /*-----------------------------------------------------------------------------+
  74. | Objects of this class are constructed from generic IControlEvent objects.    |
  75. ------------------------------------------------------------------------------*/
  76.   IDMCnrInitEvent     ( const IControlEvent &controlEvent );
  77.  
  78. virtual
  79.   ~IDMCnrInitEvent    ( );
  80.  
  81.  
  82. /*--------------------------------- Accessors ---------------------------------+
  83. | These methods provide a means of getting and setting the accessible          |
  84. | attributes of instances of this class:                                       |
  85. |   containerId   - Returns the source container's ID.                         |
  86. |   object        - Returns a pointer to the object over which the drag        |
  87. |                   started.  Returns 0 if drag started over container         |
  88. |                   "white space".                                             |
  89. |   container     - Returns a pointer to the source container for which the    |
  90. |                   event occurred.                                            |
  91. |   pointerOffset - Returns the position of the pointing device relative to    |
  92. |                   the source container object's origin.                      |
  93. +-----------------------------------------------------------------------------*/
  94. unsigned short
  95.   containerId      ( ) const;
  96.  
  97. IContainerObject
  98.  *object           ( ) const;
  99.  
  100. IContainerControl
  101.  *container        ( ) const;
  102.  
  103. ISize
  104.   pointerOffset    ( ) const;
  105.  
  106. /*---------------------------------- Overrides --------------------------------+
  107. | This class overrides the following inherited methods:                        |
  108. |   position - Returns the pointing device position (only if source is         |
  109. |              pointingDevice).                                                |
  110. +-----------------------------------------------------------------------------*/
  111. virtual IPoint
  112.   position    ( ) const;
  113.  
  114. protected:
  115. private: /*------------------------ PRIVATE ----------------------------------*/
  116.  
  117. IPoint
  118.   pos;
  119.  
  120. ISize
  121.   offset;
  122.  
  123. unsigned short
  124.   usCnrId;
  125.  
  126. IContainerControl
  127.  *pCnrCtl;
  128.  
  129. _CNRDRAGINIT
  130.  *pCnrDragInit;
  131.  
  132. }; // IDMCnrInitEvent
  133.  
  134.  
  135. class IDMCnrOverAfterEvent : public IDMTargetEnterEvent {
  136. typedef IDMTargetEnterEvent
  137.   Inherited;
  138. /*******************************************************************************
  139. * Objects of this class implement the target container's drag-over and         *
  140. * drag-after events.                                                           *
  141. *                                                                              *
  142. * EXAMPLE:                                                                     *
  143. *                                                                              *
  144. *   Provide example here!                                                      *
  145. *                                                                              *
  146. *******************************************************************************/
  147. public:
  148.  
  149. /*-----------------------------------------------------------------------------+
  150. | Objects of this class are constructed from generic IControlEvent objects.    |
  151. ------------------------------------------------------------------------------*/
  152.   IDMCnrOverAfterEvent     ( const IControlEvent &controlEvent );
  153.  
  154. virtual
  155.   ~IDMCnrOverAfterEvent    ( );
  156.  
  157.  
  158. /*--------------------------------- Accessors ---------------------------------+
  159. | These methods provide a means of getting and setting the accessible          |
  160. | attributes of instances of this class:                                       |
  161. |   isDragAfter   - Queries whether the event is a drag-after or drag-over     |
  162. |                   event.                                                     |
  163. |   isAboveFirst  - Queries whether drag-after has occurred above the first    |
  164. |                   object in the list.                                        |
  165. |   containerId   - Returns the target container's ID.                         |
  166. |   object        - Returns a pointer to the object over which the drag-after  |
  167. |                   or drag-over event occurred.  Returns 0 if drag was        |
  168. |                   over container "white space".                              |
  169. |   container     - Returns a pointer to the container where the drag-after    |
  170. |                   or drag-over event occurred.                               |
  171. +-----------------------------------------------------------------------------*/
  172. Boolean
  173.   isDragAfter     ( ) const,
  174.   isAboveFirst    ( ) const;
  175.  
  176. unsigned short
  177.   containerId     ( ) const;
  178.  
  179. IContainerObject
  180.  *object          ( ) const;
  181.  
  182. IContainerControl
  183.  *container       ( ) const;
  184.  
  185. /*---------------------------------- Overrides --------------------------------+
  186. | This class overrides the following inherited methods:                        |
  187. |   position - Returns the pointing device position (only if source is         |
  188. |              pointingDevice).                                                |
  189. +-----------------------------------------------------------------------------*/
  190. virtual IPoint
  191.   position    ( ) const;
  192.  
  193. protected:
  194. private: /*------------------------ PRIVATE ----------------------------------*/
  195.  
  196. Boolean
  197.   bDragAfter;
  198.  
  199. unsigned short
  200.   usCnrId;
  201.  
  202. IContainerControl
  203.  *pCnrCtl;
  204.  
  205. _CNRDRAGINFO
  206.  *pCnrDragInfo;
  207.  
  208. }; // IDMCnrOverAfterEvent
  209.  
  210.  
  211.  
  212. class IDMCnrDropEvent : public IDMTargetDropEvent {
  213. typedef IDMTargetDropEvent
  214.   Inherited;
  215. /*******************************************************************************
  216. * Objects of this class implement the target container's drag-on event.        *
  217. *                                                                              *
  218. * EXAMPLE:                                                                     *
  219. *                                                                              *
  220. *   Provide example here!                                                      *
  221. *                                                                              *
  222. *******************************************************************************/
  223. public:
  224.  
  225. /*-----------------------------------------------------------------------------+
  226. | Objects of this class are constructed from generic IControlEvent objects.    |
  227. ------------------------------------------------------------------------------*/
  228.   IDMCnrDropEvent     ( const IControlEvent &controlEvent );
  229.  
  230. virtual
  231.   ~IDMCnrDropEvent    ( );
  232.  
  233.  
  234. /*--------------------------------- Accessors ---------------------------------+
  235. | These methods provide a means of getting and setting the accessible          |
  236. | attributes of instances of this class:                                       |
  237. |   containerId  - Returns the target container's ID.                          |
  238. |   object       - Returns a pointer to the object over which the drop-on      |
  239. |                  event occurred.  Returns 0 if drop was on container         |
  240. |                  "white space".                                              |
  241. |   container    - Returns a pointer to the container where the drop-on        |
  242. |                  event occurred.                                             |
  243. |   position     - Returns a drag item's position relative to the target       |
  244. |                  container.  If the item pointer is 0, the drop point        |
  245. |                  relative to the container is returned.                      |
  246. +-----------------------------------------------------------------------------*/
  247. unsigned short
  248.   containerId     ( ) const;
  249.  
  250. IContainerObject
  251.  *object          ( ) const;
  252.  
  253. IContainerControl
  254.  *container       ( ) const;
  255.  
  256. virtual IPoint
  257.   position        ( const IDMCnrItemHandle &item ) const;
  258.  
  259.  
  260. protected:
  261. private: /*------------------------ PRIVATE ----------------------------------*/
  262.  
  263. unsigned short
  264.   usCnrId;
  265.  
  266. IContainerControl
  267.  *pCnrCtl;
  268.  
  269. _CNRDRAGINFO
  270.  *pCnrDragInfo;
  271.  
  272. }; // IDMCnrDropEvent
  273.  
  274.  
  275. /*--------------------------------- INLINES ----------------------------------*/
  276. #ifndef I_NO_INLINES
  277.   #include <idmcnrev.inl>
  278. #endif
  279.  
  280. #endif // _IDMCNREV_
  281.