home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iadd.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  7.8 KB  |  173 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. *   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.  
  33. #ifndef _ISTDNTFY_
  34.   #include <istdntfy.hpp>
  35. #endif
  36.  
  37. #ifndef _ISTRING_
  38.   #include <istring.hpp>
  39. #endif
  40.  
  41.  
  42. /*-------------------------- Pragma Library Support --------------------------*/
  43. #ifndef __NO_DEFAULT_LIBS__
  44.   #ifdef __OS2__
  45.     #ifdef __IMPORTLIB__
  46.        #pragma library("CPPOV03I.LIB")
  47.     #else
  48.        #pragma library("CPPOV03.LIB")
  49.     #endif
  50.   #endif
  51.   #ifdef __WINDOWS__
  52.     #ifdef __IMPORTLIB__
  53.        #pragma library("CPPWV03I.LIB")
  54.     #else
  55.        #pragma library("CPPWV03.LIB")
  56.     #endif
  57.   #endif
  58. #endif
  59.  
  60. /*----------------------------------------------------------------------------*/
  61. /* Align classes on four byte boundary.                                       */
  62. /*----------------------------------------------------------------------------*/
  63. #pragma pack(4)
  64.  
  65. class IAddress : public IStandardNotifier
  66. {
  67. typedef IStandardNotifier
  68.   Inherited;
  69. public:
  70. /*--------------------------- PUBLIC -----------------------------------------*/
  71.  
  72. /*------------------------- Constructors/Destructor ----------------------------
  73. ------------------------------------------------------------------------------*/
  74.   IAddress ();
  75.   IAddress (const IAddress& partCopy);
  76. virtual
  77.   ~IAddress ();
  78.  
  79. /*-------------------------------- Operators -----------------------------------
  80. |   operator ==       - Operator == (return true if equal).                    |
  81. |   operator !=       - Operator != (return true if not equal).                |
  82. ------------------------------------------------------------------------------*/
  83.   IAddress& operator= (const IAddress& aIAddress);
  84. Boolean
  85.   operator == (const IAddress& aValue) const,
  86.   operator != (const IAddress& aValue) const,
  87.   operator == (const IAddress* aValue) const,
  88.   operator != (const IAddress* aValue) const;
  89.  
  90.  
  91. /*-------------------------------- Attributes ----------------------------------
  92. | List of query and set members functions for this class:                      |
  93. |                                                                              |
  94. |   street            - Query the street (IString) attribute.                  |
  95. |   city              - Query the city (IString) attribute.                    |
  96. |   state             - Query the state (IString) attribute.                   |
  97. |   zip               - Query the zip (IString) attribute.                     |
  98. |   setStreet         - Set the street (IString) attribute.                    |
  99. |   setCity           - Set the city (IString) attribute.                      |
  100. |   setState          - Set the state (IString) attribute.                     |
  101. |   setZip            - Set the zip (IString) attribute.                       |
  102. ------------------------------------------------------------------------------*/
  103.  
  104. virtual IString
  105.   street () const;
  106. virtual IAddress
  107.  &setStreet (const IString& aStreet);
  108.  
  109. virtual IString
  110.   city () const;
  111. virtual IAddress
  112.  &setCity (const IString& aCity);
  113.  
  114. virtual IString
  115.   state () const;
  116. virtual IAddress
  117.  &setState (const IString& aState);
  118.  
  119. virtual IString
  120.   zip () const;
  121. virtual IAddress
  122.  &setZip (const IString& aZip);
  123.  
  124. /*-------------------------------- Actions -------------------------------------
  125. | List of operations or services provided by this class:                       |
  126. |                                                                              |
  127. |   setStreetToDefault - Perform the setStreetToDefault action.                |
  128. |   setCityToDefault  - Perform the setCityToDefault action.                   |
  129. |   setStateToDefault - Perform the setStateToDefault action.                  |
  130. |   setZipToDefault   - Perform the setZipToDefault action.                    |
  131. |   setToDefault      - Perform the setToDefault action.                       |
  132. ------------------------------------------------------------------------------*/
  133. virtual IAddress
  134.   &setStreetToDefault (),
  135.   &setCityToDefault (),
  136.   &setStateToDefault (),
  137.   &setZipToDefault (),
  138.   &setToDefault ();
  139.  
  140. /*----------------------- Notification Event Descriptions ----------------------
  141. | List of attribute and event notification identifiers:                        |
  142. |                                                                              |
  143. |   streetId          - Notification ID provided to observers when the         |
  144. |                       street attribute changes.                              |
  145. |   cityId            - Notification ID provided to observers when the         |
  146. |                       city attribute changes.                                |
  147. |   stateId           - Notification ID provided to observers when the         |
  148. |                       state attribute changes.                               |
  149. |   zipId             - Notification ID provided to observers when the         |
  150. |                       zip attribute changes.                                 |
  151. ------------------------------------------------------------------------------*/
  152. static INotificationId const
  153.   IVB_IMPORT streetId,
  154.   IVB_IMPORT cityId,
  155.   IVB_IMPORT stateId,
  156.   IVB_IMPORT zipId;
  157.  
  158.  
  159. private:
  160. /*--------------------------- PRIVATE ----------------------------------------*/
  161.   IString iStreet;                      //Data member for street attribute
  162.   IString iCity;                        //Data member for city attribute
  163.   IString iState;                       //Data member for state attribute
  164.   IString iZip;                         //Data member for zip attribute
  165. };
  166.  
  167. /*----------------------------------------------------------------------------*/
  168. /* Resume compiler default packing.                                           */
  169. /*----------------------------------------------------------------------------*/
  170. #pragma pack()
  171.  
  172. #endif
  173.