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

  1. #ifndef _IADD_
  2.   #define _IADD_
  3. /*******************************************************************************
  4. * FILE NAME: iadd.hpp                                                          *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *    IAddress - IBM sample address 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.  
  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. /* Align classes on four byte boundary.                                       */
  56. /*----------------------------------------------------------------------------*/
  57. #pragma pack(4)
  58.  
  59. class IAddress : public IPart
  60. {
  61. public:
  62. /*--------------------------- PUBLIC -----------------------------------------*/
  63.  
  64. /*------------------------- Constructors/Destructor ----------------------------
  65. ------------------------------------------------------------------------------*/
  66.   IAddress ();
  67.   IAddress (const IAddress& partCopy);
  68. virtual
  69.   ~IAddress ();
  70.  
  71. /*-------------------------------- Operators -----------------------------------
  72. |   operator ==       - Operator == (return true if equal).                    |
  73. |   operator !=       - Operator != (return true if not equal).                |
  74. ------------------------------------------------------------------------------*/
  75.   IAddress& operator= (const IAddress& aIAddress);
  76. Boolean
  77.   operator == (const IAddress& aValue) const,
  78.   operator != (const IAddress& aValue) const,
  79.   operator == (const IAddress* aValue) const,
  80.   operator != (const IAddress* aValue) const;
  81.  
  82.  
  83. /*-------------------------------- Attributes ----------------------------------
  84. | List of query and set members functions for this class:                      |
  85. |                                                                              |
  86. |   street            - Query the street (IString) attribute.                  |
  87. |   city              - Query the city (IString) attribute.                    |
  88. |   state             - Query the state (IString) attribute.                   |
  89. |   zip               - Query the zip (IString) attribute.                     |
  90. |   setStreet         - Set the street (IString) attribute.                    |
  91. |   setCity           - Set the city (IString) attribute.                      |
  92. |   setState          - Set the state (IString) attribute.                     |
  93. |   setZip            - Set the zip (IString) attribute.                       |
  94. ------------------------------------------------------------------------------*/
  95.  
  96. virtual IString
  97.   street () const;
  98. virtual IAddress
  99.  &setStreet (const IString& aStreet);
  100.  
  101. virtual IString
  102.   city () const;
  103. virtual IAddress
  104.  &setCity (const IString& aCity);
  105.  
  106. virtual IString
  107.   state () const;
  108. virtual IAddress
  109.  &setState (const IString& aState);
  110.  
  111. virtual IString
  112.   zip () const;
  113. virtual IAddress
  114.  &setZip (const IString& aZip);
  115.  
  116. /*-------------------------------- Actions -------------------------------------
  117. | List of operations or services provided by this class:                       |
  118. |                                                                              |
  119. |   setStreetToDefault - Perform the setStreetToDefault action.                |
  120. |   setCityToDefault  - Perform the setCityToDefault action.                   |
  121. |   setStateToDefault - Perform the setStateToDefault action.                  |
  122. |   setZipToDefault   - Perform the setZipToDefault action.                    |
  123. |   setToDefault      - Perform the setToDefault action.                       |
  124. ------------------------------------------------------------------------------*/
  125. virtual IAddress
  126.   &setStreetToDefault (),
  127.   &setCityToDefault (),
  128.   &setStateToDefault (),
  129.   &setZipToDefault (),
  130.   &setToDefault ();
  131.  
  132. /*----------------------- Notification Event Descriptions ----------------------
  133. | List of attribute and event notification identifiers:                        |
  134. |                                                                              |
  135. |   streetId          - Notification ID provided to observers when the         |
  136. |                       street attribute changes.                              |
  137. |   cityId            - Notification ID provided to observers when the         |
  138. |                       city attribute changes.                                |
  139. |   stateId           - Notification ID provided to observers when the         |
  140. |                       state attribute changes.                               |
  141. |   zipId             - Notification ID provided to observers when the         |
  142. |                       zip attribute changes.                                 |
  143. ------------------------------------------------------------------------------*/
  144. static INotificationId const
  145.   streetId,
  146.   cityId,
  147.   stateId,
  148.   zipId;
  149.  
  150.  
  151. private:
  152. /*--------------------------- PRIVATE ----------------------------------------*/
  153.   IString iStreet;                      //Data member for street attribute
  154.   IString iCity;                        //Data member for city attribute
  155.   IString iState;                       //Data member for state attribute
  156.   IString iZip;                         //Data member for zip attribute
  157. };
  158.  
  159. /*----------------------------------------------------------------------------*/
  160. /* Resume compiler default packing.                                           */
  161. /*----------------------------------------------------------------------------*/
  162. #pragma pack()
  163.  
  164. #endif
  165.