home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / ivbbool.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  8.0 KB  |  180 lines

  1. #ifndef _IVBBOOL_
  2.   #define _IVBBOOL_
  3. /*******************************************************************************
  4. * FILE NAME: ivbbool.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *    IVBBooleanPart - VB Boolean 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.  
  29. #ifndef _IVBDTYPE_
  30.   #include <ivbdtype.hpp>
  31. #endif
  32.  
  33. #ifndef _ISTRING_
  34.   #include <istring.hpp>
  35. #endif
  36.  
  37. /*-------------------------- Pragma Library Support --------------------------*/
  38. #ifndef __NO_DEFAULT_LIBS__
  39.   #ifdef __OS2__
  40.     #ifdef __IMPORTLIB__
  41.        #pragma library("CPPOV03I.LIB")
  42.     #else
  43.        #pragma library("CPPOV03.LIB")
  44.     #endif
  45.   #endif
  46.   #ifdef __WINDOWS__
  47.     #ifdef __IMPORTLIB__
  48.        #pragma library("CPPWV03I.LIB")
  49.     #else
  50.        #pragma library("CPPWV03.LIB")
  51.     #endif
  52.   #endif
  53. #endif
  54.  
  55.  
  56. /*----------------------------------------------------------------------------*/
  57. /* Align classes on four byte boundary.                                       */
  58. /*----------------------------------------------------------------------------*/
  59. #pragma pack(4)
  60.  
  61. class IVBBooleanPart : public IVBDataTypePart
  62. {
  63. public:
  64. /*--------------------------- PUBLIC -----------------------------------------*/
  65.  
  66. /*------------------------- Constructors/Destructor ----------------------------
  67. ------------------------------------------------------------------------------*/
  68.   IVBBooleanPart (Boolean aValue = false);
  69.   IVBBooleanPart (const IVBBooleanPart& partCopy);
  70. virtual
  71.   ~IVBBooleanPart ();
  72.  
  73. /*-------------------------------- Operators -----------------------------------
  74. ------------------------------------------------------------------------------*/
  75.   IVBBooleanPart& operator= (const IVBBooleanPart& aIVBBooleanPart);
  76. Boolean
  77.   operator == (const IVBBooleanPart& aValue) const,
  78.   operator != (const IVBBooleanPart& aValue) const,
  79.   operator == (const IVBBooleanPart* aValue) const,
  80.   operator != (const IVBBooleanPart* aValue) const;
  81.  
  82. virtual IString
  83.   asString    ( ) const;
  84.  
  85. /*-------------------------------- Attributes ----------------------------------
  86. | List of query and set members functions for this class:                      |
  87. |                                                                              |
  88. |   value             - Query the value (Boolean) attribute.                   |
  89. |   notValue          - Query the notValue (Boolean) attribute.                |
  90. |   valueAsText       - Query the valueAsText (IString) attribute.             |
  91. |   notValueAsText    - Query the notValueAsText (IString) attribute.          |
  92. |   defaultValue      - Query the defaultValue (Boolean) attribute.             |
  93. |   isValueEqualDefault - Query the valueEqualDefault (Boolean) attribute.     |
  94. |   isValueNotEqualDefault - Query the valueNotEqualDefault (Boolean) attribute. |
  95. |   setValue          - Set the value (Boolean) attribute.                     |
  96. |   setNotValue       - Set the notValue (Boolean) attribute.                  |
  97. |   setValueAsText    - Set the valueAsText (IString) attribute.               |
  98. |   setNotValueAsText - Set the notValueAsText (IString) attribute.            |
  99. |   setDefaultValue   - Set the defaultValue (Boolean) attribute.              |
  100. ------------------------------------------------------------------------------*/
  101.  
  102. virtual Boolean
  103.   value () const;
  104. virtual IVBBooleanPart
  105.  &setValue (Boolean value),
  106.  &setValue ();
  107.  
  108. virtual Boolean
  109.   notValue () const;
  110. virtual IVBBooleanPart
  111.  &setNotValue (Boolean notValue),
  112.  &setNotValue ();
  113.  
  114. virtual IString
  115.   valueAsText () const;
  116. virtual IVBBooleanPart
  117.  &setValueAsText (const IString& valueAsText);
  118. virtual IVBBooleanPart
  119.  &setValueAsText (const IString* valueAsText);
  120.  
  121. virtual IString
  122.   notValueAsText () const;
  123. virtual IVBBooleanPart
  124.  &setNotValueAsText (const IString& notValueAsText);
  125. virtual IVBBooleanPart
  126.  &setNotValueAsText (const IString* notValueAsText);
  127.  
  128. virtual Boolean
  129.   defaultValue () const;
  130. virtual IVBBooleanPart
  131.  &setDefaultValue (Boolean defaultValue = false);
  132.  
  133. virtual Boolean
  134.   isValueEqualDefault () const;
  135.  
  136. virtual Boolean
  137.   isValueNotEqualDefault () const;
  138.  
  139. /*-------------------------------- Actions -------------------------------------
  140. | List of operations or services provided by this class:                       |
  141. |                                                                              |
  142. |   assignValueToTrue             - Assign the value attribute to true.        |
  143. |   assignValueToFalse            - Assign the value attribute to false.       |
  144. |   assignValueToDefault          - Assign the value attribute to false.       |
  145. |   copyValueToDefault              - Copy value to default value.             |
  146. |   logicalNotValue               - Perform logical negation on value.         |
  147. |   logicalAndValue               - Perform logical and operator on value.     |
  148. |   logicalOrValue                - Perform logical or operator on value.      |
  149. ------------------------------------------------------------------------------*/
  150.  
  151. virtual IVBBooleanPart
  152.  &assignValueToTrue (),
  153.  &assignValueToFalse (),
  154.  &assignValueToDefault (),
  155.  ©ValueToDefault (),
  156.  &logicalNotValue (),
  157.  &logicalAndValue (Boolean andValue),
  158.  &logicalOrValue (Boolean orValue);
  159.  
  160. /*----------------------- Notification Event Descriptions ----------------------
  161. | List of attribute and event notification identifiers:                        |
  162. |                                                                              |
  163. ------------------------------------------------------------------------------*/
  164.  
  165.  
  166. private:
  167. /*--------------------------- PRIVATE ----------------------------------------*/
  168.   Boolean iValue;                       //Data member for value attribute
  169.   Boolean iDefaultValue;                //Data member for defaultValue attribute
  170.   Boolean iValueEqualDefault;           //Data member for valueEqualDefault attribute
  171.   Boolean iValueNotEqualDefault;        //Data member for valueNotEqualDefault attribute
  172. };
  173.  
  174. /*----------------------------------------------------------------------------*/
  175. /* Resume compiler default packing.                                           */
  176. /*----------------------------------------------------------------------------*/
  177. #pragma pack()
  178.  
  179. #endif
  180.