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

  1. #ifndef _ICOMPANY_
  2.   #define _ICOMPANY_
  3. /*******************************************************************************
  4. * FILE NAME: icompany.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *    ICompany - IBM sample company 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.  
  29. #ifndef _ISTRING_
  30.   #include <istring.hpp>
  31. #endif
  32.  
  33. #ifndef _IVSEQ_H
  34.   #include <ivseq.h>
  35. #endif
  36.  
  37. #if 0
  38. /*-------------------------- Pragma Library Support --------------------------*/
  39. #ifndef __NO_DEFAULT_LIBS__
  40.   #ifdef IC_PM
  41.     #ifdef __IMPORTLIB__
  42.        #pragma library("CPPOV03I.LIB")
  43.     #else
  44.        #pragma library("CPPOV03.LIB")
  45.     #endif
  46.   #endif
  47.   #ifdef IC_WIN
  48.     #ifdef __IMPORTLIB__
  49.        #pragma library("CPPWV03I.LIB")
  50.     #else
  51.        #pragma library("CPPWV03.LIB")
  52.     #endif
  53.   #endif
  54. #endif
  55. #endif  /* #if 0 */
  56.  
  57. class IAddress;
  58. class ICustomer;
  59. class IVSequence <ICustomer*>;
  60.  
  61. /*-------------------------- Pragma Library Support --------------------------*/
  62. #ifndef __NO_DEFAULT_LIBS__
  63.   #ifdef IC_PM
  64.      #pragma library("CPPOV03I.LIB")
  65.   #endif
  66.   #ifdef IC_WIN
  67.      #pragma library("CPPWV03I.LIB")
  68.   #endif
  69. #endif
  70.  
  71. /*----------------------------------------------------------------------------*/
  72. /* Align classes on four byte boundary.                                       */
  73. /*----------------------------------------------------------------------------*/
  74. #pragma pack(4)
  75.  
  76. class ICompany : public IPart
  77. {
  78. public:
  79. /*--------------------------- PUBLIC -----------------------------------------*/
  80.  
  81. /*------------------------- Constructors/Destructor ----------------------------
  82. ------------------------------------------------------------------------------*/
  83.   ICompany ();
  84.   ICompany (const IString& aName);
  85.   ICompany (const ICompany& partCopy);
  86. virtual
  87.   ~ICompany ();
  88.  
  89. /*-------------------------------- Operators -----------------------------------
  90. |   operator ==       - Operator == (return true if equal).                    |
  91. |   operator !=       - Operator != (return true if not equal).                |
  92. ------------------------------------------------------------------------------*/
  93.   ICompany& operator= (const ICompany& aICompany);
  94. Boolean
  95.   operator == (const ICompany& aValue) const,
  96.   operator != (const ICompany& aValue) const,
  97.   operator == (const ICompany* aValue) const,
  98.   operator != (const ICompany* aValue) const;
  99.  
  100. virtual IString
  101.   asString    ( ) const;
  102.  
  103. /*-------------------------------- Attributes ----------------------------------
  104. | List of query and set members functions for this class:                      |
  105. |                                                                              |
  106. |   name              - Query the name (IString) attribute.                    |
  107. |   address           - Query the address (IAddress*) attribute.               |
  108. |   customerList      - Query the customerList (IVSequence <ICustomer*> *) attribute.             |
  109. |   phone             - Query the phone (IString) attribute.                   |
  110. |   setName           - Set the name (IString) attribute.                      |
  111. |   setAddress        - Set the address (IAddress*) attribute.                 |
  112. |   setCustomerList   - Set the customerList (IVSequence <ICustomer*> *) attribute. |
  113. |   addCustomer                - Perform the add customer action.              |
  114. |   removeCustomer             - Perform the remove customer action.           |
  115. |   setPhone          - Set the phone (IString) attribute.                     |
  116. ------------------------------------------------------------------------------*/
  117.  
  118. virtual IString
  119.   name () const;
  120. virtual ICompany
  121.  &setName (const IString& aName);
  122.  
  123. virtual IAddress*
  124.   address () const;
  125. virtual ICompany
  126.  &setAddress (IAddress* aAddress),
  127.  &setAddress (const IAddress& aAddress);
  128.  
  129. virtual IVSequence <ICustomer*> *
  130.   customerList () const;
  131. virtual ICompany
  132.  &setCustomerList (const IVSequence <ICustomer*>& aCustomerList),
  133.  &setCustomerList (IVSequence <ICustomer*>* aCustomerList),
  134.  &addCustomer (ICustomer* customer),
  135.  &addCustomer (const IString& name);
  136.  
  137. virtual IString
  138.   phone () const;
  139. virtual ICompany
  140.  &setPhone (const IString& aPhone);
  141.  
  142. /*-------------------------------- Actions -------------------------------------
  143. | List of operations or services provided by this class:                       |
  144. |                                                                              |
  145. |   setNameToDefault  - Perform the setNameToDefault action.                   |
  146. |   setAddressToDefault - Perform the setAddressToDefault action.              |
  147. |   setPhoneToDefault - Perform the setPhoneToDefault action.                  |
  148. |   setCustomerListToDefault - Perform the setCustomerListToDefault action.    |
  149. ------------------------------------------------------------------------------*/
  150. virtual ICompany
  151.   &setNameToDefault (),
  152.   &setAddressToDefault (),
  153.   &setPhoneToDefault (),
  154.   &setCustomerListToDefault ();
  155.  
  156. /*----------------------- Notification Event Descriptions ----------------------
  157. | List of attribute and event notification identifiers:                        |
  158. |                                                                              |
  159. |   nameId            - Notification ID provided to observers when the         |
  160. |                       name attribute changes.                                |
  161. |   addressId         - Notification ID provided to observers when the         |
  162. |                       address attribute changes.                             |
  163. |   customerListId    - Notification ID provided to observers when the         |
  164. |                       customerList attribute changes.                        |
  165. |   phoneId           - Notification ID provided to observers when the         |
  166. |                       phone attribute changes.                               |
  167. |  customerAddedId     - Notification event for when customer added to customer list. |
  168. ------------------------------------------------------------------------------*/
  169. static INotificationId const
  170.   nameId,
  171.   addressId,
  172.   customerListId,
  173.   phoneId;
  174.  
  175. static INotificationId const
  176.   customerAddedId;
  177.  
  178. private:
  179. /*--------------------------- PRIVATE ----------------------------------------*/
  180.   IString iName;                        //Data member for name attribute
  181.   IAddress* iAddress;                   //Data member for address attribute
  182.   IVSequence <ICustomer*> * iCustomerList; //Data member for customerList attribute
  183.   IString iPhone;                       //Data member for phone attribute
  184. };
  185.  
  186. /*----------------------------------------------------------------------------*/
  187. /* Resume compiler default packing.                                           */
  188. /*----------------------------------------------------------------------------*/
  189. #pragma pack()
  190.  
  191. #endif
  192.