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

  1. #ifndef _IDMEVENT_
  2. #define _IDMEVENT_
  3. /*******************************************************************************
  4. * FILE NAME: idmevent.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the declaration(s) of the class(es):                    *
  8. *     IDMEvent                                                                 *
  9. *                                                                              *
  10. *     IDMSourceBeginEvent                                                      *
  11. *     IDMSourceRenderEvent                                                     *
  12. *     IDMSourcePrepareEvent                                                    *
  13. *     IDMSourceEndEvent                                                        *
  14. *     IDMSourceDiscardEvent                                                    *
  15. *     IDMSourcePrintEvent                                                      *
  16. *                                                                              *
  17. *     IDMTargetEnterEvent                                                      *
  18. *     IDMTargetLeaveEvent                                                      *
  19. *     IDMTargetDropEvent                                                       *
  20. *     IDMTargetHelpEvent                                                       *
  21. *     IDMTargetEndEvent                                                        *
  22. *                                                                              *
  23. * COPYRIGHT:                                                                   *
  24. *   Licensed Materials - Property of IBM                                       *
  25. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  26. *   All Rights Reserved                                                        *
  27. *   US Government Users Restricted Rights - Use, duplication, or               *
  28. *   disclosure                                                                 *
  29. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  30. *                                                                              *
  31. *******************************************************************************/
  32. #ifndef _IEVENT_
  33.   #include <ievent.hpp>
  34. #endif
  35.  
  36. #ifndef _IDMITEM_
  37.   #include <idmitem.hpp>
  38. #endif
  39.  
  40. #ifndef _IDMSRCOP_
  41.   #include <idmsrcop.hpp>
  42. #endif
  43.  
  44. #ifndef _IDMCOMM_
  45.   #include <idmcomm.hpp>
  46. #endif
  47.  
  48. /*----------------------------------------------------------------------------*/
  49. /* Align classes on four byte boundary.                                       */
  50. /*----------------------------------------------------------------------------*/
  51. #pragma pack(4)
  52.  
  53. /* Forward Declarations */
  54. struct _DRAGTRANSFER;
  55. struct _DRAGITEM;
  56. struct _PRINTDEST;
  57. class IPoint;
  58. class IWindowHandle;
  59. class IString;
  60. class IContainerObject;
  61. class IContainerControl;
  62. class IDMSourceOperation;
  63.  
  64. class IDMEvent : public IEvent {
  65. typedef IEvent
  66.   Inherited;
  67. /*******************************************************************************
  68. * This is the common base class for all direct manipulation event classes.     *
  69. *******************************************************************************/
  70. public:
  71.  
  72. /*----------------------- Constructor/Destructor ------------------------------|
  73. | Instances of this class are constructed from a generic IEvent.               |
  74. ------------------------------------------------------------------------------*/
  75.   IDMEvent     ( const IEvent &event );
  76.  
  77. virtual
  78.   ~IDMEvent    ( );
  79.  
  80. protected:
  81. private: /*------------------------ PRIVATE ----------------------------------*/
  82.  
  83. };
  84.  
  85.  
  86. class IDMSourceBeginEvent : public IDMEvent {
  87. typedef IDMEvent
  88.   Inherited;
  89. typedef IDM::Source
  90.   Source;
  91. /*******************************************************************************
  92. * Objects of this class represent the event that occurs upon initiation        *
  93. * of a direct manipulation event at the source window.  Instances are          *
  94. * passed as argument to the IDMSourceHandler functions setup() and             *
  95. * begin() functions.                                                           *
  96. *******************************************************************************/
  97. public:
  98. /*------------------------- Constructors/Destructor ----------------------------
  99. | Objects of this class are constructed from generic IEvent objects.           |
  100. ------------------------------------------------------------------------------*/
  101.   IDMSourceBeginEvent     ( const IEvent &event );
  102.  
  103. virtual
  104.   ~IDMSourceBeginEvent    ( );
  105.  
  106. /*--------------------------------- Accessors ----------------------------------
  107. | These functions provide means of getting and setting the accessible          |
  108. | attributes of instances of this class:                                       |
  109. |   source        - Returns the source of the drag operation.                  |
  110. |   position      - Returns the pointing device position (only if source is    |
  111. |                   pointingDevice).                                           |
  112. ------------------------------------------------------------------------------*/
  113. virtual Source
  114.   source    ( ) const;
  115.  
  116. virtual IPoint
  117.   position  ( ) const;
  118.  
  119. /*---------------------------- Container Support ------------------------------+
  120. | These methods provide a means of getting and setting the container           |
  121. | attributes of instances of this class:                                       |
  122. |   containerId   - Returns the source container's ID.                         |
  123. |   object        - Returns a pointer to the object over which the drag        |
  124. |                   started.  Returns 0 if drag started over container         |
  125. |                   "white space" or if non-container.                         |
  126. |   container     - Returns a pointer to the source container for which the    |
  127. |                   event occurred.                                            |
  128. |   offset        - Returns the position of the pointing device relative to    |
  129. |                   the source container object's origin.                      |
  130. +-----------------------------------------------------------------------------*/
  131. virtual unsigned long
  132.   containerId      ( ) const;
  133.  
  134. virtual IContainerObject
  135.  *object           ( ) const;
  136.  
  137. virtual IContainerControl
  138.  *container        ( ) const;
  139.  
  140. virtual ISize
  141.   offset           ( ) const;
  142.  
  143.  
  144. protected:
  145. private: /*------------------------ PRIVATE ----------------------------------*/
  146.  
  147. Source
  148.   src;
  149.  
  150. }; // IDMSourceBeginEvent
  151.  
  152.  
  153. class IDMSourceRenderEvent : public IDMEvent {
  154. typedef IDMEvent
  155.   Inherited;
  156. /*******************************************************************************
  157. * Objects of this class represent direct manipulation "rendering" events.      *
  158. * Such events are created and dispatched to source handlers when a direct      *
  159. * manipulation target handler requests source rendering.                       *
  160. *                                                                              *
  161. * In addition to the standard IEvent attributes (event and window              *
  162. * identifiers), such objects also possess:                                     *
  163. *   o an associated IDMItem                                                    *
  164. *   o an alternate window handle                                               *
  165. *   o a target window handle                                                   *
  166. *   o a rendering mechanism/format selected by the target                      *
  167. *   o a target name                                                            *
  168. *   o an arbitrary target "information" (an unsigned long)                     *
  169. *******************************************************************************/
  170. public:
  171. /*------------------------- Constructors/Destructor ----------------------------
  172. | Objects of this class are constructed from generic IEvent objects.           |
  173. ------------------------------------------------------------------------------*/
  174.   IDMSourceRenderEvent     ( const IEvent &event );
  175.  
  176. virtual
  177.   ~IDMSourceRenderEvent    ( );
  178.  
  179.  
  180. /*-------------------------------- Accessors -----------------------------------
  181. | The following functions provide read/write access to the accessible          |
  182. | attributes of instances of this class:                                       |
  183. |   dragItem              - Returns handle to the IDMItem corresponding to     |
  184. |                           the item being rendered.                           |
  185. |   alternateWindow       - Returns a pointer to the alternate source window.  |
  186. |   alternateWindowHandle - Returns the handle of the alternate source window. |
  187. |   selectedMechanism     - Returns the selected rendering mechanism.          |
  188. |   selectedFormat        - Returns the selected rendering format.             |
  189. |   targetName            - Returns the target "render to" name.               |
  190. |   targetInfo            - Returns the target-defined "information."          |
  191. |   setTargetInfo         - Can be used to pass information to the target      |
  192. |   targetWindow          - Returns a pointer to the target window.            |
  193. |   targetWindowHandle    - Returns the handle of the target window.           |
  194. |   canRetry              - Indicates whether renderer processing this event   |
  195. |                           will be allowed to retry if a failure occurs.      |
  196. |   setRetry              - Sets the retry flag.                               |
  197. |   completion            - Returns the flag which indicates a successful      |
  198. |                           completion or not.                                 |
  199. |   setCompletion         - Sets the completion flag.                          |
  200. ------------------------------------------------------------------------------*/
  201. virtual IDMItem::Handle
  202.   dragItem                ( ) const;
  203.  
  204. virtual IWindow
  205.  *alternateWindow         ( ) const,
  206.  *targetWindow            ( ) const;
  207.  
  208. virtual IWindowHandle
  209.   alternateWindowHandle   ( ) const,
  210.   targetWindowHandle      ( ) const;
  211.  
  212. virtual IString
  213.   selectedMechanism       ( ) const,
  214.   selectedFormat          ( ) const,
  215.   targetName              ( ) const;
  216.  
  217. virtual unsigned long
  218.   targetInfo              ( ) const;
  219.  
  220. virtual Boolean
  221.   canRetry                ( ) const;
  222.  
  223. virtual IDMSourceRenderEvent
  224.  &setTargetInfo           ( unsigned long         info ),
  225.  &setRetry                ( Boolean               allowRetry = true ),
  226.  &setCompletion           ( IDM::RenderCompletion code );
  227.  
  228. virtual IDM::RenderCompletion
  229.   completion              ( ) const;
  230.  
  231. protected:
  232. private: /*------------------------ PRIVATE ----------------------------------*/
  233. friend class IDMSourcePrepareEvent;
  234. friend class IDMSourceRenderer;
  235.  
  236. IDMItem::Handle
  237.   pDMSrcItemHandle;
  238.  
  239. IString
  240.   strSelMechanism,
  241.   strSelFormat,
  242.   strTgtName;
  243.  
  244. Boolean
  245.   bRetry;
  246.  
  247. IDM::RenderCompletion
  248.   rcCompletion;
  249.  
  250. _DRAGTRANSFER
  251.  *pPMDragTransfer;
  252.  
  253. IWindowHandle
  254.   tgtWindowHandle;
  255.  
  256. _DRAGTRANSFER
  257.  *dragTransfer       ( ) const;
  258. }; // IDMSourceRenderEvent
  259.  
  260.  
  261. class IDMSourcePrepareEvent : public IDMSourceRenderEvent {
  262. typedef IDMSourceRenderEvent
  263.   Inherited;
  264. /*******************************************************************************
  265. * These events are sent to the source window when the source renderer for a    *
  266. * given object has indicated such notification is necessary prior to starting  *
  267. * the source rendering of a drag item.                                         *
  268. *                                                                              *
  269. * Objects of this class provide all the "query" functions inherited from       *
  270. * IDMSourceRenderEvent.  In addition, functions are provided to provide        *
  271. * return information to the target:                                            *
  272. *   o an alternate source window that the target should communicate with       *
  273. *     during rendering                                                         *
  274. *   o two result flags indicating whether rendering should be done by the      *
  275. *     target and/or whether the target should retry with a different           *
  276. *     rendering mechanism and format.                                          *
  277. *******************************************************************************/
  278. public:
  279. /*------------------------- Constructors/Destructor ----------------------------
  280. | Objects of this class are constructed from generic IEvent objects.           |
  281. ------------------------------------------------------------------------------*/
  282.   IDMSourcePrepareEvent     ( const IEvent &event );
  283.  
  284. virtual
  285.   ~IDMSourcePrepareEvent    ( );
  286.  
  287.  
  288. /*-------------------------------- Accessors -----------------------------------
  289. | The following functions provide read/write access to the accessible          |
  290. | attributes of instances of this class:                                       |
  291. |   alternateWindow          - Returns a pointer to the alternate source       |
  292. |                              window.                                         |
  293. |   alternateWindowHandle    - Returns the handle of the alternate source      |
  294. |                              window.                                         |
  295. |   setAlternateWindowHandle - Sets alternate source window handle.            |
  296. ------------------------------------------------------------------------------*/
  297. virtual IWindow
  298.  *alternateWindow             ( ) const;
  299.  
  300. virtual IWindowHandle
  301.   alternateWindowHandle       ( ) const;
  302.  
  303. IDMSourcePrepareEvent
  304.  &setAlternateWindowHandle    ( const IWindowHandle &window );
  305.  
  306. /*---------------------------------- Result ------------------------------------
  307. | These functions provide means of specifying render preparation results to    |
  308. | be passed back to the target:                                                |
  309. |   targetCanRetry       - Returns current setting of the "retry" flag.        |
  310. |   noSourceRendering    - Returns current "no source rendering" flag.         |
  311. |   setTargetCanRetry    - Sets "retry" flag.                                  |
  312. |   setNoSourceRendering - Sets "no source rendering" flag.                    |
  313. ------------------------------------------------------------------------------*/
  314. Boolean
  315.   targetCanRetry       ( ) const,
  316.   noSourceRendering    ( ) const;
  317.  
  318. IDMSourcePrepareEvent
  319.  &setTargetCanRetry    ( Boolean flag ),
  320.  &setNoSourceRendering ( Boolean flag );
  321.  
  322. protected:
  323. private: /*------------------------ PRIVATE ----------------------------------*/
  324. Boolean
  325.   bTgtCanRetry,
  326.   bNoSrcRendering;
  327. }; // IDMSourcePrepareEvent
  328.  
  329.  
  330. class IDMSourceEndEvent : public IDMEvent {
  331. typedef IDMEvent
  332.   Inherited;
  333. /*******************************************************************************
  334. * These events are sent to the direct manipulation source window when a        *
  335. * target renderer has completed the rendering of a drag item.  One such        *
  336. * event is expected for each of the drag items involved in the direct          *
  337. * manipulation operation.                                                      *
  338. *******************************************************************************/
  339. public:
  340. /*------------------------- Constructors/Destructor ----------------------------
  341. | Objects of this class are constructed from generic IEvent objects.           |
  342. ------------------------------------------------------------------------------*/
  343.   IDMSourceEndEvent     ( const IEvent &event );
  344.  
  345. virtual
  346.   ~IDMSourceEndEvent    ( );
  347.  
  348. /*-------------------------------- Accessors -----------------------------------
  349. | These functions provide access to attributes of instances of this class:     |
  350. |   dragItem            - Returns handle of drag item the target has           |
  351. |                         completed rendering of.                              |
  352. |   wasTargetSuccessful - Returns whether target successfully completed its    |
  353. |                         rendering.                                           |
  354. ------------------------------------------------------------------------------*/
  355. virtual IDMItem::Handle
  356.   dragItem             ( ) const;
  357.  
  358. virtual Boolean
  359.   wasTargetSuccessful  ( ) const;
  360.  
  361. protected:
  362. private: /*------------------------ PRIVATE ----------------------------------*/
  363. Boolean
  364.   bWasTgtSuccessful;
  365.  
  366. IDMItem::Handle
  367.   pDMSrcItemHandle;
  368.  
  369. }; // IDMSourceEndEvent
  370.  
  371.  
  372. class IDMSourceDiscardEvent : public IDMEvent {
  373. typedef IDMEvent
  374.   Inherited;
  375. typedef IDM::DiscardIndicator
  376.   DiscardIndicator;
  377. /*******************************************************************************
  378. * Events of this class are sent to the source window when the dragged objects  *
  379. * are dropped on a shredder object.  The event essentially returns an          *
  380. * indicator to the target identifying who has responsibility for deletion of   *
  381. * the item(s) or an indicator that aborts the discard operation.               *
  382. *******************************************************************************/
  383. public:
  384. /*------------------------- Constructors/Destructor ----------------------------
  385. | Objects of this class are constructed from generic IEvent objects.           |
  386. ------------------------------------------------------------------------------*/
  387.   IDMSourceDiscardEvent     ( const IEvent &event );
  388.  
  389. virtual
  390.   ~IDMSourceDiscardEvent    ( );
  391.  
  392. /*-------------------------------- Accessors -----------------------------------
  393. | These functions provide access to attributes of instances of this class:     |
  394. |   sourceOperation    - Returns the source operation for this event.          |
  395. |   setSourceOperation - Sets the source operation for this event.             |
  396. |   whoDiscards        - Returns discard indicator that identifies who should  |
  397. |                        delete the item(s).                                   |
  398. |   setWhoDiscards     - Set the discard indicator.  IDM::sourceDiscards is    |
  399. |                        the default.                                          |
  400. ------------------------------------------------------------------------------*/
  401. IDMSourceOperation::Handle
  402.   sourceOperation       ( ) const;
  403.  
  404. virtual DiscardIndicator
  405.   whoDiscards           ( ) const;
  406.  
  407. IDMSourceDiscardEvent
  408.  &setSourceOperation    ( const IDMSourceOperation::Handle &operation ),
  409.  &setWhoDiscards        ( DiscardIndicator                 indicator );
  410.  
  411. protected:
  412. private: /*------------------------ PRIVATE ----------------------------------*/
  413.  
  414. IDMSourceOperation::Handle
  415.   pSrcOpH;
  416.  
  417. DiscardIndicator
  418.   discardInd;
  419.  
  420. }; // IDMSourceDiscardEvent
  421.  
  422.  
  423. class IDMSourcePrintEvent : public IDMEvent {
  424. typedef IDMEvent
  425.   Inherited;
  426. typedef IDM::PrintIndicator
  427.   PrintIndicator;
  428. /*******************************************************************************
  429. * Events of this class are sent to the source window when the dragged objects  *
  430. * are dropped on a printer object.  The event essentially returns an           *
  431. * indicator to the target identifying who has responsibility for printing      *
  432. * the item(s) or an indicator that aborts the print operation.                 *
  433. *******************************************************************************/
  434. public:
  435. /*------------------------- Constructors/Destructor ----------------------------
  436. | Objects of this class are constructed from generic IEvent objects.           |
  437. ------------------------------------------------------------------------------*/
  438.   IDMSourcePrintEvent     ( const IEvent &event );
  439.  
  440. virtual
  441.   ~IDMSourcePrintEvent    ( );
  442.  
  443. /*-------------------------------- Accessors -----------------------------------
  444. | These functions provide access to attributes of instances of this class:     |
  445. |   sourceOperation    - Returns the source operation for this event.          |
  446. |   setSourceOperation - Sets the source operation for this event.             |
  447. |   whoPrints          - Returns print indicator that identifies who should    |
  448. |                        print the item(s).                                    |
  449. |   setWhoPrints       - Set the print indicator.  IDM::sourcePrints is        |
  450. |                        the default.                                          |
  451. |   printDestination   - Returns pointer to the print destination for this     |
  452. |                        event.                                                |
  453. ------------------------------------------------------------------------------*/
  454. IDMSourceOperation::Handle
  455.   sourceOperation       ( ) const;
  456.  
  457. virtual PrintIndicator
  458.   whoPrints             ( ) const;
  459.  
  460. IDMSourcePrintEvent
  461.  &setSourceOperation    ( const IDMSourceOperation::Handle &operation ),
  462.  &setWhoPrints          ( PrintIndicator                   indicator );
  463.  
  464. _PRINTDEST
  465.  *printDestination      ( ) const;
  466.  
  467. protected:
  468. private: /*------------------------ PRIVATE ----------------------------------*/
  469.  
  470. IDMSourceOperation::Handle
  471.   pSrcOpH;
  472.  
  473. PrintIndicator
  474.   printInd;
  475.  
  476. }; // IDMSourcePrintEvent
  477.  
  478.  
  479. class IDMTargetEnterEvent : public IDMEvent {
  480. typedef IDMEvent
  481.   Inherited;
  482. typedef IDM::DropIndicator
  483.   DropIndicator;
  484. /*******************************************************************************
  485. * Instances of this class encapsulate direct manipulation events that          *
  486. * occur at the target handler when a drag operation enters a potential         *
  487. * target window.  Target handlers access information about the dragged         *
  488. * items from the associated IDMTargetOperation object                          *
  489. *                                                                              *
  490. * The event result field is of particular importance for these event objects.  *
  491. * The result will indicate whether the dragged object(s) can be dropped on     *
  492. * this target, and if so, what the default operation would be.  This class     *
  493. * provides specialized functions to set the components of the event result.    *
  494. *******************************************************************************/
  495. public:
  496. /*------------------------- Constructors/Destructor ----------------------------
  497. | Objects of this class are constructed from generic IEvent objects.           |
  498. ------------------------------------------------------------------------------*/
  499.   IDMTargetEnterEvent     ( const IEvent &event );
  500.  
  501. virtual
  502.   ~IDMTargetEnterEvent    ( );
  503.  
  504. /*--------------------------------- Accessors ----------------------------------
  505. | These functions provide means of getting and setting the accessible          |
  506. | attributes of instances of this class:                                       |
  507. |   position - Returns the pointing device position.                           |
  508. ------------------------------------------------------------------------------*/
  509. virtual IPoint
  510.   position    ( ) const;
  511.  
  512. /*---------------------------------- Result ------------------------------------
  513. | These functions provide means of querying and setting the components of      |
  514. | the event result:                                                            |
  515. |   dropIndicator       - Returns indicator of whether drop is allowed.        |
  516. |   setDropIndicator    - Sets indicator of whether drop is allowed.           |
  517. |   defaultOperation    - Returns the default operation for this target.       |
  518. |   setDefaultOperation - Sets the default operation for this target.          |
  519. ------------------------------------------------------------------------------*/
  520. virtual DropIndicator
  521.   dropIndicator        ( ) const;
  522.  
  523. virtual unsigned long
  524.   defaultOperation     ( ) const;
  525.  
  526. IDMTargetEnterEvent
  527.  &setDropIndicator     ( DropIndicator  indicator ),
  528.  &setDefaultOperation  ( unsigned long  operation );
  529.  
  530. /*---------------------------- Container Support ------------------------------+
  531. | These methods provide a means of getting and setting the container           |
  532. | attributes of instances of this class:                                       |
  533. |   isDragAfter   - Queries whether the event is a drag-after or drag-over     |
  534. |                   event.                                                     |
  535. |   isAboveFirst  - Queries whether drag-after has occurred above the first    |
  536. |                   object in the list.                                        |
  537. |   containerId   - Returns the target container's ID.                         |
  538. |   object        - Returns a pointer to the object over which the drag-after  |
  539. |                   or drag-over event occurred.  Returns 0 if drag was        |
  540. |                   over container "white space" or if non-container window.   |
  541. |   container     - Returns a pointer to the container where the drag-after    |
  542. |                   or drag-over event occurred.                               |
  543. +-----------------------------------------------------------------------------*/
  544. virtual Boolean
  545.   isDragAfter     ( ) const,
  546.   isAboveFirst    ( ) const;
  547.  
  548. virtual unsigned long
  549.   containerId     ( ) const;
  550.  
  551. virtual IContainerObject
  552.  *object          ( ) const;
  553.  
  554. virtual IContainerControl
  555.  *container       ( ) const;
  556.  
  557.  
  558. protected:
  559. private: /*------------------------ PRIVATE ----------------------------------*/
  560.  
  561. DropIndicator
  562.   dropInd;
  563.  
  564. unsigned long
  565.   op;
  566.  
  567. }; // IDMTargetEnterEvent
  568.  
  569.  
  570. class IDMTargetLeaveEvent : public IDMEvent {
  571. typedef IDMEvent
  572.   Inherited;
  573. /*******************************************************************************
  574. * Events of this class are sent to the target window when either the dragged   *
  575. * objects leave the window or the operation is terminated while the objects    *
  576. * are over the window.                                                         *
  577. *******************************************************************************/
  578. public:
  579. /*------------------------- Constructors/Destructor ----------------------------
  580. | Objects of this class are constructed from generic IEvent objects.           |
  581. ------------------------------------------------------------------------------*/
  582.   IDMTargetLeaveEvent     ( const IEvent &event );
  583.  
  584. virtual
  585.   ~IDMTargetLeaveEvent    ( );
  586.  
  587. protected:
  588. private: /*------------------------ PRIVATE ----------------------------------*/
  589. }; // IDMTargetLeaveEvent
  590.  
  591.  
  592. class IDMTargetDropEvent : public IDMEvent {
  593. typedef IDMEvent
  594.   Inherited;
  595. /*******************************************************************************
  596. * Instances of this class encapsulate direct manipulation events that          *
  597. * occur at the target handler when a drop occurs on a target window.           *
  598. * Target handlers access information about the dragged items from the          *
  599. * stored IDMTargetOperation object that was created as part of the             *
  600. * IDMTargetEnterEvent processing.                                              *
  601. *******************************************************************************/
  602. public:
  603. /*------------------------- Constructors/Destructor ----------------------------
  604. | Objects of this class are constructed from generic IEvent objects.           |
  605. ------------------------------------------------------------------------------*/
  606.   IDMTargetDropEvent     ( const IEvent &event );
  607.  
  608. virtual
  609.   ~IDMTargetDropEvent    ( );
  610.  
  611. /*--------------------------------- Accessors ----------------------------------
  612. | These functions provide means of getting and setting the accessible          |
  613. | attributes of instances of this class:                                       |
  614. |   dropPosition     - Returns the position, expressed in desktop coordinates, |
  615. |                      where the drop occurred.                                |
  616. |   setDropPosition  - Sets the position, expressed in desktop coordinates,    |
  617. |                      where the drop occurred.                                |
  618. |   targetInfo       - Returns the target-defined "information."               |
  619. |   setTargetInfo    - Can be used to pass information to the target           |
  620. ------------------------------------------------------------------------------*/
  621. virtual IPoint
  622.   dropPosition       ( ) const;
  623.  
  624. virtual unsigned long
  625.   targetInfo         ( ) const;
  626.  
  627. virtual IDMTargetDropEvent
  628.  &setDropPosition    ( const IPoint  &position ),
  629.  &setTargetInfo      ( unsigned long info );
  630.  
  631. /*----------------------------- Container Support ------------------------------
  632. | These functions provide drop support for the container drop event:           |
  633. |   containerId  - Returns the target container's ID.                          |
  634. |   object       - Returns a pointer to the object over which the drop-on      |
  635. |                  event occurred.  Returns 0 if drop was on container         |
  636. |                  "white space" or non-container window.                      |
  637. |   container    - Returns a pointer to the container where the drop-on        |
  638. |                  event occurred.                                             |
  639. ------------------------------------------------------------------------------*/
  640. virtual unsigned long
  641.   containerId     ( ) const;
  642.  
  643. virtual IContainerObject
  644.  *object          ( ) const;
  645.  
  646. virtual IContainerControl
  647.  *container       ( ) const;
  648.  
  649.  
  650. protected:
  651. private: /*------------------------ PRIVATE ----------------------------------*/
  652.  
  653. IPoint
  654.   pos;
  655.  
  656. unsigned long
  657.   ulTgtInfo;
  658.  
  659. }; // IDMTargetDropEvent
  660.  
  661.  
  662. class IDMTargetHelpEvent : public IDMEvent {
  663. typedef IDMEvent
  664.   Inherited;
  665. /*******************************************************************************
  666. * Events of this class are sent to the target window when help is requested    *
  667. * while the objects are over the window.                                       *
  668. *******************************************************************************/
  669. public:
  670. /*------------------------- Constructors/Destructor ----------------------------
  671. | Objects of this class are constructed from generic IEvent objects.           |
  672. ------------------------------------------------------------------------------*/
  673.   IDMTargetHelpEvent     ( const IEvent &event );
  674.  
  675. virtual
  676.   ~IDMTargetHelpEvent    ( );
  677.  
  678.  
  679. /*--------------------------------- Accessors ----------------------------------
  680. | This function provides means of getting the accessible attributes of         |
  681. | instances of this class:                                                     |
  682. |   operation - Returns the operation (i.e. move, copy, or link) which can be  |
  683. |               used to provide help in the context of the drag operation.     |
  684. ------------------------------------------------------------------------------*/
  685. virtual unsigned long
  686.   operation    ( ) const;
  687.  
  688. protected:
  689. private: /*------------------------ PRIVATE ----------------------------------*/
  690. }; // IDMTargetHelpEvent
  691.  
  692.  
  693. class IDMTargetEndEvent : public IDMEvent {
  694. typedef IDMEvent
  695.   Inherited;
  696. /*******************************************************************************
  697.   These events occur when the source window has completed rendering of a
  698.   given drag item, and has indicated so to the target.  The event provides
  699.   source window information about the item rendering results.
  700. *******************************************************************************/
  701. public:
  702. /*------------------------- Constructors/Destructor ----------------------------
  703. | Objects of this class are constructed from generic IEvent objects.           |
  704. ------------------------------------------------------------------------------*/
  705.   IDMTargetEndEvent     ( const IEvent &event );
  706.  
  707. virtual
  708.   ~IDMTargetEndEvent    ( );
  709.  
  710.  
  711. /*--------------------------------- Accessors ----------------------------------
  712. | This function provides means of getting and setting the accessible           |
  713. | attributes of instances of this class:                                       |
  714. |   dragItem                 - Returns handle of the drag item that source has |
  715. |                              completed renderering.                          |
  716. |   alternateWindow          - Returns a pointer to the alternate source       |
  717. |                              window.                                         |
  718. |   alternateWindowHandle    - Returns the handle of the alternate source      |
  719. |                              window.                                         |
  720. |   targetInfo               - Returns the target-defined "information."       |
  721. ------------------------------------------------------------------------------*/
  722. virtual IDMItem::Handle
  723.   dragItem                 ( ) const;
  724.  
  725. virtual IWindow
  726.  *alternateWindow          ( ) const;
  727.  
  728. virtual IWindowHandle
  729.   alternateWindowHandle    ( ) const;
  730.  
  731. virtual unsigned long
  732.   targetInfo               ( ) const;
  733.  
  734. /*---------------------------------- Result ------------------------------------
  735. | These functions provide access to rendering result information returned      |
  736. | by the source window:                                                        |
  737. |   renderingFailed - Source is unable to perform the rendering operation.     |
  738. |                     The target may be allowed to retry, but if it            |
  739. |                     chooses not to, it must call informSourceOfCompletion()  |
  740. |                     to end the operation.                                    |
  741. |   targetCanRetry  - Source has completed the rendering operation and will    |
  742. |                     allow the target to retry its part of the operation      |
  743. |                     if it fails.                                             |
  744. ------------------------------------------------------------------------------*/
  745. Boolean
  746.   renderingFailed    ( ) const,
  747.   targetCanRetry     ( ) const;
  748.  
  749. protected:
  750. private: /*------------------------ PRIVATE ----------------------------------*/
  751.  
  752. IDMItem::Handle
  753.   targetItemFromPM (_DRAGITEM *pDragItem);
  754.  
  755. IDMItem::Handle
  756.   pDMTgtItemHandle;
  757.  
  758. unsigned long
  759.   usCompletion;
  760.  
  761. _DRAGTRANSFER
  762.  *pPMDragTransfer;
  763.  
  764. _DRAGTRANSFER
  765.   *dragTransfer() const;
  766.  
  767. }; // IDMTargetEndEvent
  768.  
  769. /*----------------------------------------------------------------------------*/
  770. /* Resume compiler default packing.                                           */
  771. /*----------------------------------------------------------------------------*/
  772. #pragma pack()
  773.  
  774. #ifndef I_NO_INLINES
  775.   #include <idmevent.inl>
  776. #endif
  777.  
  778. #endif //_IDMEVENT_
  779.