home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / ioc / drag4 / dmsamp4.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  5.8 KB  |  107 lines

  1. /******************************************************************************
  2. * .FILE:         dmsamp4.cpp                                                  *
  3. *                                                                             *
  4. * .DESCRIPTION:  Direct Manipulation Sample Program 4: Class Implementation   *
  5. *                                                                             *
  6. * .CLASSES:      DMSample4Window                                              *
  7. *                CustomerItem                                                 *
  8. *                MyWindow                                                     *
  9. *                MySourceWin                                                  *
  10. *                MyTargetWin                                                  *
  11. *                Customer                                                     *
  12. *                                                                             *
  13. * .COPYRIGHT:                                                                 *
  14. *    Licensed Material - Program-Property of IBM                              *
  15. *    (C) Copyright IBM Corp. 1992, 1996 - All Rights Reserved                 *
  16. *                                                                             *
  17. * .DISCLAIMER:                                                                *
  18. *   The following [enclosed] code is sample code created by IBM               *
  19. *   Corporation.  This sample code is not part of any standard IBM product    *
  20. *   and is provided to you solely for the purpose of assisting you in the     *
  21. *   development of your applications.  The code is provided 'AS IS',          *
  22. *   without warranty of any kind.  IBM shall not be liable for any damages    *
  23. *   arising out of your use of the sample code, even if they have been        *
  24. *   advised of the possibility of such damages.                               *
  25. *                                                                             *
  26. * .NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          *
  27. *                                                                             *
  28. ******************************************************************************/
  29. #include "dmsamp3.hpp"
  30.  
  31. #include <idmprov.hpp>
  32. #include <idmcnrit.hpp>
  33. #include <idmevent.hpp>
  34. #include <idmimage.hpp>
  35. #include <ititle.hpp>
  36. #include <itrace.hpp>
  37. #include <istring.hpp>
  38.  
  39.  
  40. class CustomerItem : public IDMCnrItem {
  41. typedef IDMCnrItem
  42.   Inherited;
  43. /*******************************************************************************
  44. * Objects of this class are used to show direct manipulation support for       *
  45. * containers.  Instances of this object are created to allow a demonstration   *
  46. * of copying of Customer objects between inter-process containers, when 2      *
  47. * copies of this sample are started.                                           *
  48. *******************************************************************************/
  49. public:
  50. /*--------------------------- Constructor/Destructor ---------------------------
  51. | Objects of this class are constructed from a generic item handle.            |
  52. ------------------------------------------------------------------------------*/
  53.   CustomerItem  ( const IDMItem::Handle& item );
  54.   ~CustomerItem ( ) {};
  55.  
  56. /*------------------------------ Source Items ----------------------------------
  57. | This function generates source items:                                        |
  58. |   generateSourceItems - Generates Customer object items based upon           |
  59. |                         selected object(s) in the source container.          |
  60. ------------------------------------------------------------------------------*/
  61. static Boolean
  62.   generateSourceItems ( IDMSourceOperation* srcOp );
  63.  
  64. /*-------------------------------- Operations ----------------------------------
  65. |   supportedOperationsFor - Restricts the operation to copy only if the       |
  66. |                            selected RMF is the ICLUI shared memory RMF.      |
  67. ------------------------------------------------------------------------------*/
  68. virtual unsigned long
  69.   supportedOperationsFor ( const IString& rmf ) const;
  70.  
  71. /*---------------------------------- Shredder ----------------------------------
  72. |   sourceDiscard - Removes the Customer object from the source container.     |
  73. ------------------------------------------------------------------------------*/
  74. virtual Boolean
  75.   sourceDiscard ( IDMSourceDiscardEvent& event );
  76.  
  77. /*------------------------------ Drop Processing -------------------------------
  78. | targetDrop - Create a copy of the dropped Customer object.                   |
  79. ------------------------------------------------------------------------------*/
  80. virtual Boolean
  81.   targetDrop ( IDMTargetDropEvent& event );
  82.  
  83. };
  84.  
  85. /*******************************************************************************
  86. * These windows are similar to those from dmsamp3 but use icon view and        *
  87. * permit dragging/dropping within the same window.  Note that sometimes it     *
  88. * is necessary to restrict target support so if the window title includes      *
  89. * "source only" or "target only" we only permit drag/drop, respectively.       *
  90. *******************************************************************************/
  91. class DMSample4Window : public MyWindow {
  92. public:
  93. /*-------------------------- Constructor/Destructor ----------------------------
  94. | Objects of this class are constructed by providing the following:            |
  95. |   o A pointer to a window title                                              |
  96. ------------------------------------------------------------------------------*/
  97.   DMSample4Window  ( const char *aTitle );
  98.   ~DMSample4Window ( ) {};
  99.  
  100. private:
  101. IDMItemProviderFor< CustomerItem >
  102.   provider;
  103.  
  104. ITitle
  105.   title;
  106. };
  107.