home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cluidm.zip / idmoper.hpp < prev    next >
Text File  |  1993-04-30  |  9KB  |  204 lines

  1. #ifndef _IDMOPER_
  2. #define _IDMOPER_
  3. /*******************************************************************************
  4. * FILE NAME: idmoper.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the declaration(s) of the class(es):                    *
  8. *     IDMOperation          - General purpose "direct manipulation operation"  *
  9. *                             class.                                           *
  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:   S:/ibmclass/idrag/vcs/idmoper.hpv  $
  20. //
  21. //   Rev 1.1   30 Apr 1993 11:45:36   HAGGAR
  22. //
  23. //   Rev 1.0   22 Apr 1993 10:41:10   HAGGAR
  24. //Initial revision.
  25. *******************************************************************************/
  26. #ifndef _IREFCNT_
  27.   #include <irefcnt.hpp>
  28. #endif
  29.  
  30. #ifndef _IPOINT_
  31.   #include <ipoint.hpp>
  32. #endif
  33.  
  34. #ifndef _IHANDLE_
  35.   #include <ihandle.hpp>
  36. #endif
  37.  
  38. #ifndef _ISET_H
  39.   #include <iset.h>
  40. #endif
  41.  
  42. #ifndef _IDMCOMM_
  43.   #include <idmcomm.hpp>
  44. #endif
  45.  
  46. struct _DRAGINFO;
  47.  
  48. class IDMOperation : public IRefCounted {
  49. typedef IRefCounted
  50.   Inherited;
  51. /*******************************************************************************
  52. * This is the common base class for the direct manipulation source and target  *
  53. * drag operation classes.  Objects of this class provide general-purpose       *
  54. * information about direct manipulation operations.                            *
  55. *                                                                              *
  56. * Access to this information is gained via its derived classes.                *
  57. *                                                                              *
  58. * Objects of this class possess the following attributes:                      *
  59. *   o Information about the direct manipulation operation as a whole:          *
  60. *       - operation "type" (i.e., copy, move, or link),                        *
  61. *       - position (i.e., of the pointing device) within the source or         *
  62. *         target window,                                                       *
  63. *       - source of the operation (pointing device versus keyboard),           *
  64. *       - pointer to the PM DRAGINFO structure.                                *
  65. *                                                                              *
  66. * Instances of this class are not intended to be created by application        *
  67. * programmers.  Generally, they are created only by their subclasses           *
  68. * requiring this information.                                                  *
  69. *******************************************************************************/
  70. public:
  71. //pfh typedef ISet<IDMDragImageHandle> IDMDragImageSet;
  72.  
  73. /*-------------------------------- Accessors -----------------------------------
  74. | These functions provide access to attributes of instances of this class:     |
  75. |   position     - Returns the drag or drop position within the source/target  |
  76. |                  window.                                                     |
  77. |   source       - Returns the source of the direct manipulation operation     |
  78. |                  (always "unknown" on the target side).                      |
  79. |   sourceWindow - Returns the handle of the source window for the direct      |
  80. |                  manipulation operation.                                     |
  81. ------------------------------------------------------------------------------*/
  82. //enum Source
  83. //{
  84. //  pointingDevice,
  85. //  keyboard
  86. //};
  87.  
  88. IPoint
  89.   position ( ) const;
  90.  
  91. //IDMSourceBeginEvent::Source
  92. Source
  93.   source ( ) const;
  94.  
  95. IWindowHandle
  96.   sourceWindow ( ) const;
  97.  
  98. /*-------------------------------- Operations ----------------------------------
  99. | These functions deal with the "default operation" attribute of instances     |
  100. | of this class:                                                               |
  101. |   operation - Returns the default operation.                                 |
  102. |                                                                              |
  103. | These static members provide the set of pre-defined operation codes:         |
  104. |   drag    - Default drag (no augmentation keys are pressed).                 |
  105. |   copy    - Copy (the copy augmentation key is pressed).                     |
  106. |   link    - Link (the link augmentation key(s) is(are) pressed).             |
  107. |   move    - Move (the move augmentation key is pressed).                     |
  108. |   unknown - Unknown (application-defined operation codes should              |
  109. |             be assigned values greater than this).                           |
  110. ------------------------------------------------------------------------------*/
  111. unsigned short
  112.   operation ( ) const;
  113.  
  114. static const unsigned short
  115.   drag,
  116.   copy,
  117.   link,
  118.   move,
  119.   unknown;
  120.  
  121. protected:
  122. /*------------------------- Constructors/Destructor ----------------------------
  123. | Objects of this class are constructed in the following manner:               |
  124. ------------------------------------------------------------------------------*/
  125. //  IDMOperation (IDMSourceBeginEvent::Source source, const IPoint &position );
  126.   IDMOperation (Source source, const IPoint &position );
  127.  
  128.  virtual
  129.   ~IDMOperation ( );
  130.  
  131. /*-------------------------------- Drag Items ----------------------------------
  132. | The following functions provide means of accessing the IDMDragImage objects  |
  133. | involved in the direct manipulation operation.                               |
  134. |   numberOfImages - Returns the number of drag images.                        |
  135. |   image          - Returns the drag image with given index.                  |
  136. |   replaceImage   - Replaces a given drag image with another.                 |
  137. |   addImage       - Associates another drag image with this operation.        |
  138. |   removeImage    - Removes a drag image from the operation.                  |
  139. ------------------------------------------------------------------------------*/
  140. unsigned
  141.   numberOfImages ( );
  142.  
  143. //pfh IDMDragImageHandle
  144. //pfh   image ( unsigned index );
  145.  
  146.   IDMOperation
  147. //pfh  &replaceImage ( unsigned        index,
  148. //pfh                  IDMDragImageHandle replacement ),
  149.  
  150. //pfh  &addImage    ( IDMDragImageHandle newImage ),
  151.  
  152.   &removeImage ( unsigned index );
  153.  
  154. /*------------------------------ Implementation --------------------------------
  155. | These functions provide various utility services used to implement this      |
  156. | class:                                                                       |
  157. |   setOperation  - Set the operation of the DM operation.                     |
  158. |   setSrcWindow  - Set the source window of the DM operation.                 |
  159. |   setSrc        - Set the source of the DM operation.                        |
  160. |   setPosition   - Set the pointing device position for the DM operation.     |
  161. |   setPMDragInfo - Set the pointer to the PM DRAGINFO structure.              |
  162. |   PMDragInfo    - Returns the pointer to the PM DRAGINFO structure.          |
  163. |   imageSetCl    - Returns a pointer to the collection of IDMDragImages.      |
  164. |   setImages     - Sets the pointer to the collection of IDMDragImages.       |
  165. ------------------------------------------------------------------------------*/
  166. IDMOperation
  167.   &setOperation (unsigned short Operation),
  168.   &setSrcWindow (IWindowHandle sourceWindow),
  169. //pfh  &setSrc (IBeginDragEvent::Source source),
  170.   &setSrc (Source source),
  171.   &setPosition (IPoint position),
  172.   &setPMDragInfo (_DRAGINFO *pDragInfo);
  173.  
  174. _DRAGINFO
  175.    *PMDragInfo ();
  176.  
  177. //pfh IDMDragImageSet
  178. //pfh  *imageSetCl ( ) const;
  179.  
  180. //pfh IDMOperation
  181. //pfh   &setImages ( IDMDragImageSet *pIDMDragImageSet );
  182.  
  183. private: /*------------------------ PRIVATE ----------------------------------*/
  184. unsigned short
  185.   op;
  186. IWindowHandle
  187.   srcWindow;
  188. //IDMSourceBeginEvent::Source
  189. Source
  190.   src;
  191. IPoint
  192.   pos;
  193. _DRAGINFO
  194.  *pPMDragInfo;
  195. //pfh IDMDragImageSet
  196. //pfh   *pDMDragImageSetCl;
  197. }; // class IDMOperation
  198.  
  199. #ifndef I_NO_INLINES
  200.   #include <idmoper.inl>
  201. #endif
  202.  
  203. #endif //_IDMOPER_
  204.