home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / idmoper.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  5.0 KB  |  188 lines

  1. #ifndef _IDMOPER_
  2. #define _IDMOPER_
  3. /*******************************************************************************
  4. * FILE NAME: idmoper.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IDMOperation                                                             *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - 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. *******************************************************************************/
  18. #include <irefcnt.hpp>
  19. #include <ipoint.hpp>
  20. #include <ihandle.hpp>
  21. #include <idmitem.hpp>
  22. #include <idmcomm.hpp>
  23.  
  24.  
  25. class IDragInfo;
  26. typedef IDragInfo _DRAGINFO;
  27.  
  28.  
  29. class  IContainerObject;
  30. class  IContainerControl;
  31. class  IDMSourceBeginEvent;
  32. class  IDMTargetEnterEvent;
  33. class  IDMItemSeq;
  34. class  IDMOperationData;
  35. class  IDMSourceOperationData;
  36.  
  37. #pragma pack(4)
  38.  
  39.  
  40. class IDMOperation : public IRefCounted {
  41. typedef IRefCounted
  42.   Inherited;
  43. typedef IDM::Source
  44.   Source;
  45. public:
  46.  
  47. /*------------------------------- Drag Operations ----------------------------*/
  48. virtual unsigned long
  49.   operation        ( ) const;
  50.  
  51. virtual IDMOperation
  52.   &setOperation    ( unsigned long op );
  53.  
  54. static const unsigned long
  55.   IC_IMPORTU drag,
  56.   IC_IMPORTU copy,
  57.   IC_IMPORTU link,
  58.   IC_IMPORTU move,
  59.   IC_IMPORTU unknown;
  60.  
  61. /*-------------------------- Pointing Device Position ------------------------*/
  62. virtual IPoint
  63.   position              ( ) const;
  64.  
  65. virtual IDMOperation
  66.  &setPosition           ( IPoint        position );
  67.  
  68. /*----------------------------- Drag Source Device ---------------------------*/
  69. virtual Source
  70.   source                ( ) const;
  71.  
  72. virtual IDMOperation
  73.  &setSource             ( Source        source );
  74.  
  75. /*----------------------- Source and Target Window Support -------------------*/
  76. virtual IWindowHandle
  77.   sourceWindowHandle    ( ) const,
  78.   targetWindowHandle    ( ) const;
  79.  
  80. virtual IWindow
  81.  *sourceWindow          ( ) const,
  82.  *targetWindow          ( ) const;
  83.  
  84. virtual IDMOperation
  85.  &setSourceWindowHandle ( IWindowHandle window ),
  86.  &setTargetWindowHandle ( IWindowHandle window );
  87.  
  88. /*-------------------------------- Drag Items --------------------------------*/
  89. unsigned
  90.   numberOfItems     ( );
  91.  
  92. IDMItem::Handle
  93.   item              ( unsigned               position );
  94.  
  95. IDMOperation
  96.  &replaceItem       ( unsigned               position,
  97.                       const IDMItem::Handle& replacement ),
  98.  &addItem           ( const IDMItem::Handle& newItem ),
  99.  &removeItem        ( unsigned               position ),
  100.  &removeItem        ( const IDMItem::Handle& itemToRemove );
  101.  
  102. /*------------------------------ Container Support ---------------------------*/
  103. IContainerObject
  104.  *containerObject        ( ) const;
  105.  
  106. IDMOperation
  107.  &setContainerObject     ( IContainerObject*  object ),
  108.  &setContainerRefreshOff ( IContainerControl* container ),
  109.  &setContainerRefreshOn  ( );
  110.  
  111. /*------------------------------- Diagnostics --------------------------------*/
  112. static Boolean
  113.   debugSupport();
  114.  
  115. static void
  116.   setDebugSupport(Boolean debugSupport = true);
  117.  
  118. protected:
  119. /*------------------------------- Constructors -------------------------------*/
  120.   IDMOperation     ( IDMSourceBeginEvent& event );
  121.  
  122.   IDMOperation     ( IDMTargetEnterEvent& event );
  123.  
  124. virtual
  125.   ~IDMOperation    ( );
  126.  
  127. /*----------------------------- Operation Services ---------------------------*/
  128. _DRAGINFO
  129.  *dragInfo           ( ) const;
  130.  
  131. Boolean
  132.   dragWasInterrupted ( ) const;
  133.  
  134. friend class IDMSourceOperationData;
  135.  
  136. IDMOperation
  137.  &setDragInfo        ( _DRAGINFO* dragInfo ),
  138.  &setDragResult      ( Boolean    result );
  139.  
  140. private:
  141. /*--------------------------------- Private ----------------------------------*/
  142. friend class IDragInfoWrapper;
  143.  
  144. unsigned long
  145.   op;
  146.  
  147. IWindowHandle
  148.   srcWindowHandle,
  149.   tgtWindowHandle;
  150.  
  151. Source
  152.   src;
  153.  
  154. IPoint
  155.   pos;
  156.  
  157. IContainerObject
  158.  *pCnrObj;
  159.  
  160. IContainerControl
  161.  *pCnrRefresh;
  162.  
  163. _DRAGINFO
  164.  *pPMDragInfo;
  165.  
  166. Boolean
  167.   bDragResult;
  168.  
  169. IDMItemSeq
  170.  *pDMItemSeqCl;
  171.  
  172. IDMItemSeq
  173.  *itemCollection ();
  174.  
  175. IDMOperationData
  176.  *fDMOperationData;
  177.  
  178. static Boolean
  179.   fgDebugSupport;
  180.  
  181. }; // IDMOperation
  182.  
  183. #pragma pack()
  184.  
  185.   #include <idmoper.inl>
  186.  
  187. #endif //_IDMOPER_
  188.