home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / IOC / DRAG4 / DMSAMP3.HPP < prev    next >
Text File  |  1994-10-14  |  6KB  |  126 lines

  1. #include <iframe.hpp>
  2. #include <ititle.hpp>
  3. #include <icnr.hpp>
  4. #include <idmhndlr.hpp>
  5.  
  6. #include "dmsamp3.h"
  7.  
  8. class MyWindow;
  9.  
  10.  
  11. class Customer : public IContainerObject {
  12. /*******************************************************************************
  13. * Objects of this class are used to show direct manipulation support for       *
  14. * containers.  Instances of this object are created to allow demonstrations    *
  15. * of moves and copies of this object between intra-process containers.         *
  16. *******************************************************************************/
  17. public:
  18. friend class IContainerColumn;
  19. friend class MyWindow;
  20.  
  21. /*-------------------------- Constructors/Destructor ---------------------------
  22. | Objects of this class are constructed by providing the following:            |
  23. |   o A reference to a customer object (a copy constructor)                    |
  24. |   o A IString for the icon text, an icon resource id, an IString for the     |
  25. |     customer name, address, and phone number, and a pointer to a MyWindow    |
  26. |     object                                                                   |
  27. ------------------------------------------------------------------------------*/
  28.   Customer  ( const Customer &cnrobj );
  29.  
  30.   Customer  ( const IString  &iconText,
  31.               unsigned long  iconID,
  32.               const IString  &name,
  33.               const IString  &address,
  34.               const IString  &phone,
  35.               MyWindow       *window );
  36.  
  37.   ~Customer ( ) {};
  38.  
  39. /*-------------------------------- Accessors -----------------------------------
  40. | Instances of the Customer class have attributes that can be accessed by the  |
  41. | following functions:                                                         |
  42. |   name       - Returns the customer name                                     |
  43. |   address    - Returns the customer address.                                 |
  44. |   phone      - Returns the customer phone number.                            |
  45. |   iconId     - Returns the custmoer's icon id.                               |
  46. |   setName    - Sets the customer name.                                       |
  47. |   setAddress - Sets the customer address.                                    |
  48. |   setPhone   - Sets the customer phone number.                               |
  49. ------------------------------------------------------------------------------*/
  50.   IString name    ( ) const  { return this->strName; }
  51.   IString address ( ) const  { return this->strAddress; }
  52.   IString phone   ( ) const  { return this->strPhone; }
  53.   unsigned long iconId ( ) const { return this->ulIconId; }
  54.  
  55.   void setName    ( const IString &name )     { this->strName = name; }
  56.   void setAddress ( const IString &address )  { this->strAddress = address; }
  57.   void setPhone   ( const IString &phone )    { this->strPhone = phone; }
  58.  
  59. /*-------------------------------- Overrides -----------------------------------
  60. | The following function overrides the objectCopy function defined in the      |
  61. | base IContainerObject class:                                                 |
  62. |  objectCopy - Called when it is necessary to make a copy of the Customer     |
  63. |               object.  This is invoked when IContainerControl::copyObjectTo  |
  64. |               is called.                                                     |
  65. ------------------------------------------------------------------------------*/
  66.   IContainerObject* objectCopy( );
  67.  
  68. private:
  69.   IString   strName,
  70.             strAddress,
  71.             strPhone;
  72.   unsigned long ulIconId;
  73.   MyWindow  *myWin;
  74. };
  75.  
  76.  
  77. class MyWindow : public IFrameWindow {
  78. /*******************************************************************************
  79. * This is the common base class for the demo source window class, MySourceWin, *
  80. * and the demo target window class, MyTargetWin.                               *
  81. *******************************************************************************/
  82. friend class Customer;
  83.  
  84. public:
  85. /*-------------------------- Constructor/Destructor ----------------------------
  86. | Objects of this class are constructed by providing the following:            |
  87. |   o A window ID                                                              |
  88. ------------------------------------------------------------------------------*/
  89.   MyWindow  ( unsigned long windowId );
  90.   ~MyWindow ( ) {};
  91.  
  92. protected:
  93.   IContainerControl *cnrCtl;
  94.   Customer          *car,
  95.                     *space,
  96.                     *bolt,
  97.                     *starfleet;
  98.   IResourceLibrary  reslib;
  99. };
  100.  
  101.  
  102. class MySourceWin : public MyWindow {
  103. /*******************************************************************************
  104. * This is the demo source window class.                                        *
  105. *******************************************************************************/
  106. public:
  107. /*------------------------------ Constructor -----------------------------------
  108. | Objects of this class are constructed by providing the following:            |
  109. |   o A window ID                                                              |
  110. ------------------------------------------------------------------------------*/
  111.   MySourceWin ( unsigned long windowId );
  112. };
  113.  
  114. class MyTargetWin : public MyWindow {
  115. /*******************************************************************************
  116. * This is the demo source window class.                                        *
  117. *******************************************************************************/
  118. public:
  119. /*------------------------------ Constructor -----------------------------------
  120. | Objects of this class are constructed by providing the following:            |
  121. |   o A window ID                                                              |
  122. ------------------------------------------------------------------------------*/
  123.   MyTargetWin ( unsigned long windowId );
  124. };
  125.  
  126.