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

  1. #ifndef _IDMEFIT_
  2. #define _IDMEFIT_
  3. /*******************************************************************************
  4.   FILE NAME: idmefit.hpp
  5.  
  6.   DESCRIPTION:
  7.     This file contains the declaration(s) of the class(es):
  8.       IDMEFItem       - Direct manipulation entry field item class.
  9.       IDMEFItemHandle - Handle to manage references to IDMEFItem 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/idmefit.hpv  $
  20. //
  21. //   Rev 1.5   02 Sep 1993 13:21:00   banzai
  22. //Interface changes per container
  23. //
  24. //   Rev 1.4   28 Aug 1993 15:52:34   banzai
  25. //Move part of rendering/drop logic into IDMItem
  26. //
  27. //   Rev 1.3   19 Aug 1993 10:35:02   banzai
  28. //Prose changes
  29. //
  30. //   Rev 1.2   17 Aug 1993 15:38:04   HAGGAR
  31. //changes due to new design
  32. //
  33. //   Rev 1.1   12 Aug 1993 13:52:24   banzai
  34. //Merge source and target item into one
  35. //
  36. //   Rev 1.0   10 Aug 1993 15:20:56   banzai
  37. //Make drag item provider into template
  38. //
  39. *******************************************************************************/
  40. #ifndef _IDMITEM_
  41.   #include <idmitem.hpp>
  42. #endif
  43.  
  44. /* Forward Declarations */
  45.  
  46.  
  47. class IDMEFItem : public IDMItem {
  48. typedef IDMItem
  49.   Inherited;
  50. /*******************************************************************************
  51. * Objects of this class are created by entry fields when a direct manipulation *
  52. * operation commences in an source entry field and during a direct             *
  53. * manipulation operation when a text object is dragged over a potential        *
  54. * entry field.                                                                 *
  55. *                                                                              *
  56. * Objects of this class possess the following attributes (in addition to       *
  57. * those inherited from its base class):                                        *
  58. *   o association with a source or target drag operation object (see           *
  59. *     IDMSourceOperation or IDMTargetOperation)                                *
  60. *   o association(s) with derived source or target renderer object(s) capable  *
  61. *     of renderering text (see IDMISSrcRenderer or IDMISTgtRenderer) which are *
  62. *     created by the source or handler (see IDMSourceHandler or                *
  63. *     IDMTargetHandler)                                                        *
  64. *                                                                              *
  65. * This class provides virtual functions that implement support for direct      *
  66. * manipulation (i.e. drag drop) entry field text items.                        *
  67. *******************************************************************************/
  68. public:
  69.  
  70. /*------------------------- Constructors/Destructor ----------------------------
  71. | Objects of this class are constructed in the following manner:               |
  72. |   o By providing the drag source operation handle, types, supported          |
  73. |     operations and attributes.                                               |
  74. |   o By providing a pointer to a target drag item.                            |
  75. ------------------------------------------------------------------------------*/
  76.   IDMEFItem     ( const IDMSrcOperationHandle &sourceOperation,
  77.                   const IString &types,
  78.                   const unsigned short supportedOperations = unknown );
  79.  
  80.   IDMEFItem     ( IDMItem &dragItem );
  81.  
  82. virtual
  83.   ~IDMEFItem    ( );
  84.  
  85.  
  86. /*------------------------------ Source Items ----------------------------------
  87. | This function generates source items:                                        |
  88. |   generateSourceItems - Generates entry field text items based upon data in  |
  89. |                         the source entry field window.                       |
  90. ------------------------------------------------------------------------------*/
  91. static Boolean
  92.   generateSourceItems    ( const IDMSrcOperationHandle &sourceOperation );
  93.  
  94. /*------------------------------ Source Rendering ------------------------------
  95. | This function reads data from source window:                                 |
  96. |   renderPrepare - Acquires text from entry field and stores in drag item.    |
  97. ------------------------------------------------------------------------------*/
  98. virtual Boolean
  99.   renderPrepare    ( IDMSourcePrepareEvent &event );
  100.  
  101. /*-------------------------------- Accessors -----------------------------------
  102. | These functions provide access to text per an entry field direct             |
  103. | manipulation operation:                                                      |
  104. |   text           - Returns the drag item text.                               |
  105. |   size           - Returns the size of the drag item text.                   |
  106. ------------------------------------------------------------------------------*/
  107. virtual IString
  108.   text             ( ) const;
  109.  
  110. virtual unsigned
  111.   size             ( ) const;
  112.  
  113. /*------------------------------ Drop Processing -------------------------------
  114. | This function writes data to the target window:                              |
  115. |   dropped - Writes text into entry field from drag item.                     |
  116. ------------------------------------------------------------------------------*/
  117. virtual Boolean
  118.   dropped    ( IWindow *entryField, IDMTargetDropEvent & );
  119.  
  120. protected:
  121. /*-----------------------  Rendering Mechanisms/Formats  -----------------------
  122. | These functions provide means for setting the "RMF" of the drag item:        |
  123. |   buildRMF  - builds a rendering mechanism and format (RMF) string.  This    |
  124. |               function is an overloaded version of the one provided as part  |
  125. |               of the IDMItem class.                                          |
  126. ------------------------------------------------------------------------------*/
  127. IString
  128.   buildRMF    ( const IString &mechanism, const IString &format );
  129.  
  130. private: /*------------------------ PRIVATE ----------------------------------*/
  131.  
  132. }; // IDMEFItem
  133.  
  134.  
  135. class IDMEFItemHandle : public IReference< IDMEFItem > {
  136. /*******************************************************************************
  137. * Objects of this class provide access to IDMEFItem objects                    *
  138. * associated with a direct manipulation event.  This "handle" class manages    *
  139. * references to the IDMEFItem object to ensure that it is not                  *
  140. * deleted until the drag operation is completed.                               *
  141. *                                                                              *
  142. * This class provides a "->" operator that enables instances to be treated     *
  143. * just like a pointer to an IDMEFItem object.                                  *
  144. *                                                                              *
  145. * Example:                                                                     *
  146. *                                                                              *
  147. * This class has no members.  It is essentially a synonym for the type         *
  148. * IReference< IDMEFItem >.                                                     *
  149. *******************************************************************************/
  150. public:
  151.   IDMEFItemHandle  ( IDMEFItem *entryFieldItem );
  152.   ~IDMEFItemHandle ( );
  153.  
  154. /*--------------------------------- Operators ---------------------------------+
  155. | Operators defined for IDMEFItemHandle:                                       |
  156. |   =  - Overload definition to handle assignments of entry field item         |
  157. |        pointers to entry field item handles.                                 |
  158. +-----------------------------------------------------------------------------*/
  159. IDMEFItemHandle
  160.  &operator = ( IDMEFItem *entryFieldItem );
  161.  
  162. }; // IDMEFItemHandle
  163.  
  164.  
  165. #ifndef I_NO_INLINES
  166.   #include <idmefit.inl>
  167. #endif
  168.  
  169. #endif // _IDMEFIT_
  170.