home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / icust.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  9.4 KB  |  222 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. *   IBM(R) VisualAge(TM) for C++                                               *
  12. *   (C) Copyright International Business Machines Corporation 1991, 1996       *
  13. *   Licensed Material - Program-Property of IBM - 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. *   This program will not run in DOS mode.                                     *
  18. *                                                                              *
  19. * DISCLAIMER OF WARRANTIES:                                                    *
  20. *   The following [enclosed] code is sample code created by IBM                *
  21. *   Corporation.  This sample code is not part of any standard IBM product     *
  22. *   and is provided to you solely for the purpose of assisting you in the      *
  23. *   development of your applications.  The code is provided "AS IS",           *
  24. *   without warranty of any kind.  IBM shall not be liable for any damages     *
  25. *   arising out of your use of the sample code, even if they have been         *
  26. *   advised of the possibility of such damages.                                *
  27. *******************************************************************************/
  28. #ifndef _IVBDEFS__
  29. #include <ivbdefs.h>
  30. #endif
  31.  
  32. #ifndef _ISTDNTFY_
  33.   #include <istdntfy.hpp>
  34. #endif
  35.  
  36. #ifndef _ISTRING_
  37.   #include <istring.hpp>
  38. #endif
  39.  
  40. #ifndef _IDATE_
  41.   #include <idate.hpp>
  42. #endif
  43.  
  44. #ifndef _ITIME_
  45.   #include <itime.hpp>
  46. #endif
  47.  
  48. #ifndef _IPTR_H
  49.   #include <iptr.h>
  50. #endif
  51.  
  52. class IAddress;
  53.  
  54. /*-------------------------- Pragma Library Support --------------------------*/
  55. #ifndef __NO_DEFAULT_LIBS__
  56.   #ifdef __OS2__
  57.     #ifdef __IMPORTLIB__
  58.        #pragma library("CPPOV03I.LIB")
  59.     #else
  60.        #pragma library("CPPOV03.LIB")
  61.     #endif
  62.   #endif
  63.   #ifdef __WINDOWS__
  64.     #ifdef __IMPORTLIB__
  65.        #pragma library("CPPWV03I.LIB")
  66.     #else
  67.        #pragma library("CPPWV03.LIB")
  68.     #endif
  69.   #endif
  70. #endif
  71.  
  72. class ICustomer;
  73.  
  74. typedef IElemPointer<ICustomer>
  75.   ICustomerElemPtr;
  76.  
  77. typedef IMngElemPointer<ICustomer>
  78.   ICustomerMngPtr;
  79.  
  80. /*----------------------------------------------------------------------------*/
  81. /* Align classes on four byte boundary.                                       */
  82. /*----------------------------------------------------------------------------*/
  83. #pragma pack(4)
  84.  
  85. class ICustomer : public IStandardNotifier
  86. {
  87. typedef IStandardNotifier
  88.   Inherited;
  89. public:
  90. /*--------------------------- PUBLIC -----------------------------------------*/
  91.  
  92. /*------------------------- Constructors/Destructor ----------------------------
  93. ------------------------------------------------------------------------------*/
  94.   ICustomer ();
  95.   ICustomer (const IString& aName);
  96.   ICustomer (const ICustomer& partCopy);
  97. virtual
  98.   ~ICustomer ();
  99.  
  100. /*-------------------------------- Operators -----------------------------------
  101. |   operator ==       - Operator == (return true if equal).                    |
  102. |   operator !=       - Operator != (return true if not equal).                |
  103. ------------------------------------------------------------------------------*/
  104.   ICustomer& operator= (const ICustomer& aICustomer);
  105. Boolean
  106.   operator == (const ICustomer& aValue) const,
  107.   operator != (const ICustomer& aValue) const,
  108.   operator == (const ICustomer* aValue) const,
  109.   operator != (const ICustomer* aValue) const,
  110.   operator < (const ICustomer& aValue) const,
  111.   operator < (const ICustomer* aValue) const,
  112.   operator < (ICustomer* const& aValue) const,
  113.   operator < (ICustomerElemPtr const& aValue) const,
  114.   operator < (ICustomerMngPtr const& aValue) const;
  115.  
  116. virtual IString
  117.   asString    ( ) const;
  118.  
  119. /*-------------------------------- Attributes ----------------------------------
  120. | List of query and set members functions for this class:                      |
  121. |                                                                              |
  122. |   name              - Query the name (IString) attribute.                    |
  123. |   address           - Query the address (IAddress*) attribute.               |
  124. |   homePhone         - Query the homePhone (IString) attribute.               |
  125. |   workPhone         - Query the workPhone (IString) attribute.               |
  126. |   date              - Query the date (IDate) attribute.                      |
  127. |   time              - Query the time (ITime) attribute.                      |
  128. |   setName           - Set the name (IString) attribute.                      |
  129. |   setAddress        - Set the address (IAddress*) attribute.                 |
  130. |   setHomePhone      - Set the homePhone (IString) attribute.                 |
  131. |   setWorkPhone      - Set the workPhone (IString) attribute.                 |
  132. |   setDate           - Set the date (IDate) attribute.                        |
  133. |   setTime           - Set the time (ITime) attribute.                        |
  134. ------------------------------------------------------------------------------*/
  135.  
  136. virtual IString
  137.   name () const;
  138. virtual ICustomer
  139.  &setName (const IString& aName);
  140.  
  141. virtual IAddress*
  142.   address () const;
  143. virtual ICustomer
  144.  &setAddress (IAddress* aAddress),
  145.  &setAddress (const IAddress& aAddress);
  146.  
  147. virtual IString
  148.   homePhone () const;
  149. virtual ICustomer
  150.  &setHomePhone (const IString& aHomePhone);
  151.  
  152. virtual IString
  153.   workPhone () const;
  154. virtual ICustomer
  155.  &setWorkPhone (const IString& aWorkPhone);
  156.  
  157. virtual IDate
  158.   date () const;
  159. virtual ICustomer
  160.  &setDate (const IDate& aDate);
  161.  
  162. virtual ITime
  163.   time () const;
  164. virtual ICustomer
  165.  &setTime (const ITime& aTime);
  166.  
  167. /*-------------------------------- Actions -------------------------------------
  168. | List of operations or services provided by this class:                       |
  169. |                                                                              |
  170. |   setNameToDefault  - Perform the setNameToDefault action.                   |
  171. |   setAddressToDefault - Perform the setAddressToDefault action.              |
  172. |   setHomePhoneToDefault - Perform the setHomePhoneToDefault action.          |
  173. |   setWorkPhoneToDefault - Perform the setWorkPhoneToDefault action.          |
  174. ------------------------------------------------------------------------------*/
  175. virtual ICustomer
  176.   &setNameToDefault (),
  177.   &setAddressToDefault (),
  178.   &setHomePhoneToDefault (),
  179.   &setWorkPhoneToDefault ();
  180.  
  181. /*----------------------- Notification Event Descriptions ----------------------
  182. | List of attribute and event notification identifiers:                        |
  183. |                                                                              |
  184. |   nameId            - Notification ID provided to observers when the         |
  185. |                       name attribute changes.                                |
  186. |   addressId         - Notification ID provided to observers when the         |
  187. |                       address attribute changes.                             |
  188. |   homePhoneId       - Notification ID provided to observers when the         |
  189. |                       homePhone attribute changes.                           |
  190. |   workPhoneId       - Notification ID provided to observers when the         |
  191. |                       workPhone attribute changes.                           |
  192. |   dateId            - Notification ID provided to observers when the         |
  193. |                       date attribute changes.                                |
  194. |   timeId            - Notification ID provided to observers when the         |
  195. |                       time attribute changes.                                |
  196. ------------------------------------------------------------------------------*/
  197. static INotificationId const
  198.   IVB_IMPORT nameId,
  199.   IVB_IMPORT addressId,
  200.   IVB_IMPORT homePhoneId,
  201.   IVB_IMPORT workPhoneId,
  202.   IVB_IMPORT dateId,
  203.   IVB_IMPORT timeId;
  204.  
  205.  
  206. private:
  207. /*--------------------------- PRIVATE ----------------------------------------*/
  208.   IString iName;                        //Data member for name attribute
  209.   IAddress* iAddress;                   //Data member for address attribute
  210.   IString iHomePhone;                   //Data member for homePhone attribute
  211.   IString iWorkPhone;                   //Data member for workPhone attribute
  212.   IDate iDate;                          //Data member for date attribute
  213.   ITime iTime;                          //Data member for time attribute
  214. };
  215.  
  216. /*----------------------------------------------------------------------------*/
  217. /* Resume compiler default packing.                                           */
  218. /*----------------------------------------------------------------------------*/
  219. #pragma pack()
  220.  
  221. #endif
  222.