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

  1. #ifndef _IDMISRND_
  2.   #define _IDMISRND_
  3. /*******************************************************************************
  4. * FILE NAME: idmisrnd.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *                  window.                                                     *
  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 disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. * $Log:   M:/ibmclass/idrag/vcs/idmisrnd.hpv  $
  18. //
  19. //   Rev 1.8   02 Sep 1993 13:21:18   banzai
  20. //Interface changes per container
  21. //
  22. //   Rev 1.7   01 Sep 1993 13:18:56   banzai
  23. //Fix compiler warnings
  24. //
  25. //   Rev 1.6   28 Aug 1993 15:52:50   banzai
  26. //Move part of rendering/drop logic into IDMItem
  27. //
  28. //   Rev 1.5   14 Aug 1993 08:48:26   banzai
  29. //Override selectOperation
  30. //
  31. //   Rev 1.4   12 Aug 1993 13:52:42   banzai
  32. //Merge source and target item into one
  33. //
  34. //   Rev 1.3   10 Aug 1993 15:20:04   banzai
  35. //Make drag item provider into template
  36. //
  37. //   Rev 1.2   02 Aug 1993 15:27:50   HAGGAR
  38. //more rendering changes
  39. //
  40. //   Rev 1.1   26 Jul 1993 19:25:56   banzai
  41. //Design changes per prv/item/rndr
  42. //
  43. //   Rev 1.0   23 Jul 1993 09:28:18   banzai
  44. //Initial version
  45. //
  46. *******************************************************************************/
  47. #ifndef _IDMRNDR_
  48.   #include <idmrendr.hpp>
  49. #endif
  50.  
  51. /* Shared buffer name */
  52. #define IISBuffer "\\SHAREMEM\\IISBuffer.mem"
  53.  
  54. // Forward declarations for other classes:
  55. class IString;
  56.  
  57.  
  58. class IDMISSrcRenderer : public IDMSourceRenderer {
  59. typedef IDMSourceRenderer
  60.   Inherited;
  61. /*******************************************************************************
  62. * The IDMISSrcRenderer class handles source direct manipulation rendering for  *
  63. * objects capable of being represented by IString.                             *
  64. *                                                                              *
  65. * EXAMPLE:                                                                     *
  66. *   IDMISSrcRenderer srcRenderer;                                              *
  67. *                                                                              *
  68. *******************************************************************************/
  69.  
  70. public:
  71.  
  72. /*------------------------ Constructors ----------------------------------------
  73. | Objects of this class are constructed in the following manner:               |
  74. |   o By providing a type which indicates which drag item can be rendered      |
  75. |     by this renderer.                                                        |
  76. ------------------------------------------------------------------------------*/
  77.   IDMISSrcRenderer     ( const IString &type );
  78.  
  79. virtual
  80.   ~IDMISSrcRenderer    ( );
  81.  
  82.  
  83. /*--------------------------------- Testing ------------------------------------
  84. | This function is used to test whether a given item can be rendered:          |
  85. |   canRender - Returns true if this renderer can render items with the        |
  86. |               argument attribute(s).                                         |
  87. ------------------------------------------------------------------------------*/
  88. Boolean
  89.   canRender    ( const IString  &types ),
  90.   canRender    ( const IString  &selectedType,
  91.                  const IString  &selectedRMF,
  92.                  unsigned short selectedOp );
  93.  
  94. /*-------------------------------- Overrides -----------------------------------
  95. | This class overrides the following inherited functions:                      |
  96. |   renderPrepare - Called to indicate that the IString object requires source |
  97. |                   preparation prior to rendering.                            |
  98. |   render        - Called to indicate that the IString source renderer is to  |
  99. |                   render an item.                                            |
  100. |   renderEnd     - Called to indicate that the target has finished processing |
  101. |                   an IString object                                          |
  102. ------------------------------------------------------------------------------*/
  103. Boolean
  104.   renderPrepare    ( IDMSourcePrepareEvent &event ),
  105.   render           ( IDMSourceRenderEvent  &event ),
  106.   renderEnd        ( IDMSourceEndEvent     &event );
  107.  
  108. protected:
  109.  
  110. private:
  111. /*--------------------------------- PRIVATE ----------------------------------*/
  112.  
  113. };  // class IDMISSrcRenderer
  114.  
  115.  
  116. class IDMISTgtRenderer : public IDMTargetRenderer {
  117. typedef IDMTargetRenderer
  118.   Inherited;
  119. /*******************************************************************************
  120. * The IDMISTgtRenderer class handles target direct manipulation rendering for  *
  121. * objects capable of being represented by IString.                             *
  122. *                                                                              *
  123. * EXAMPLE:                                                                     *
  124. *   IDMISTgtRenderer tgtRenderer;                                              *
  125. *                                                                              *
  126. *******************************************************************************/
  127.  
  128. public:
  129.  
  130. /*------------------------ Constructors ----------------------------------------
  131. | Objects of this class are constructed in the following manner:               |
  132. |   o By providing a type which indicates which drag item can be rendered      |
  133. |     by this renderer.                                                        |
  134. ------------------------------------------------------------------------------*/
  135.   IDMISTgtRenderer     ( const IString &type );
  136.  
  137. virtual
  138.   ~IDMISTgtRenderer    ( );
  139.  
  140.  
  141. /*--------------------------------- Testing ------------------------------------
  142. | This function is used to test whether a given item can be rendered:          |
  143. |   canRender       - Returns drop indicator per the renderers ability to      |
  144. |                     render the item with the argument attributes.            |
  145. |   selectOperation - Returns true if the default operation (i.e. move, copy   |
  146. |                     or link) is supported by the item.  If the operation set |
  147. |                     by the source is IDMOperation::drag, the default         |
  148. |                     operation we support will be copy.  If the operation     |
  149. |                     value defined by the source is > IDMOperation::unknown,  |
  150. |                     we will ignore and return false.  Otherwise, we'll use   |   |
  151. |                     the operation the source indicated if the item supports  |
  152. |                     it.                                                      |
  153. ------------------------------------------------------------------------------*/
  154. DropIndicator
  155.   canRender          ( const IString               &types ),
  156.   canRender          ( const IDMTgtOperationHandle targetOperation,
  157.                        const IString               &aType,
  158.                        const IString               &sourceRMFs,
  159.                        unsigned short              supportedOps );
  160.  
  161. virtual Boolean
  162.   selectOperation    ( const IDMTgtOperationHandle targetOperation,
  163.                        unsigned short              supportedOps );
  164.  
  165. /*-------------------------------- Accessors -----------------------------------
  166. | This function provides access to attributes of instances of this class:      |
  167. |   dataBuffer - returns the data buffer used to transfer the data.            |
  168. ------------------------------------------------------------------------------*/
  169. static void
  170.  *dataBuffer    ( );
  171.  
  172. /*-------------------------------- Overrides -----------------------------------
  173. | This class overrides the following inherited functions:                      |
  174. |   renderAtSource           - Called to indicate that a target window         |
  175. |                              has been dropped on and source rendering        |
  176. |                              is requested                                    |
  177. |   prepareAtSource          - Called to indicate that a target window         |
  178. |                              has been dropped on and source rendering        |
  179. |                              preparation is requested                        |
  180. |   renderComplete           - Called to indicate that the source has          |
  181. |                              completed its render operation.                 |
  182. |   renderToName             - Called so the target can provide the source     |
  183. |                              with the "render-to" name.                      |
  184. ------------------------------------------------------------------------------*/
  185. Boolean
  186.   renderAtSource     ( IDMTargetDropEvent  &event ),
  187.   prepareAtSource    ( IDMTargetDropEvent  &event ),
  188. //renderComplete     ( IDMTargetEndEvent   &event );
  189.   renderComplete     ( const IDMItemHandle &dragItem );
  190.  
  191. IString
  192.   renderToName       ( const IDMItemHandle &dragItem );
  193.  
  194. protected:
  195.  
  196. /*-------------------------------- Accessors -----------------------------------
  197. | This function provides access to attributes of instances of this class:      |
  198. |   setDataBuffer - sets the data buffer used to transfer the data.                 |
  199. ------------------------------------------------------------------------------*/
  200. IDMISTgtRenderer
  201.  &setDataBuffer    ( void *data );
  202.  
  203. private:
  204. /*--------------------------------- PRIVATE ----------------------------------*/
  205.  
  206. static void
  207.  *pBuf;
  208.  
  209. };  // class IDMISTgtRenderer
  210.  
  211. #endif  /* _IDMISRND_ */
  212.