home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / draglb.zip / DRAGLB.HPP < prev    next >
Text File  |  1994-06-08  |  4KB  |  84 lines

  1. #ifndef DRAGLB_HPP
  2. #define DRAGLB_HPP
  3.  
  4. #include <idmitem.hpp >
  5. #include <idmprov.hpp >
  6. #include <idmevent.hpp>
  7.  
  8.  
  9. class LBItem : public IDMItem {
  10. typedef IDMItem
  11.   Inherited;
  12. /*******************************************************************************
  13. * Objects of this class represent list box items that are created when either  *
  14. * a drag operation starts in an source list box or when a text object is       *
  15. * dropped on a target list box.                                                *
  16. *******************************************************************************/
  17. public:
  18.  
  19. /*------------------------- Constructors/Destructor ----------------------------
  20. | Objects of this class are constructed in the following manner:               |
  21. |   o By providing a pointer to the drag source operation object and a         |
  22. |     reference to a list item.                                                |
  23. |   o By providing a reference to a generic drag item handle.                  |
  24. ------------------------------------------------------------------------------*/
  25.   LBItem  ( IDMSourceOperation    *pSrcOp,
  26.             IString               &listItem );
  27.   LBItem  ( const IDMItem::Handle &item );
  28.  
  29. virtual
  30.  ~LBItem  ( );
  31.  
  32. /*------------------------------ Source Items ----------------------------------
  33. | generateSourceItems - Generates list box text items based upon data in the   |
  34. |                       source list box object.                                |
  35. ------------------------------------------------------------------------------*/
  36. static Boolean
  37.   generateSourceItems ( IDMSourceOperation *pSrcOp );
  38.  
  39. /*-------------------------------- Accessors -----------------------------------
  40. | object - Returns a pointer to the item text that represents a list item.     |
  41. ------------------------------------------------------------------------------*/
  42. virtual void
  43.  *object              ( ) const;
  44.  
  45. /*------------------------------ Drop Processing -------------------------------
  46. | targetDrop - Inserts list box item into the target list box.                 |
  47. | sourceEnd  - Remove source list item to complete the move operation.         |
  48. ------------------------------------------------------------------------------*/
  49. virtual Boolean
  50.   targetDrop          ( IDMTargetDropEvent & ),
  51.   sourceEnd           ( IDMSourceEndEvent  &event );
  52.  
  53. /*---------------------------- Discard Processing ------------------------------
  54. | sourceDiscard - Remove list box item that was dropped on the shredder.       |
  55. ------------------------------------------------------------------------------*/
  56. virtual Boolean
  57.   sourceDiscard       ( IDMSourceDiscardEvent &event );
  58.  
  59. protected:
  60. /*------------------------------ Implementation --------------------------------
  61. | deleteItem - Delete selected list box item.                                  |
  62. ------------------------------------------------------------------------------*/
  63. virtual Boolean
  64.   deleteItem          ( IListBox *listBox );
  65.  
  66. };
  67.  
  68. class LBProvider : public IDMItemProviderFor< LBItem > {
  69. /*******************************************************************************
  70. * Template class that is used to generate LBProvider derived class for LBItem. *
  71. *******************************************************************************/
  72.  
  73. public:
  74. /*-------------------------- Target Enter Processing ---------------------------
  75. | provideEnterSupport -  Verify that we understand the type of the drag item   |
  76. |                        during target enter event processing.                 |
  77. ------------------------------------------------------------------------------*/
  78. virtual Boolean
  79.   provideEnterSupport ( IDMTargetEnterEvent &event );
  80.  
  81. };
  82.  
  83. #endif
  84.