home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cluidm.zip / idmtgth.hpp < prev    next >
Text File  |  1993-05-05  |  7KB  |  155 lines

  1. #ifndef _IDMTGTH_
  2. #define _IDMTGTH_
  3. /*******************************************************************************
  4. * FILE NAME: idmtgth.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IDMTargetHandler - Drag/Drop target window handler.                      *
  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. * $Log:   M:/ibmclass/idrag/vcs/idmtgth.hpv  $
  18. //
  19. //   Rev 1.3   05 May 1993 16:37:44   unknown
  20. //DM_DROP changes
  21. //
  22. //   Rev 1.2   03 May 1993 16:06:06   unknown
  23. //Latest changes per IC_UM_DRAGOVER
  24. //
  25. //   Rev 1.1   30 Apr 1993 11:45:46   HAGGAR
  26. //
  27. //   Rev 1.0   22 Apr 1993 10:41:16   HAGGAR
  28. //Initial revision.
  29. *******************************************************************************/
  30. #ifndef _IDMHNDLR_
  31.   #include <idmhndlr.hpp>
  32. #endif
  33.  
  34. #ifndef _IDMEVENT_
  35.   #include <idmevent.hpp>
  36. #endif
  37.  
  38. #ifndef _IDMRENDR_
  39.   #include <idmrendr.hpp>
  40. #endif
  41.  
  42. #ifndef _ISET_H
  43.   #include <iset.h>
  44. #endif
  45.  
  46. /* Forward Declarations */
  47. class IEvent;
  48. class IDMTargetEnterEvent;
  49. class IDMSourceNotifyEvent;
  50. class IDMTargetDropEvent;
  51. class IDMTargetEndEvent;
  52. class IDMTargetRenderer;
  53.  
  54. #define IC_UM_DRAGOVER  WM_USER + 2
  55.  
  56. class IDMTargetHandler : public IDMHandler {
  57. typedef IDMHandler
  58.   Inherited;
  59. /*******************************************************************************
  60. * Objects of this class handle events occurring at target windows in direct    *
  61. * manipulation operations.  An instance of this class (or a derived class)     *
  62. * must be added to any window that will support direct manipulation to that    *
  63. * window.                                                                      *
  64. *                                                                              *
  65. * Example:                                                                     *
  66. *                                                                              *
  67. * // Define target handler and add to an entry field...                        *
  68. * IDragTargetHandler                                                           *
  69. *   target;                                                                    *
  70. *                                                                              *
  71. * IEntryField                                                                  *
  72. *  *pEntryField;                                                               *
  73. *                                                                              *
  74. * target.startHandlingEventsFor( pEntryField );                                *
  75. *******************************************************************************/
  76. public:
  77. typedef ISequence<IDMTgtRendererHandle> IDMTgtRendererSeq;
  78.  
  79. /*------------------------ Constructor/Destructor ------------------------------
  80. | Generic objects of this class are constructed without formal parameters.     |
  81. ------------------------------------------------------------------------------*/
  82.   IDMTargetHandler     ( );
  83.   ~IDMTargetHandler    ( );
  84.  
  85. protected:
  86.  
  87. /*------------------------------ Event Handling --------------------------------
  88. | These functions are dispatched in response to specific direct manipulation   |
  89. | target events:                                                               |
  90. |   dragOver       - Called when dragged objects are moved over the target     |
  91. |                    window.                                                   |
  92. |   dragLeave      - Called when the dragged objects are moved off the target  |
  93. |                    window.                                                   |
  94. |   drop           - Called when the dragged objects are dropped on the        |
  95. |                    target window.                                            |
  96. |   renderComplete - Called when the source has completed rendering of a       |
  97. |                    particular dragged object.                                |
  98. |   dropHelp       - Called when the user has requested help while dragging    |
  99. |                    over the target window.                                   |
  100. ------------------------------------------------------------------------------*/
  101. virtual Boolean
  102.   dragOver          ( IDMTargetEnterEvent  &event ),
  103.  
  104.   dragLeave         ( IDMSourceNotifyEvent &event ),
  105.   drop              ( IDMTargetDropEvent   &event ),
  106.   dropHelp          ( IDMSourceNotifyEvent &event ),
  107.  
  108.   renderComplete    ( IDMTargetEndEvent    &event );
  109.  
  110. /*-------------------------------- Rendering -----------------------------------
  111.   These functions permit specificiation of "renderer" objects that will be
  112.   used to handle rendering of dropped objects of compatible types:
  113.     addRenderer    - Adds an IDMTargetRenderer object to the set of such
  114.                      objects maintained for this target handler.
  115.     removeRenderer - Removes an IDMTargetRenderer object from the set.
  116.     findRenderers  - Identifies renderers for a given set of dragged objects,
  117.     renderers      - Returns pointer to collection of IDMTargetRenderer objects.
  118.     setRenderers   - Sets pointer to collection of IDMTargetRenderer objects.
  119. ------------------------------------------------------------------------------*/
  120. //pfh - not implemented virtual IDMTargetHandler
  121. // &addRenderer       ( IDMTargetRenderer &aRenderer ),
  122. // &removeRenderer    ( IDMTargetRenderer &aRenderer ),
  123. // &setRenderers      ( IDMTgtRendererSeq *renderers );
  124.  
  125. IDMTgtRendererSeq
  126.  *renderers ( );
  127.  
  128. /*------------------------------ Implementation --------------------------------
  129. | The following utility functions are used to implement the behavior of        |
  130. | this class:                                                                  |
  131. ------------------------------------------------------------------------------*/
  132.  
  133. /*-------------------------------- Overrides -----------------------------------
  134. | This class overrides the following inherited functions:                      |
  135. |   dispatchHandlerEvent - Dispatching function; handles drag target events.   |
  136. ------------------------------------------------------------------------------*/
  137. virtual Boolean
  138.   dispatchHandlerEvent ( IEvent &event );
  139.  
  140. private: /*------------------------ PRIVATE ----------------------------------*/
  141.  
  142. Boolean
  143.   assocItmsToRndrs(IDMUMTgtEnterEvent& tgtEnterEvt);
  144.  
  145. IDMTgtRendererSeq
  146.  *pTgtRenderersCl;
  147.  
  148. }; // IDMTargetHandler
  149.  
  150. #ifndef I_NO_INLINES
  151.   #include <idmtgth.inl>
  152. #endif
  153.  
  154. #endif // _IDMTGTH_
  155.