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

  1. #ifndef _IDMITEM_
  2. #define _IDMITEM_
  3. /*******************************************************************************
  4.   FILE NAME: idmitem.hpp
  5.  
  6.   DESCRIPTION:
  7.     This file contains the declaration(s) of the class(es):
  8.       IDMItem                   - Base direct manipulation "item" class.
  9.       IDMItemHandle             - Handle to manage references to IDMItem
  10.                                   objects.
  11.  
  12.   COPYRIGHT:
  13.     Licensed Materials - Property of IBM
  14.     (C) Copyright IBM Corporation 1992, 1993
  15.     All Rights Reserved
  16.     US Government Users Restricted Rights - Use, duplication, or
  17.     disclosure
  18.     restricted by GSA ADP Schedule Contract with IBM Corp.
  19.  
  20. * $Log:   M:/ibmclass/idrag/vcs/idmitem.hpv  $
  21. //
  22. //   Rev 1.32   07 Sep 1993 10:42:34   banzai
  23. //Add support for DM_DISCARDOBJECT
  24. //
  25. //   Rev 1.31   06 Sep 1993 13:39:16   banzai
  26. //Add support for DM_DISCARDOBJECT
  27. //
  28. //   Rev 1.30   04 Sep 1993 14:00:16   banzai
  29. //Container DM LIVES!
  30. //
  31. //   Rev 1.29   03 Sep 1993 11:19:14   HAGGAR
  32. //Added drag image support and made assorted fixes
  33. //
  34. //   Rev 1.28   02 Sep 1993 13:21:12   banzai
  35. //Interface changes per container
  36. //
  37. //   Rev 1.27   01 Sep 1993 10:36:44   banzai
  38. //Massage per container integration
  39. //
  40. //   Rev 1.26   28 Aug 1993 15:52:56   banzai
  41. //Move part of rendering/drop logic into IDMItem
  42. //
  43. //   Rev 1.25   18 Aug 1993 15:42:18   banzai
  44. //Remove render associations
  45. //
  46. //   Rev 1.24   17 Aug 1993 15:38:46   HAGGAR
  47. //changes due to new design
  48. //
  49. //   Rev 1.23   17 Aug 1993 12:43:48   law
  50. //Removed templates from i/f.
  51. //
  52. //   Rev 1.22   17 Aug 1993 09:29:10   law
  53. //Removed template from public i/f.
  54. //
  55. //   Rev 1.21   16 Aug 1993 15:29:40   banzai
  56. //Update PM dragitem iff source update
  57. //
  58. //   Rev 1.20   16 Aug 1993 09:20:38   banzai
  59. //Cleanup for reference
  60. //
  61. //   Rev 1.19   14 Aug 1993 17:58:48   banzai
  62. //Make setNativeRMF public
  63. //
  64. //   Rev 1.18   12 Aug 1993 22:08:16   banzai
  65. //Track src and tgt op handles separately
  66. //
  67. //   Rev 1.17   12 Aug 1993 15:36:42   banzai
  68. //Cleanup compiler warnings
  69. //
  70. //   Rev 1.16   12 Aug 1993 14:41:12   banzai
  71. //Fix link bug
  72. //
  73. //   Rev 1.15   12 Aug 1993 13:52:48   banzai
  74. //Merge source and target item into one
  75. //
  76. //   Rev 1.14   10 Aug 1993 15:20:16   banzai
  77. //Make drag item provider into template
  78. //
  79. //   Rev 1.13   09 Aug 1993 12:43:00   banzai
  80. //Rename sourceRenderer & targetRenderer to renderer
  81. //
  82. //   Rev 1.12   07 Aug 1993 13:34:12   banzai
  83. //Prose cleanup
  84. //
  85. //   Rev 1.11   02 Aug 1993 15:27:54   HAGGAR
  86. //more rendering changes
  87. //
  88. //   Rev 1.10   26 Jul 1993 19:25:42   banzai
  89. //Design changes per prv/item/rndr
  90. //
  91. //   Rev 1.9   17 Jul 1993 14:04:24   banzai
  92. //Fix trap on exit
  93. //
  94. //   Rev 1.8   15 Jul 1993 13:38:54   banzai
  95. //No change
  96. //
  97. //   Rev 1.7   13 Jul 1993 15:57:30   banzai
  98. //Add assignment operator for handles
  99. //
  100. //   Rev 1.6   12 Jul 1993 18:57:00   banzai
  101. //Drag provider changes
  102. //
  103. //   Rev 1.5   12 Jul 1993 11:31:28   banzai
  104. //Rendering changes
  105. //
  106. //   Rev 1.4   01 Jul 1993 12:23:20   HAGGAR
  107. //rendering changes
  108. //
  109. //   Rev 1.3   18 Jun 1993 14:14:52   banzai
  110. //Fix handle bugs
  111. //
  112. //   Rev 1.2   04 Jun 1993 15:55:46   unknown
  113. //Changes per control enablement
  114. //
  115. //   Rev 1.1   30 Apr 1993 11:45:28   HAGGAR
  116. //
  117. //   Rev 1.0   22 Apr 1993 10:41:06   HAGGAR
  118. //Initial revision.
  119. *******************************************************************************/
  120. #ifndef _IREFCNT_
  121.   #include <irefcnt.hpp>
  122. #endif
  123.  
  124. #if 0
  125. #ifndef _ISEQ_H
  126.   #include <iseq.h>
  127. #endif
  128. #endif
  129.  
  130. #ifndef _IDMSRCOP_
  131.   #include <idmsrcop.hpp>
  132. #endif
  133.  
  134. #ifndef _IDMTGTOP_
  135.   #include <idmtgtop.hpp>
  136. #endif
  137.  
  138. #ifndef _IDMRENDR_
  139.   #include <idmrendr.hpp>
  140. #endif
  141.  
  142. #ifndef _ISTRING_
  143.   #include <istring.hpp>
  144. #endif
  145.  
  146. /* Forward Declarations */
  147. struct _DRAGITEM;
  148. class IDMItemHandle;
  149. class IDMRendererAssociate;
  150. class IDMSourceRenderEvent;
  151. class IDMSourcePrepareEvent;
  152. class IDMSourceEndEvent;
  153. class IDMSourceDiscardEvent;
  154. class IDMSourcePrintEvent;
  155. class IDMTargetDropEvent;
  156. class IDMCnrDropEvent;
  157. class IDMTargetEndEvent;
  158. class IDMImage;
  159.  
  160.  
  161. class IDMItem : public IRefCounted {
  162. typedef IRefCounted
  163.   Inherited;
  164. /*******************************************************************************
  165. * This is the common base class for the direct manipulation drag item classes. *
  166. * This base class provides the common support required to represent objects    *
  167. * that are dragged/dropped during a direct manipulation operation.             *
  168. *                                                                              *
  169. * Objects of this class are created by windows when a direct manipulation      *
  170. * operation commences in a source window and during a direct manipulation      *
  171. * operation when the objects are dragged over a target window.                 *
  172. *                                                                              *
  173. * Objects of this class possess the following attributes (in addition to       *
  174. * those inherited from its base class):                                        *
  175. *   o source window handle                                                     *
  176. *   o types ("true" and additional) of the dragged object                      *
  177. *   o container name (at the source)                                           *
  178. *   o source name                                                              *
  179. *   o suggested target name                                                    *
  180. *   o relative position of the corresponding object image in the drag pointer  *
  181. *   o source flags providing instructions as to how the object is to be        *
  182. *     rendered, etc.                                                           *
  183. *   o Generic IString buffer (contents) to hold a various assortment of "bytes"*
  184. *   o association with a source drag operation object (see                     *
  185. *     IDMSourceOperation)                                                      *
  186. *   o association(s) with source drag renderer object(s) (see                  *
  187. *     IDMSourceRenderer) which are created by the source handler (see          *
  188. *     IDMSourceHandler)                                                        *
  189. *   o association with a target drag operation object (see                     *
  190. *     IDMTargetOperation)                                                      *
  191. *   o association(s) with target drag renderer object(s) (see                  *
  192. *     IDMTargetRenderer) which are created by the target handler (see          *
  193. *     IDMTargetHandler)                                                        *
  194. *                                                                              *
  195. * This class provides virtual functions that implements the base ICLUI support *
  196. * for direct manipulation (i.e. drag drop) drag item objects.  Derived classes *
  197. * are created to support specific drag item objects such as text item and      *
  198. * container item objects.                                                      *
  199. *******************************************************************************/
  200. public:
  201. friend class IDMSourceOperation;
  202. friend class IDMTargetOperation;
  203.  
  204. /*----------------------  Supported Operations Flags  --------------------------
  205.   The following static members define a drag object's supported
  206.   operations flags:
  207.  
  208.   The valid supported operations are:
  209.     unknown   - No supported drag operations are available.
  210.     copyable  - The source object that is being dragged can be copied to
  211.                 the specified drop location.
  212.     moveable  - The source object that is being dragged can be moved to
  213.                 the specified drop location.
  214.     linkable  - The source object that is being dragged can be linked to
  215.                 the specified object.
  216.  
  217.   Note:  These static members represent bit masks.  User defined values
  218.          must be greater than linkable.
  219. ------------------------------------------------------------------------------*/
  220. static const unsigned short
  221.   unknown,
  222.   copyable,
  223.   moveable,
  224.   linkable;
  225.  
  226. /*----------------------------  Attributes Flags  ------------------------------
  227.   The following static members define the drag object's attribute flags:
  228.  
  229.   The valid attributes of dragged objects are:
  230.     none             - No attributes are defined.
  231.     open             - Source object is open
  232.     reference        - Source object is a reference to another object
  233.     group            - Source object is a group of objects
  234.     container        - Source object is a container of other objects
  235.     prepare          - Source object requires preparation before it
  236.                          establishes a data transfer conversation
  237.     removableMedia   - Source object is on removable media, or source object
  238.                          cannot be recovered after a move operation
  239.  
  240.   Note:  These static members represent bit masks.  User defined values
  241.          must be greater than removableMedia.
  242. ----------------------------------------------------------------------------*/
  243. static const unsigned short
  244.   none,
  245.   open,
  246.   reference,
  247.   group,
  248.   container,
  249.   prepare,
  250.   removableMedia;
  251.  
  252. /*-------------------------------- Accessors -----------------------------------
  253. | These functions provide access to attributes of instances of this class:     |
  254. |   sourceWindow         - Returns handle of the source window for this item.  |
  255. |   containerName        - Returns the source container name.                  |
  256. |   sourceName           - Returns the source object "name."                   |
  257. |   targetName           - Returns the suggested target object "name."         |
  258. |   attributes           - Returns the control attributes for this item.       |
  259. |   supportedOperations  - Returns the operations supported by this item       |
  260. |   origin               - Returns the item's origin offset from pointer       |
  261. |                           hotspot.                                           |
  262. |   dragImage            - Returns the drag image for this item, or 0 if none. |
  263. ------------------------------------------------------------------------------*/
  264. IWindowHandle
  265.   sourceWindow           ( ) const;
  266.  
  267. IString
  268.   containerName          ( ) const,
  269.   sourceName             ( ) const,
  270.   targetName             ( ) const;
  271.  
  272. unsigned short
  273.   attributes             ( ) const;
  274.  
  275. unsigned short
  276.   supportedOperations    ( ) const;
  277.  
  278. ISize
  279.   origin                 ( ) const;
  280.  
  281. virtual IDMImage
  282.   *dragImage             ( ) const;
  283.  
  284. /*-------------------------------- Attributes ----------------------------------
  285. | These functions permit the testing of a variety of drag item "attribute"     |
  286. | flags:                                                                       |
  287. |   isOpen                 - Indicates whether the dragged object is "open".   |
  288. |   isReference            - Indicates whether the dragged object is a         |
  289. |                            "reference" to another object.                    |
  290. |   isGroup                - Indicates whether the item is a group of objects. |
  291. |   isContainer            - Indicates whether the item is a container of other|
  292. |                            objects.                                          |
  293. |   isOnRemovableMedia     - Indicates whether the item is on removable media  |
  294. |                            or cannot be recovered after a move operation.    |
  295. |   requiresPreparation    - Indicates whether the source requires preparation |
  296. |                            prior to rendering.                               |
  297. ------------------------------------------------------------------------------*/
  298. virtual Boolean
  299.   isOpen                    ( ) const,
  300.   isReference               ( ) const,
  301.   isGroup                   ( ) const,
  302.   isContainer               ( ) const,
  303.   isOnRemovableMedia        ( ) const,
  304.   requiresPreparation       ( ) const;
  305.  
  306. /*-------------------------------- Operations ----------------------------------
  307. | These functions permit the querying of the supported direct manipulation     |
  308. | operations for this class:                                                   |
  309. |   canBeCopied  - Indicates whether a copy operation is supported.            |
  310. |   canBeLinked  - Indicates whether a link operation is supported.            |
  311. |   canBeMoved   - Indicates whether a move operation is supported.            |
  312. ------------------------------------------------------------------------------*/
  313. virtual Boolean
  314.   canBeCopied    ( ) const,
  315.   canBeLinked    ( ) const,
  316.   canBeMoved     ( ) const;
  317.  
  318. /*------------------------------- Object Type ----------------------------------
  319. | These functions provide means for querying the "type" of the item:           |
  320. |   trueType  - Returns the "true type" of the item.                           |
  321. |   types     - Returns all types for the item.                                |
  322. |   hasType   - Indicates whether the item supports an argument type.          |
  323. ------------------------------------------------------------------------------*/
  324. virtual IString
  325.   trueType          ( ) const,
  326.   types             ( ) const;
  327.  
  328. virtual Boolean
  329.   hasType           ( const IString &aType ) const;
  330.  
  331. /*-----------------------  Rendering Mechanisms/Formats  -----------------------
  332. | These functions provide means for querying the rendering mechanism and/or    |
  333. | format of the item:                                                          |
  334. |   nativeSourceRMF - Returns the "native" rendering mechanism and format of   |
  335. |                     the item.                                                |
  336. |   nativeSourceRM  - Returns the "native" rendering mechanism of the item.    |
  337. |   nativeSourceRF  - Returns the "native" rendering format of the item.       |
  338. |   sourceRMFs      - Returns all rendering mechanisms and formats of the item.|
  339. |   hasRMF          - Indicates whether the item supports a specific rendering |
  340. |                     mechanism and format.                                    |
  341. |   setNativeRMF    - Sets the "native" RMF to the argument type.              |
  342. ------------------------------------------------------------------------------*/
  343. virtual IString
  344.   nativeSourceRMF    ( ) const,
  345.   nativeSourceRM     ( ) const,
  346.   nativeSourceRF     ( ) const,
  347.   sourceRMFs         ( ) const;
  348.  
  349. virtual Boolean
  350.   hasRMF             ( const IString &aType );
  351.  
  352. virtual IDMItem
  353.  &setNativeRMF       ( const IString &aRMF );
  354.  
  355. /*------------------------------- Renderer Support -----------------------------
  356. | These functions are temporary pending redesign of the renderer selection     |
  357. | logic:                                                                       |
  358. |   srcRenderer    - Returns source renderer for this drag drop operation.     |
  359. |   tgtRenderer    - Returns target renderer for this drag drop operation.     |
  360. |   setSrcRenderer - Sets source renderer for this drag drop operation.        |
  361. |   setTgtRenderer - Sets target renderer for this drag drop operation.        |
  362. ------------------------------------------------------------------------------*/
  363. IDMSourceRenderer
  364.  *srcRenderer       ( );
  365.  
  366. IDMTargetRenderer
  367.  *tgtRenderer       ( );
  368.  
  369. IDMItem
  370.  &setSrcRenderer    ( IDMSourceRenderer *pRenderer ),
  371.  &setTgtRenderer    ( IDMTargetRenderer *pRenderer );
  372.  
  373. /*----------------- Source Renderering Support (Callbacks) ---------------------
  374. | These functions provide source renderering support:                          |
  375. |   render         - Called to give the item opportunity to acquire the data   |
  376. |                    that will be transferred to the target.                   |
  377. |   renderPrepare  - Called to give the item opportunity to acquire            |
  378. |                    information needed by the target, perform a task          |
  379. |                    required by a target prior to target renderering, or      |
  380. |                    perform setup required by a source renderer.              |
  381. |   sourceFinished - Called by the target handler when the source has informed |
  382. |                    it that the source has finished rendering the data that   |
  383. |                    was associated with the dropped item.                     |
  384. ------------------------------------------------------------------------------*/
  385. virtual Boolean
  386.   render           ( IDMSourceRenderEvent  &event ),
  387.   renderPrepare    ( IDMSourcePrepareEvent &event ),
  388.   sourceFinished   ( IDMTargetEndEvent     &event );
  389.  
  390. /*--------------------- Target Drop Support (Callbacks) ------------------------
  391. | These functions provide source renderering support:                          |
  392. |   targetFinished - Called by the source handler when the target has informed |
  393. |                    it that the target has finished processing the data that  |
  394. |                    was associated with the dropped item.  Source cleanup for |
  395. |                    the item should occur here.                               |
  396. |   dropped        - Called to give the item the opportunity to "write" the    |
  397. |                    data that was transferred to the target window.  Target   |
  398. |                    cleanup for the item should occur here.                   |
  399. |   cnrDropped     - Called if the target is a container.                      |
  400. ------------------------------------------------------------------------------*/
  401. virtual Boolean
  402.   targetFinished    ( IDMSourceEndEvent  &event ),
  403.   dropped           ( IWindow            *targetWindow,
  404.                       IDMTargetDropEvent &event ),
  405.   cnrDropped        ( IWindow            *container,
  406.                       IDMCnrDropEvent    &event );
  407.  
  408. /*---------------------- Other Drop Support (Callbacks) ------------------------
  409. | These functions provide "other" source direct manipulation support:          |
  410. |   discard - Called by a derived IDMSourceHandler::discardObjects() function  |
  411. |             when it was indicated that the source window has responsibility  |
  412. |             for discarding the item.                                         |
  413. |   print   - Called by a derived IDMSourceHandler::printObjects() function    |
  414. |             when it was indicated that the source window has responsibility  |
  415. |             for printing the item.                                           |
  416. ------------------------------------------------------------------------------*/
  417. virtual Boolean
  418.   discard           ( IDMSourceDiscardEvent  &event ),
  419.   print             ( IDMSourcePrintEvent    &event );
  420.  
  421. /*------------------------------ Drag Contents ---------------------------------
  422. | These functions provide read/write access to the actual data associated      |
  423. | with the direct manipulation operation:                                      |
  424. |   contents     - Returns the contents of the drag item.                      |
  425. |   contentsSize - Returns the size of the contents of the drag item.          |
  426. |   setContents  - Sets contents of the drag item.  Derived class should       |
  427. |                  override to provide specific implementation based upon      |
  428. |                  characteristics of the window.                              |
  429. ------------------------------------------------------------------------------*/
  430. virtual IString
  431.   contents             ( ) const;
  432.  
  433. virtual unsigned
  434.   contentsSize         ( ) const;
  435.  
  436. virtual Boolean
  437.   setContents          ( const IString &data );
  438.  
  439. virtual
  440.  ~IDMItem    ( );
  441.  
  442.  
  443. protected:
  444. /*----------------------------- Constructor ------------------------------------
  445. | Generic objects of this class are constructed in the following manner:       |
  446. |   o By providing the drag source operation handle, types, supported          |
  447. |     operations and attributes.                                               |
  448. |   o By providing the drag target operation handle and generic drag item      |
  449. |     handle.                                                                  |
  450. ------------------------------------------------------------------------------*/
  451.   IDMItem     ( const IDMSrcOperationHandle sourceOperation,
  452.                 const IString &types,
  453.                 const unsigned short supportedOperations = unknown,
  454.                 const unsigned short attributes = none);
  455.  
  456.   IDMItem     ( const IDMTgtOperationHandle targetOperation,
  457.                 _DRAGITEM                   *dragItem );
  458.  
  459. /*--------------------------- Source Accessors ---------------------------------
  460. | These functions allow the setting of attributes for instances of this class: |
  461. |   setSourceWindow      - Sets the source window for this item.               |
  462. |   setContainerName     - Sets the source container name.                     |
  463. |   setTargetName        - Sets the suggested target object "name".            |
  464. |   setSourceName        - Sets the source object "name".                      |
  465. |   setOrigin            - Sets this item's origin offset from the pointer     |
  466. |                          hotspot.                                            |
  467. |   setDragImage         - Sets or removes this item's drag image              |
  468. ------------------------------------------------------------------------------*/
  469. IDMItem
  470.  &setSourceWindow        ( IWindowHandle window ),
  471.  &setContainerName       ( const char* containerName ),
  472.  &setTargetName          ( const char* targetName ),
  473.  &setSourceName          ( const char* sourceName ),
  474.  &setOrigin              ( const ISize& origin ),
  475.  &setDragImage           ( IDMImage *pDrgImg);
  476.  
  477. /*--------------------------- Source Attributes --------------------------------
  478. | These functions permit the setting of a variety of drag item                 |
  479. | "attribute" flags:                                                           |
  480. |   setRequiresPreparation - Set/reset the "requiresPreparation" flag.         |
  481. |   setOpen                - Set/reset the "isOpen" flag.                      |
  482. |   setReference           - Set/reset the "isReference" flag.                 |
  483. |   setGroup               - Set/reset the "isGroup" flag.                     |
  484. |   setContainer           - Set/reset the "isContainer" flag.                 |
  485. |   setOnRemovableMedia    - Set/reset the "isOnRemovableMedia" flag.          |
  486. ------------------------------------------------------------------------------*/
  487. virtual IDMItem
  488.  &setRequiresPreparation    ( Boolean requiresPrep     = true ),
  489.  &setOpen                   ( Boolean open             = true ),
  490.  &setReference              ( Boolean reference        = true ),
  491.  &setGroup                  ( Boolean group            = true ),
  492.  &setContainer              ( Boolean container        = true ),
  493.  &setOnRemovableMedia       ( Boolean onRemovableMedia = true );
  494.  
  495. /*--------------------------- Source Operations --------------------------------
  496. | These functions permit the setting of the supported direct manipulation      |
  497. | operations for this class:                                                   |
  498. |   enableCopy    - Enables or disables copy operation for the item.           |
  499. |   enableLink    - Enables or disables link operation for the item.           |
  500. |   enableMove    - Enables or disables move operation for the item.           |
  501. ------------------------------------------------------------------------------*/
  502. virtual IDMItem
  503.  &enableCopy       ( Boolean copyable = true ),
  504.  &enableLink       ( Boolean linkable = true ),
  505.  &enableMove       ( Boolean moveable = true );
  506.  
  507. /*-------------------------- Source Object Type --------------------------------
  508. | These functions provide means for setting the "type" of the drag item:       |
  509. |   setTrueType     - Sets the "true type" to the argument type.               |
  510. |   addType         - Adds an additional type (or types).                      |
  511. |   removeType      - Removes a type from this item.                           |
  512. |   replaceType     - Replaces a type for this item.                           |
  513. ------------------------------------------------------------------------------*/
  514. virtual IDMItem
  515.  &setTrueType       ( const IString &aType ),
  516.  &addType           ( const IString &aType ),
  517.  &removeType        ( const IString &aType ),
  518.  &replaceType       ( const IString &oldType, const IString &newType );
  519.  
  520. /*-----------------------  Rendering Mechanisms/Formats  -----------------------
  521. | These functions provide means for setting the "RMF" of the drag item:        |
  522. |   addRMF          - Adds an additional RMF (or RMFs).                        |
  523. |   removeRMF       - Removes a RMF from this item.                            |
  524. |   replaceRMF      - Replaces a RMF for this item.                            |
  525. |   buildRMF        - builds a rendering mechanism and format (RMF)            |
  526. |                     string.  This function is provided as base function      |
  527. |                     and is intended to be overloaded by subclasses           |
  528. |                     who need to add additional information to the RMF        |
  529. |                     string.  For example, text items may want to add         |
  530. |                     their process identifiers.                               |
  531. ------------------------------------------------------------------------------*/
  532. virtual IDMItem
  533.  &addRMF            ( const IString &aRMF ),
  534.  &removeRMF         ( const IString &aRMF ),
  535.  &replaceRMF        ( const IString &oldRMF,    const IString &newRMF );
  536.  
  537. virtual IString
  538.   buildRMF          ( const IString &mechanism, const IString &format);
  539.  
  540.  
  541. private: /*------------------------ PRIVATE ----------------------------------*/
  542. friend class IDMSourceRenderEvent;
  543. friend class IDMTargetRenderer;
  544. friend class IDMTargetEndEvent;
  545.  
  546. unsigned short
  547.   dragSupOps,
  548.   dragAttrs;
  549.  
  550. IWindowHandle
  551.   sourceWndh;
  552.  
  553. IDMImage
  554.   *pIDMImage;
  555.  
  556. Boolean
  557.   bAutoDelImage;
  558.  
  559. ISize
  560.   sizeOrigin;
  561.  
  562. IString
  563.   strContainerName,
  564.   strSourceName,
  565.   strTargetName,
  566.   strTypes,
  567.   strRMFs,
  568.   strContents;
  569.  
  570. IDMSrcOperationHandle
  571.   pDMSrcOperationH;
  572.  
  573. IDMTgtOperationHandle
  574.   pDMTgtOperationH;
  575.  
  576. IDMSourceRenderer
  577.  *pSrcRenderer;
  578.  
  579. IDMTargetRenderer
  580.  *pTgtRenderer;
  581.  
  582. _DRAGITEM
  583.  *PMDragItem    ( );
  584.  
  585. void
  586.  setPMDragItem  ( _DRAGITEM *pDragItem );
  587.  
  588. void
  589.   asPMDragItem  ( _DRAGITEM *pDragItem );
  590.  
  591. _DRAGITEM
  592.  *pPMDragItem;
  593.  
  594. static IString
  595.   stringFromHandle (const IStringHandle& hstr);
  596.  
  597. IStringHandle
  598.   handleFromString (IString inputStr);
  599.  
  600. }; // IDMItem
  601.  
  602.  
  603. class IDMItemHandle : public IReference< IDMItem > {
  604. /*******************************************************************************
  605. * Objects of this class provide access to IDMItem objects associated with      *
  606. * a direct manipulation event.  This "handle" class manages references to      *
  607. * the IDMItem object to ensure that it is not deleted until the drag           *
  608. * operation is completed.                                                      *
  609. *                                                                              *
  610. * This class provides a "->" operator that enables instances to be treated     *
  611. * just like a pointer to an IDMItem object.                                    *
  612. *                                                                              *
  613. * Example:                                                                     *
  614. *                                                                              *
  615. * This class has no members.  It is essentially a synonym for the type         *
  616. * IReference< IDMItem >.                                                       *
  617. *******************************************************************************/
  618. public:
  619.   IDMItemHandle  ( IDMItem *item );
  620.   ~IDMItemHandle ( );
  621.  
  622. /*--------------------------------- Operators ---------------------------------+
  623. | Operators defined for IDMSrcItemHandle:                                      |
  624. |   =  - Overload definition to handle assignments of source drag item         |
  625. |        pointers to source drag item handles.                                 |
  626. +-----------------------------------------------------------------------------*/
  627. IDMItemHandle
  628.  &operator = ( IDMItem *item );
  629.  
  630. }; // IDMItemHandle
  631.  
  632.  
  633. #ifndef I_NO_INLINES
  634.   #include <idmitem.inl>
  635. #endif
  636.  
  637. #endif // _IDMITEM_
  638.