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

  1. #ifndef _IDMPROVC_
  2. #define _IDMPROVC_
  3. /*******************************************************************************
  4. * FILE NAME: idmprovc.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the declaration(s) of the class(es):                    *
  8. *     IDMCnrItemProvider    - Base class used to provide container drag items. *
  9. *     IDMCnrItemProviderFor - Template class used to provide container drag    *
  10. *                             item to a source handler at commencement of a    *
  11. *                             direct manipulation operation and target handler *
  12. *                             after a target drop event.                       *
  13. *                                                                              *
  14. * COPYRIGHT:                                                                   *
  15. *   Licensed Materials - Property of IBM                                       *
  16. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  17. *   All Rights Reserved                                                        *
  18. *   US Government Users Restricted Rights - Use, duplication, or               *
  19. *   disclosure                                                                 *
  20. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  21. *                                                                              *
  22. * $Log:   M:/ibmclass/idrag/vcs/idmprovc.hpv  $
  23. //
  24. //   Rev 1.0   02 Sep 1993 20:31:12   banzai
  25. //Initial Drop
  26. //
  27. *******************************************************************************/
  28. #ifndef _IDMPROV_
  29.   #include <idmprov.hpp>
  30. #endif
  31.  
  32. #ifndef _ICNRCTL_
  33.   #include <icnrctl.hpp>
  34. #endif
  35.  
  36. #ifndef _ICNROBJ_
  37.   #include <icnrobj.hpp>
  38. #endif
  39.  
  40. /* Forward declarations */
  41. struct _DRAGITEM;
  42. class IDMSrcOperationHandle;
  43. class IDMCnrItemHandle;
  44.  
  45.  
  46. class IDMCnrItemProvider : public IDMItemProvider {
  47. typedef IDMItemProvider
  48.   Inherited;
  49. /*******************************************************************************
  50.   BUGBUG - rewrite the commentary per latest round of changes
  51.  
  52. *******************************************************************************/
  53. public:
  54. /*------------------------- Constructors/Destructor ----------------------------
  55. | Objects of this class are constructed in the following manner:               |
  56. ------------------------------------------------------------------------------*/
  57.   IDMCnrItemProvider     ( );
  58.  
  59. virtual
  60.   ~IDMCnrItemProvider    ( );
  61.  
  62. /*--------------------------- Drag Item Provision ------------------------------
  63.   provideCnrSourceItems   - Called to give provider opportunity to attach
  64.                             derived IDMCnrItems to the argument
  65.                             IDMSourceOperation object.  This function is
  66.                             called when a drag operation commences over a
  67.                             container object.  Returns true if items were
  68.                             provided, false otherwise.
  69.   provideCnrTargetItemFor - Called to give provider opportunity to replace
  70.                             generic IDMCnrItems with a derived class.  This
  71.                             function is called when a drop occurs on a target
  72.                             container.
  73. ------------------------------------------------------------------------------*/
  74. virtual Boolean
  75.   provideCnrSourceItems      ( const IDMSrcOperationHandle &sourceOperation,
  76.                                IContainerControl           *container,
  77.                                IContainerObject            *containerObject,
  78.                                const ISize                 &sizeOffset );
  79.  
  80. //virtual IDMCnrItemHandle
  81. //  provideCnrTargetItemFor    ( const IDMCnrItemHandle      &dragItem );
  82.  
  83. virtual IDMItemHandle
  84.   provideTargetItemFor       ( const IDMItemHandle         &dragItem );
  85.  
  86. protected:
  87.  
  88. private: /*------------------------ PRIVATE ----------------------------------*/
  89. }; // class IDMCnrItemProvider
  90.  
  91.  
  92. template < class T >
  93. class IDMCnrItemProviderFor : public IDMCnrItemProvider {
  94. typedef IDMCnrItemProvider
  95.   Inherited;
  96. /*******************************************************************************
  97.   BUGBUG - rewrite the commentary per latest round of changes
  98.  
  99. *******************************************************************************/
  100. public:
  101. /*------------------------- Constructors/Destructor ----------------------------
  102. | Objects of this class are constructed in the following manner:               |
  103. ------------------------------------------------------------------------------*/
  104.   IDMCnrItemProviderFor     ( ) {}
  105.  
  106. virtual
  107.   ~IDMCnrItemProviderFor    ( ) {}
  108.  
  109.  
  110. /*--------------------------- Drag Item Provision ------------------------------
  111.   provideCnrSourceItems   - Defines template that provider uses to attach
  112.                             derived IDMCnrItems to the argument
  113.                             IDMSourceOperation object.  This function is
  114.                             called when a drag operation commences over a
  115.                             container object.  Returns true if items were
  116.                             provided, false otherwise.
  117.   provideCnrTargetItemFor - Defines template that provider uses to replace
  118.                             generic IDMCnrItems with a derived class.  This
  119.                             function is called when a drop occurs on a
  120.                             target container.
  121. ------------------------------------------------------------------------------*/
  122. virtual Boolean
  123.   provideCnrSourceItems ( const IDMSrcOperationHandle &sourceOperation,
  124.                           IContainerControl           *container,
  125.                           IContainerObject            *containerObject,
  126.                           const ISize                 &sizeOffset )
  127. {
  128.  
  129.   return( T::generateCnrSourceItems( sourceOperation,
  130.                                      container,
  131.                                      containerObject,
  132.                                      sizeOffset ) );
  133. }
  134.  
  135. //virtual IDMCnrItemHandle
  136. //  provideCnrTargetItemFor ( const IDMCnrItemHandle &dragItem )
  137. //{
  138. //
  139. //  return( (IDMCnrItemHandle)new T( *dragItem ) );
  140. //}
  141.  
  142. virtual IDMItemHandle
  143.   provideTargetItemFor ( const IDMItemHandle &dragItem )
  144. {
  145.  
  146.   return( (IDMItemHandle)new T( *dragItem ) );
  147. }
  148.  
  149.  
  150. protected:
  151.  
  152. private: /*------------------------ PRIVATE ----------------------------------*/
  153. }; // class IDMCnrItemProviderFor
  154.  
  155. #endif //_IDMPROVC_
  156.