home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / IOC / DRAG4 / DMSAMP4.HPP < prev    next >
Text File  |  1995-01-20  |  4KB  |  79 lines

  1. #include "dmsamp3.hpp"
  2.  
  3. #include <idmprov.hpp>
  4. #include <idmcnrit.hpp>
  5. #include <idmevent.hpp>
  6. #include <idmimage.hpp>
  7. #include <ititle.hpp>
  8. #include <itrace.hpp>
  9. #include <istring.hpp>
  10.  
  11.  
  12. class CustomerItem : public IDMCnrItem {
  13. typedef IDMCnrItem
  14.   Inherited;
  15. /*******************************************************************************
  16. * Objects of this class are used to show direct manipulation support for       *
  17. * containers.  Instances of this object are created to allow a demonstration   *
  18. * of copying of Customer objects between inter-process containers, when 2      *
  19. * copies of this sample are started.                                           *
  20. *******************************************************************************/
  21. public:
  22. /*--------------------------- Constructor/Destructor ---------------------------
  23. | Objects of this class are constructed from a generic item handle.            |
  24. ------------------------------------------------------------------------------*/
  25.   CustomerItem  ( const IDMItem::Handle& item );
  26.   ~CustomerItem ( ) {};
  27.  
  28. /*------------------------------ Source Items ----------------------------------
  29. | This function generates source items:                                        |
  30. |   generateSourceItems - Generates Customer object items based upon           |
  31. |                         selected object(s) in the source container.          |
  32. ------------------------------------------------------------------------------*/
  33. static Boolean
  34.   generateSourceItems ( IDMSourceOperation* srcOp );
  35.  
  36. /*-------------------------------- Operations ----------------------------------
  37. |   supportedOperationsFor - Restricts the operation to copy only if the       |
  38. |                            selected RMF is the ICLUI shared memory RMF.      |
  39. ------------------------------------------------------------------------------*/
  40. virtual unsigned long
  41.   supportedOperationsFor ( const IString& rmf ) const;
  42.  
  43. /*---------------------------------- Shredder ----------------------------------
  44. |   sourceDiscard - Removes the Customer object from the source container.     |
  45. ------------------------------------------------------------------------------*/
  46. virtual Boolean
  47.   sourceDiscard ( IDMSourceDiscardEvent& event );
  48.  
  49. /*------------------------------ Drop Processing -------------------------------
  50. | targetDrop - Create a copy of the dropped Customer object.                   |
  51. ------------------------------------------------------------------------------*/
  52. virtual Boolean
  53.   targetDrop ( IDMTargetDropEvent& event );
  54.  
  55. };
  56.  
  57. /*******************************************************************************
  58. * These windows are similar to those from dmsamp3 but use icon view and        *
  59. * permit dragging/dropping within the same window.  Note that sometimes it     *
  60. * is necessary to restrict target support so if the window title includes      *
  61. * "source only" or "target only" we only permit drag/drop, respectively.       *
  62. *******************************************************************************/
  63. class DMSample4Window : public MyWindow {
  64. public:
  65. /*-------------------------- Constructor/Destructor ----------------------------
  66. | Objects of this class are constructed by providing the following:            |
  67. |   o A pointer to a window title                                              |
  68. ------------------------------------------------------------------------------*/
  69.   DMSample4Window  ( const char *aTitle );
  70.   ~DMSample4Window ( ) {};
  71.  
  72. private:
  73. IDMItemProviderFor< CustomerItem >
  74.   provider;
  75.  
  76. ITitle
  77.   title;
  78. };
  79.