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

  1. #ifndef _IDMMLEIT_
  2. #define _IDMMLEIT_
  3. /*******************************************************************************
  4.   FILE NAME: idmmleit.hpp
  5.  
  6.   DESCRIPTION:
  7.     This file contains the declaration(s) of the class(es):
  8.       IDMMLEItem       - Direct manipulation entry field item class.
  9.       IDMMLEItemHandle - Handle to manage references to IDMMLEItem objects.
  10.  
  11.   COPYRIGHT:
  12.     Licensed Materials - Property of IBM
  13.     (C) Copyright IBM Corporation 1992, 1993
  14.     All Rights Reserved
  15.     US Government Users Restricted Rights - Use, duplication, or
  16.     disclosure
  17.     restricted by GSA ADP Schedule Contract with IBM Corp.
  18.  
  19. * $Log:   M:/ibmclass/idrag/vcs/idmmleit.hpv  $
  20. //
  21. //   Rev 1.4   02 Sep 1993 13:21:04   banzai
  22. //Interface changes per container
  23. //
  24. //   Rev 1.3   28 Aug 1993 15:53:02   banzai
  25. //Move part of rendering/drop logic into IDMItem
  26. //
  27. //   Rev 1.2   19 Aug 1993 17:17:56   HAGGAR
  28. //IMultiLineEdit support
  29. //
  30. //   Rev 1.1   12 Aug 1993 13:52:54   banzai
  31. //Merge source and target item into one
  32. //
  33. //   Rev 1.0   10 Aug 1993 15:21:28   banzai
  34. //Make drag item provider into template
  35. //
  36. *******************************************************************************/
  37. #ifndef _IDMITEM_
  38.   #include <idmitem.hpp>
  39. #endif
  40.  
  41. /* Forward Declarations */
  42.  
  43.  
  44. class IDMMLEItem : public IDMItem {
  45. typedef IDMItem
  46.   Inherited;
  47. /*******************************************************************************
  48. * Objects of this class are created by windows when a direct manipulation      *
  49. * text operation commences on the source side.                                 *
  50. *                                                                              *
  51. * Objects of this class possess the following attributes (in addition to       *
  52. * those inherited from its base class):                                        *
  53. *   o association with a source drag operation object (see                     *
  54. *     IDMSourceOperation)                                                      *
  55. *   o association(s) with derived source renderer object(s) capable of         *
  56. *     renderering text (see IDMISSrcRenderer) which are created by the         *
  57. *     source handler (see IDMSourceHandler)                                    *
  58. *                                                                              *
  59. * This class provides virtual functions that implement the source rendering    *
  60. * of the dragged/dropped objects.  Derived classes are created to support      *
  61. * additional rendering mechanisms and/or formats.  The IDMMLEItem              *
  62. * class supports, in conjunction with the standard library IWindow subclasses, *
  63. * rendering with all the standard system rendering mechanisms whenever such    *
  64. * rendering makes sense.                                                       *
  65. *******************************************************************************/
  66.  
  67. public:
  68.  
  69. /*------------------------- Constructors/Destructor ----------------------------
  70. | Objects of this class are constructed in the following manner:               |
  71. |   o By providing the drag source operation handle, types, supported          |
  72. |     operations and attributes.                                               |
  73. |   o By providing a pointer to a target drag item.                            |
  74. ------------------------------------------------------------------------------*/
  75.   IDMMLEItem     ( const IDMSrcOperationHandle &sourceOperation,
  76.                     const IString &types,
  77.                     const unsigned short supportedOperations = unknown );
  78.  
  79.   IDMMLEItem     ( IDMItem &dragItem );
  80.  
  81. virtual
  82.   ~IDMMLEItem    ( );
  83.  
  84.  
  85. /*------------------------------ Source Items ----------------------------------
  86. | This function generates source items:                                        |
  87. |   generateSourceItems - Generates text items based upon data in the          |
  88. |                         source text control window.                          |
  89. ------------------------------------------------------------------------------*/
  90. static Boolean
  91.   generateSourceItems    ( const IDMSrcOperationHandle &sourceOperation );
  92.  
  93. /*------------------------------ Source Rendering ------------------------------
  94. | This function reads data from source window:                                 |
  95. |   renderPrepare - Acquires text from entry field and stores in drag item.    |
  96. ------------------------------------------------------------------------------*/
  97. virtual Boolean
  98.   renderPrepare    ( IDMSourcePrepareEvent &event );
  99.  
  100. /*-------------------------------- Accessors -----------------------------------
  101. | These functions provide access to generic text per a text oriented direct    |
  102. | manipulation operation:                                                      |
  103. |   text           - Returns the drag item text.                               |
  104. |   size           - Returns the size of the drag item text.                   |
  105. ------------------------------------------------------------------------------*/
  106. virtual IString
  107.   text             ( ) const;
  108.  
  109. virtual unsigned
  110.   size             ( ) const;
  111.  
  112. /*------------------------------ Drop Processing -------------------------------
  113. | This function writes data to the target window:                              |
  114. |   dropped - Writes text into entry field from drag item.                     |
  115. ------------------------------------------------------------------------------*/
  116. virtual Boolean
  117.   dropped    ( IWindow *mle, IDMTargetDropEvent & );
  118.  
  119. protected:
  120. /*-----------------------  Rendering Mechanisms/Formats  -----------------------
  121. | These functions provide means for setting the "RMF" of the drag item:        |
  122. |   buildRMF  - builds a rendering mechanism and format (RMF) string.  This    |
  123. |               function is an overloaded version of the one provided as part  |
  124. |               of the IDMItem class.                                          |
  125. ------------------------------------------------------------------------------*/
  126. IString
  127.   buildRMF    ( const IString &mechanism, const IString &format );
  128.  
  129. private: /*------------------------ PRIVATE ----------------------------------*/
  130.  
  131. }; // IDMMLEItem
  132.  
  133.  
  134. class IDMMLEItemHandle : public IReference< IDMMLEItem > {
  135. /*******************************************************************************
  136. * Objects of this class provide access to IDMMLEItem objects                   *
  137. * associated with a direct manipulation event.  This "handle" class manages    *
  138. * references to the IDMMLEItem object to ensure that it is not                 *
  139. * deleted until the drag operation is completed.                               *
  140. *                                                                              *
  141. * This class provides a "->" operator that enables instances to be treated     *
  142. * just like a pointer to an IDMMLEItem object.                                 *
  143. *                                                                              *
  144. * Example:                                                                     *
  145. *                                                                              *
  146. * This class has no members.  It is essentially a synonym for the type         *
  147. * IReference< IDMMLEItem >.                                                    *
  148. *******************************************************************************/
  149. public:
  150.   IDMMLEItemHandle  ( IDMMLEItem *mleItem );
  151.   ~IDMMLEItemHandle ( );
  152.  
  153. /*--------------------------------- Operators ---------------------------------+
  154. | Operators defined for IDMMLEItemHandle:                                      |
  155. |   =  - Overload definition to handle assignments of MLE item pointers to     |
  156. |        MLE item handles.                                                     |
  157. +-----------------------------------------------------------------------------*/
  158. IDMMLEItemHandle
  159.  &operator = ( IDMMLEItem *mleItem );
  160.  
  161. }; // IDMMLEItemHandle
  162.  
  163.  
  164. /*******************************************************************************
  165. * Objects of this class are created by windows when a direct manipulation      *
  166. * text operation enters a potential target.                                    *
  167. *                                                                              *
  168. * Objects of this class possess the following attributes (in addition to       *
  169. * those inherited from its base class):                                        *
  170. *   o association with a target drag operation object (see                     *
  171. *     IDMTargetOperation)                                                      *
  172. *   o association(s) with derived target renderer object(s) capable of         *
  173. *     renderering text (see IDMISTgtRenderer) which are created by the         *
  174. *     target handler (see IDMTargetHandler)                                    *
  175. *                                                                              *
  176. * This class provides virtual functions that implement the source rendering    *
  177. * of the dragged/dropped objects.  Derived classes are created to support      *
  178. * additional rendering mechanisms and/or formats.  The IDMTextTgtItem          *
  179. * class supports, in conjunction with the standard library IWindow subclasses, *
  180. * rendering with all the standard system rendering mechanisms whenever such    *
  181. * rendering makes sense.                                                       *
  182. *******************************************************************************/
  183.  
  184. /*******************************************************************************
  185. * Objects of this class provide access to IDMTextTgtItem objects               *
  186. * associated with a direct manipulation event.  This "handle" class manages    *
  187. * references to the IDMTextTgtItem object to ensure that it is not             *
  188. * deleted until the drag operation is completed.                               *
  189. *                                                                              *
  190. * This class provides a "->" operator that enables instances to be treated     *
  191. * just like a pointer to an IDMTextTgtItem object.                             *
  192. *                                                                              *
  193. * Example:                                                                     *
  194. *                                                                              *
  195. * This class has no members.  It is essentially a synonym for the type         *
  196. * IReference< IDMTextTgtItem >.                                                *
  197. *******************************************************************************/
  198.  
  199. #ifndef I_NO_INLINES
  200.   #include <idmmleit.inl>
  201. #endif
  202.  
  203. #endif // _IDMMLEIT_
  204.