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

  1. #ifndef _IDMCNRIT_
  2.   #define _IDMCNRIT_
  3. /*******************************************************************************
  4. * FILE NAME: idmcnrit.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the definition of the classes:                          *
  8. *     IDMCnrItem - Container direct manipulation "item" class.                 *
  9. *                                                                              *
  10. *                                                                              *
  11. * COPYRIGHT:                                                                   *
  12. *   Licensed Materials - Property of IBM                                       *
  13. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  14. *   All Rights Reserved                                                        *
  15. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. *******************************************************************************/
  19. #ifndef _IDMITEM_
  20.   #include <idmitem.hpp>
  21. #endif
  22.  
  23.  
  24. /*----------------------------------------------------------------------------*/
  25. /* Align classes on four byte boundary.                                       */
  26. /*----------------------------------------------------------------------------*/
  27. #pragma pack(4)
  28.  
  29. /* Forward Declarations */
  30. struct _DRAGITEM;
  31. class IContainerControl;
  32. class IContainerObject;
  33.  
  34.  
  35. class IDMCnrItem : public IDMItem  {
  36. typedef IDMItem
  37.   Inherited;
  38. /*******************************************************************************
  39. * Objects of this class are created by containers when a direct manipulation   *
  40. * operation commences in a source container and during a direct manipulation   *
  41. * operation when a container object is dragged over a potential target         *
  42. * container.                                                                   *
  43. *                                                                              *
  44. * Objects of this class possess the following attributes (in addition to       *
  45. * those inherited from its base class):                                        *
  46. *   o Generic buffer (contents) to hold IContainerObject(s)                    *
  47. *   o association with a source or target drag operation object (see           *
  48. *     IDMSourceOperation or IDMTargetOperation)                                *
  49. *   o association(s) with derived source or target renderer object(s) capable  *
  50. *     of renderering container objects (see IDMSourceRenderer or               *
  51. *     IDMTargetRenderer) which are created by the source or handler (see       *
  52. *     IDMSourceHandler or IDMTargetHandler)                                    *
  53. *                                                                              *
  54. * This class provides virtual functions that implement support for direct      *
  55. * manipulation (i.e. drag drop) container object items.  Derived  classes      *
  56. * can be created to support more specific container object items.              *
  57. *******************************************************************************/
  58. public:
  59.  
  60. /*------------------------- Constructors/Destructor ----------------------------
  61. | Objects of this class are constructed in the following manner:               |
  62. |   o By providing pointers to the container control, container object,        |
  63. |     a pointer to the drag source operation, and the image offset.            |
  64. |   o By providing a reference to a generic drag item handle.                  |
  65. ------------------------------------------------------------------------------*/
  66.   IDMCnrItem   ( IContainerControl     *container,
  67.                  IContainerObject      *object,
  68.                  IDMSourceOperation    *sourceOperation,
  69.                  const ISize           &imageOffset);
  70.  
  71.   IDMCnrItem   ( const IDMItem::Handle &dragItem );
  72.  
  73. virtual
  74.   ~IDMCnrItem  ( );
  75.  
  76.  
  77. /*------------------------------ Source Items ----------------------------------
  78. | This function generates source items:                                        |
  79. |   generateSourceItems - Generates container object items based upon          |
  80. |                         selected object(s) in the source container.          |
  81. ------------------------------------------------------------------------------*/
  82. static Boolean
  83.   generateSourceItems  ( IDMSourceOperation *sourceOperation );
  84.  
  85. /*--------------------------------- Accessors ---------------------------------+
  86. | These functions provide a means of getting and setting the accessible        |
  87. | attributes of instances of this class:                                       |
  88. |   containerId     - Returns the source container's ID.                       |
  89. |   sourceContainer - Returns the source container.                            |
  90. +-----------------------------------------------------------------------------*/
  91. virtual unsigned long
  92.   containerId        ( ) const;
  93.  
  94. virtual IContainerControl
  95.  *sourceContainer    ( ) const;
  96.  
  97. /*------------------------------ Drop Processing -------------------------------
  98. | This function writes data to the target window:                              |
  99. |   targetDrop  - Sets container object into target container.                 |
  100. ------------------------------------------------------------------------------*/
  101. virtual Boolean
  102.   targetDrop    ( IDMTargetDropEvent &event );
  103.  
  104.  
  105. protected:
  106. private: /*------------------------ PRIVATE ----------------------------------*/
  107.  
  108. IContainerControl
  109.  *pContainerCtl;
  110.  
  111. }; // IDMCnrItem
  112.  
  113. /*----------------------------------------------------------------------------*/
  114. /* Resume compiler default packing.                                           */
  115. /*----------------------------------------------------------------------------*/
  116. #pragma pack()
  117.  
  118. #endif // _IDMCNRIT_
  119.