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

  1. #ifndef _IDMSRCRN_
  2. #define _IDMSRCRN_
  3. /*******************************************************************************
  4. * FILE NAME: idmsrcrn.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the declaration(s) of the class(es):                    *
  8. *     IDMSourceRenderer - Direct manipulation source renderer class.           *
  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               *
  15. *   disclosure                                                                 *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. *******************************************************************************/
  19. #ifndef _IDMRENDR_
  20.   #include <idmrendr.hpp>
  21. #endif
  22.  
  23. #ifndef _ISTRING_
  24.   #include <istring.hpp>
  25. #endif
  26.  
  27. /*----------------------------------------------------------------------------*/
  28. /* Align classes on four byte boundary.                                       */
  29. /*----------------------------------------------------------------------------*/
  30. #pragma pack(4)
  31.  
  32. /* Forward Declarations */
  33. struct  _DRAGTRANSFER;
  34. class   IDMSourceRenderEvent;
  35. class   IDMSourcePrepareEvent;
  36. class   IDMSourceEndEvent;
  37. class   IDMSourceDiscardEvent;
  38. class   IDMSourcePrintEvent;
  39.  
  40.  
  41. class IDMSourceRenderer : public IDMRenderer {
  42. typedef IDMRenderer
  43.   Inherited;
  44. /*******************************************************************************
  45. * Objects of this class provide source rendering support for a direct          *
  46. * manipulation operation.  Instances of this class are registered with the     *
  47. * source handler.  The handler selects a "best match" renderer for a given     *
  48. * drag item and invokes the rendering functions of this renderer when source   *
  49. * rendering events occur.                                                      *
  50. *******************************************************************************/
  51. public:
  52. /*------------------------ Constructors/Destructor -----------------------------
  53. | Objects of this class are constructed in the following manner:               |
  54. |   o By providing rmfs and types which indicates which drag item can be       |
  55. |     rendered by this source renderer.                                        |
  56. |   o No arguments.                                                            |
  57. ------------------------------------------------------------------------------*/
  58.   IDMSourceRenderer     ( const char *rmfs, const char *type = IDM::any );
  59.  
  60.   IDMSourceRenderer     ( );
  61.  
  62. virtual
  63.   ~IDMSourceRenderer    ( );
  64.  
  65. /*--------------------------------- Testing ------------------------------------
  66. | This function tests whether a given item can be rendered:                    |
  67. |   canRender - Returns true if the renderer can render items with the         |
  68. |               argument attribute.   Used when the drag is initiated.         |
  69. ------------------------------------------------------------------------------*/
  70. virtual Boolean
  71.   canRender    ( const IString  &types );
  72.  
  73. /*-------------------------------- Rendering -----------------------------------
  74. | The following functions perform rendering operations:                        |
  75. |   sourceRender  - Called when the target renderer requests that a source     |
  76. |                   renderer render an item.                                   |
  77. |   sourcePrepare - Called when an item indicates that it requires preparation.|
  78. |   sourceEnd     - Called when the target window informs the source window    |
  79. |                   that it has finished processing the data that was          |
  80. |                   associated with the dropped item.                          |
  81. |   sourceDiscard - Called by the IDMSourceHandler::sourceDiscard()            |
  82. |                   function when it was indicated that the source window has  |
  83. |                   responsibility for discarding the item.                    |
  84. |   sourcePrint   - Called by the IDMSourceHandler::sourcePrint()              |
  85. |                   function when it was indicated that the source window has  |
  86. |                   responsibility for printing the item.                      |
  87. ------------------------------------------------------------------------------*/
  88. virtual IDMSourceRenderer
  89.  &sourceRender     ( IDMSourceRenderEvent  &event ),
  90.  &sourcePrepare    ( IDMSourcePrepareEvent &event ),
  91.  &sourceEnd        ( IDMSourceEndEvent     &event ),
  92.  &sourceDiscard    ( IDMSourceDiscardEvent &event ),
  93.  &sourcePrint      ( IDMSourcePrintEvent   &event );
  94.  
  95. /*---------------------------- Rendering Completion ----------------------------
  96. | The following function is called when the rendering operation is complete:   |
  97. |   informTargetOfCompletion - Informs the target window that source           |
  98. |                              renderering has completed on the drag item.     |
  99. ------------------------------------------------------------------------------*/
  100. virtual IDMSourceRenderer
  101.  &informTargetOfCompletion    ( IDMSourceRenderEvent  &event );
  102.  
  103. protected:
  104. /*------------------------------ Implementation --------------------------------
  105. | The following functions provide utilities used to implement the IDMRenderer  |
  106. | class:                                                                       |
  107. |   doRender        - Called when a render event occurs and this renderer must |
  108. |                     render a drag item.                                      |
  109. |   doRenderPrepare - Called when a render prepare event occurs and this       |
  110. |                     renderer must render a drag item.                        |
  111. |   doRenderEnd     - Called when an end event occurs and this renderer must   |
  112. |                     end the render operation.                                |
  113. |   doDiscard       - Called when a discard event occurs and this renderer     |
  114. |                     must discard a drag item.                                |
  115. |   doPrint         - Called when a print event occurs and this renderer       |
  116. |                     must print a drag item.                                  |
  117. ------------------------------------------------------------------------------*/
  118. virtual Boolean
  119.   doRender            ( IDMSourceRenderEvent  &event );
  120.   doRenderPrepare     ( IDMSourcePrepareEvent &event ),
  121.   doRenderEnd         ( IDMSourceEndEvent     &event ),
  122.   doDiscard           ( IDMSourceDiscardEvent &event ),
  123.   doPrint             ( IDMSourcePrintEvent   &event );
  124.  
  125. private: /*------------------------ PRIVATE ----------------------------------*/
  126.  
  127. _DRAGTRANSFER
  128.  *pPMDragTransfer;
  129.  
  130. }; // class IDMSourceRenderer
  131.  
  132. /*----------------------------------------------------------------------------*/
  133. /* Resume compiler default packing.                                           */
  134. /*----------------------------------------------------------------------------*/
  135. #pragma pack()
  136.  
  137. #endif // _IDMSRCRN_
  138.