home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / IOC / LANCELOT / LACCT.HPP < prev    next >
C/C++ Source or Header  |  1995-04-01  |  8KB  |  199 lines

  1. /******************************************************************************
  2. * FILE NAME: lacct.hpp                                                        *
  3. *                                                                             *
  4. * DESCRIPTION:                                                                *
  5. *                                                                             *
  6. * Classes                                                                     *
  7. *   AcctPage                                                                  *
  8. *   AcctCnrObj                                                                *
  9. *                                                                             *
  10. * COPYRIGHT:                                                                  *
  11. *   Licensed Materials - Property of IBM                                      *
  12. *   (C) Copyright IBM Corporation 1992, 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. * CHANGE HISTORY:                                                             *
  18. *******************************************************************************/
  19. #ifndef _LACCT_
  20. #define _LACCT_
  21.  
  22. #include <icnrctl.hpp>
  23. #include <icnrcol.hpp>
  24. #include <imcelcv.hpp>
  25. #include <ientryfd.hpp>  
  26. #include <icmdhdr.hpp>   
  27. #include <istring.hpp>   
  28. #include <istattxt.hpp>  
  29. #include <imsgbox.hpp>
  30. #include <inotebk.hpp>
  31. #include <iselhdr.hpp>
  32.  
  33. #include "ldbase.hpp"
  34. #include "lpagectl.hpp"
  35.  
  36. /******************************************************************************
  37. * Class AcctCnrObj - Account container object.                                *
  38. ******************************************************************************/
  39. class AcctCnrObj : public IContainerObject
  40. {
  41.    public:
  42.  
  43. /*------------------------ Constructors/Destructor ----------------------------
  44. | Construct the object given a user ID and node.                              |
  45. -----------------------------------------------------------------------------*/
  46.       AcctCnrObj( const IString& stCurrentUserId,
  47.                   const IString& stNodeSystem );
  48.       ~AcctCnrObj();
  49.  
  50. /*------------------------------- Accessors -----------------------------------
  51. | These functions provide a means of getting and setting the accessible        |
  52. | attributes of instances of this class:                                       |
  53. |   getUserId           - Returns the user ID.                                 |
  54. |   getNode             - Returns the node.                                    |
  55. |   setUserId           - Sets the user ID.                                    |
  56. |   setNode             - Sets the node.                                       |
  57. |   currentUserIdOffset - Returns the container offset for the user ID.        |
  58. |   nodeSysOffset       - Returns the container offset for the node/system.    |
  59. -----------------------------------------------------------------------------*/
  60.       inline IString
  61.          getUserId() const { return ( currentUserId ); };
  62.       inline IString
  63.          getNode() const { return ( nodeSystem ); };
  64.  
  65.       inline AcctCnrObj
  66.         &setUserId( const IString& uid ) { currentUserId=uid; return *this; };
  67.       inline AcctCnrObj
  68.         &setNode( const IString& node ) { nodeSystem=node; return *this; };
  69.  
  70.       inline unsigned long
  71.          currentUserIdOffset() { return offsetof( AcctCnrObj, currentUserId ); };
  72.       inline unsigned long
  73.          nodeSysOffset() { return offsetof( AcctCnrObj, nodeSystem ); };
  74.  
  75.    private:
  76.  
  77.       IString
  78.          currentUserId,  
  79.          nodeSystem;        
  80. };
  81.  
  82.  
  83. /******************************************************************************
  84. * Class AccountPage - Account page.                                           *
  85. ******************************************************************************/
  86. class AccountPage : public IMultiCellCanvas,
  87.                     public ICommandHandler
  88. {
  89.    public:
  90.       friend class QueryAcct;
  91.  
  92. /*------------------------ Constructors/Destructor ----------------------------
  93. | Construct the object in one of two ways:                                    |
  94. | 1) IWindow*, IString.                                                       |
  95. | 2) IWindow*, LQueryData.                                                    |
  96. -----------------------------------------------------------------------------*/
  97.       AccountPage( IWindow* pParent,
  98.                    const IString& theKey = NULL );
  99.       AccountPage( IWindow* pParent,
  100.                    LQueryData& qd );
  101.       ~AccountPage();
  102.  
  103. /*------------------------ Database Functions ---------------------------------
  104. | These functions are used to save data to the database:                      |
  105. |   verifyAndSave       - Verify the page data and save to the database.      |
  106. -----------------------------------------------------------------------------*/
  107.       Boolean
  108.          verifyAndSave( IString& pString,
  109.                         IString& theEntry,
  110.                         const IString saveName = NULL );
  111.  
  112. /*------------------------------ Accessors ------------------------------------
  113. | These functions provide a means of getting and setting the accessible       |
  114. | attributes of instances of this class:                                      |
  115. |   pageSettings        - Return the page settings for this page.             |
  116. |   key                 - Return the key.                                     |
  117. -----------------------------------------------------------------------------*/
  118.       inline INotebook::PageSettings
  119.          pageSettings() { return thePageSettings; };
  120.  
  121.       inline IString
  122.          &key() { return Key; };
  123.  
  124. /*----------------------------- Page Manipulation -----------------------------
  125. | These functions provide a means of manipulating the instances of this class:|
  126. |   fillEntryfields     - Fill the entryfields for the given container object.|
  127. -----------------------------------------------------------------------------*/
  128.       AccountPage&
  129.          fillEntryfields( AcctCnrObj* cnrObject );
  130.  
  131.  
  132.    protected:
  133.  
  134. /*----------------------------- Event Processing ------------------------------
  135. | Handle and process events:                                                  |
  136. |   command             - Process command events.                             |
  137. |   handleIt            - Start handling events.                              |
  138. -----------------------------------------------------------------------------*/
  139.       Boolean
  140.          command( ICommandEvent& event );
  141.  
  142.       AccountPage
  143.          &handleIt();
  144.  
  145.    private:
  146.  
  147.       AccountPage
  148.          &setCells(),
  149.          &fillCnr(),
  150.          &unMark();
  151.  
  152.       Boolean
  153.          addAcct( IString& userId, IString& node ),
  154.          changeAcct( IString& userId, IString& node, AcctCnrObj* pCnrObj ),
  155.          setAcctData();
  156.  
  157.       PageButtons
  158.          pageButtons;
  159.  
  160.       PageCnrButtons
  161.          pageCnrButtons;
  162.  
  163.       IStaticText
  164.          userIdText,
  165.          nodeSysText;
  166.  
  167.       IEntryField
  168.          userId,
  169.          nodeSys;
  170.  
  171.       IContainerControl
  172.         *pCnr;             
  173.  
  174.       AcctCnrObj
  175.         *pAcctCnrObj;    
  176.  
  177.       IContainerColumn
  178.         *pColUserID,        
  179.         *pColNodeSys;       
  180.  
  181.       LAcctData
  182.          acctData,
  183.          origAcctData;
  184.  
  185.       IString
  186.          Key;
  187.  
  188.       Boolean
  189.          isAquery;
  190.  
  191.       INotebook::PageSettings
  192.          thePageSettings;
  193.  
  194.       PageCnrSelHandler
  195.          cnrSelHandler;
  196.  
  197. };
  198. #endif
  199.