home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ibmodf.zip / CUSTOMER.ZIP / ICUST.HPP < prev    next >
Text File  |  1995-06-19  |  9KB  |  190 lines

  1. #ifndef _ICUST_
  2.   #define _ICUST_
  3. /*******************************************************************************
  4. * FILE NAME: icust.hpp                                                         *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *    ICustomer - IBM sample customer part.                                     *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   Licensed Materials - Property of IBM                                       *
  12. *   (C) Copyright IBM Corporation 1994, 1995                                   *
  13. *   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. * DISCLAIMER OF WARRANTIES:                                                    *
  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.  
  27. #include <ipart.hpp>
  28. #include <istring.hpp>
  29. #include <idate.hpp>
  30. #include <itime.hpp>
  31.  
  32. class IAddress;
  33.  
  34. #if 0
  35. /*-------------------------- Pragma Library Support --------------------------*/
  36. #ifndef __NO_DEFAULT_LIBS__
  37.   #ifdef IC_PM
  38.     #ifdef __IMPORTLIB__
  39.        #pragma library("CPPOV03I.LIB")
  40.     #else
  41.        #pragma library("CPPOV03O.LIB")
  42.     #endif
  43.   #endif
  44.   #ifdef IC_WIN
  45.     #ifdef __IMPORTLIB__
  46.        #pragma library("CPPWV03I.LIB")
  47.     #else
  48.        #pragma library("CPPWV03O.LIB")
  49.     #endif
  50.   #endif
  51. #endif
  52. #endif  /* #if 0 */
  53.  
  54.  
  55. /*----------------------------------------------------------------------------*/
  56. /* Align classes on four byte boundary.                                       */
  57. /*----------------------------------------------------------------------------*/
  58. #pragma pack(4)
  59.  
  60. class ICustomer : public IPart
  61. {
  62. public:
  63. /*--------------------------- PUBLIC -----------------------------------------*/
  64.  
  65. /*------------------------- Constructors/Destructor ----------------------------
  66. ------------------------------------------------------------------------------*/
  67.   ICustomer ();
  68.   ICustomer (const IString& aName);
  69.   ICustomer (const ICustomer& partCopy);
  70. virtual
  71.   ~ICustomer ();
  72.  
  73. /*-------------------------------- Operators -----------------------------------
  74. |   operator ==       - Operator == (return true if equal).                    |
  75. |   operator !=       - Operator != (return true if not equal).                |
  76. ------------------------------------------------------------------------------*/
  77.   ICustomer& operator= (const ICustomer& aICustomer);
  78. Boolean
  79.   operator == (const ICustomer& aValue) const,
  80.   operator != (const ICustomer& aValue) const,
  81.   operator == (const ICustomer* aValue) const,
  82.   operator != (const ICustomer* aValue) const;
  83.  
  84. virtual IString
  85.   asString    ( ) const;
  86.  
  87. /*-------------------------------- Attributes ----------------------------------
  88. | List of query and set members functions for this class:                      |
  89. |                                                                              |
  90. |   name              - Query the name (IString) attribute.                    |
  91. |   address           - Query the address (IAddress*) attribute.               |
  92. |   homePhone         - Query the homePhone (IString) attribute.               |
  93. |   workPhone         - Query the workPhone (IString) attribute.               |
  94. |   date              - Query the date (IDate) attribute.                      |
  95. |   time              - Query the time (ITime) attribute.                      |
  96. |   setName           - Set the name (IString) attribute.                      |
  97. |   setAddress        - Set the address (IAddress*) attribute.                 |
  98. |   setHomePhone      - Set the homePhone (IString) attribute.                 |
  99. |   setWorkPhone      - Set the workPhone (IString) attribute.                 |
  100. |   setDate           - Set the date (IDate) attribute.                        |
  101. |   setTime           - Set the time (ITime) attribute.                        |
  102. ------------------------------------------------------------------------------*/
  103.  
  104. virtual IString
  105.   name () const;
  106. virtual ICustomer
  107.  &setName (const IString& aName);
  108.  
  109. virtual IAddress*
  110.   address () const;
  111. virtual ICustomer
  112.  &setAddress (IAddress* aAddress),
  113.  &setAddress (const IAddress& aAddress);
  114.  
  115. virtual IString
  116.   homePhone () const;
  117. virtual ICustomer
  118.  &setHomePhone (const IString& aHomePhone);
  119.  
  120. virtual IString
  121.   workPhone () const;
  122. virtual ICustomer
  123.  &setWorkPhone (const IString& aWorkPhone);
  124.  
  125. virtual IDate
  126.   date () const;
  127. virtual ICustomer
  128.  &setDate (const IDate& aDate);
  129.  
  130. virtual ITime
  131.   time () const;
  132. virtual ICustomer
  133.  &setTime (const ITime& aTime);
  134.  
  135. /*-------------------------------- Actions -------------------------------------
  136. | List of operations or services provided by this class:                       |
  137. |                                                                              |
  138. |   setNameToDefault  - Perform the setNameToDefault action.                   |
  139. |   setAddressToDefault - Perform the setAddressToDefault action.              |
  140. |   setHomePhoneToDefault - Perform the setHomePhoneToDefault action.          |
  141. |   setWorkPhoneToDefault - Perform the setWorkPhoneToDefault action.          |
  142. ------------------------------------------------------------------------------*/
  143. virtual ICustomer
  144.   &setNameToDefault (),
  145.   &setAddressToDefault (),
  146.   &setHomePhoneToDefault (),
  147.   &setWorkPhoneToDefault ();
  148.  
  149. /*----------------------- Notification Event Descriptions ----------------------
  150. | List of attribute and event notification identifiers:                        |
  151. |                                                                              |
  152. |   nameId            - Notification ID provided to observers when the         |
  153. |                       name attribute changes.                                |
  154. |   addressId         - Notification ID provided to observers when the         |
  155. |                       address attribute changes.                             |
  156. |   homePhoneId       - Notification ID provided to observers when the         |
  157. |                       homePhone attribute changes.                           |
  158. |   workPhoneId       - Notification ID provided to observers when the         |
  159. |                       workPhone attribute changes.                           |
  160. |   dateId            - Notification ID provided to observers when the         |
  161. |                       date attribute changes.                                |
  162. |   timeId            - Notification ID provided to observers when the         |
  163. |                       time attribute changes.                                |
  164. ------------------------------------------------------------------------------*/
  165. static INotificationId const
  166.   nameId,
  167.   addressId,
  168.   homePhoneId,
  169.   workPhoneId,
  170.   dateId,
  171.   timeId;
  172.  
  173.  
  174. private:
  175. /*--------------------------- PRIVATE ----------------------------------------*/
  176.   IString iName;                        //Data member for name attribute
  177.   IAddress* iAddress;                   //Data member for address attribute
  178.   IString iHomePhone;                   //Data member for homePhone attribute
  179.   IString iWorkPhone;                   //Data member for workPhone attribute
  180.   IDate iDate;                          //Data member for date attribute
  181.   ITime iTime;                          //Data member for time attribute
  182. };
  183.  
  184. /*----------------------------------------------------------------------------*/
  185. /* Resume compiler default packing.                                           */
  186. /*----------------------------------------------------------------------------*/
  187. #pragma pack()
  188.  
  189. #endif
  190.