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

  1. /******************************************************************************
  2. * FILE NAME: lskill.hpp                                                       *
  3. *                                                                             *
  4. * DESCRIPTION:                                                                *
  5. *                                                                             *
  6. * Class                                                                       *
  7. *   SkillPage                                                                 *
  8. *   SkillCnrObj                                                               *
  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 _LSKILL_
  20. #define _LSKILL_
  21.  
  22. #include <icnrctl.hpp>
  23. #include <icnrcol.hpp>
  24. #include <imcelcv.hpp>
  25. #include <ientryfd.hpp>
  26. #include <icmdhdr.hpp>
  27. #include <ispinnum.hpp>
  28. #include <imsgbox.hpp>
  29. #include <inotebk.hpp>
  30.  
  31. #include "ldbase.hpp"
  32. #include "lpagectl.hpp"
  33.  
  34. /******************************************************************************
  35. * Class SkillCnrObj - Skill container object.                                 *
  36. ******************************************************************************/
  37. class SkillCnrObj : public IContainerObject 
  38. {
  39.    public:
  40.  
  41. /*------------------------ Constructors/Destructor ----------------------------
  42. | Construct the object given a skill and experience.                          |
  43. -----------------------------------------------------------------------------*/
  44.       SkillCnrObj( const IString& stSkill,
  45.                    const IString& stExp );
  46.      ~SkillCnrObj();
  47.  
  48. /*------------------------------- Accessors -----------------------------------
  49. | These functions provide a means of getting and setting the accessible        |
  50. | attributes of instances of this class:                                       |
  51. |   getSkill            - Returns the skill.                                   |
  52. |   getExp              - Returns the experience.                              |
  53. |   setSkill            - Sets the skill.                                      |
  54. |   setExp              - Sets the experience.                                 |
  55. |   skillOffset         - Returns the container offset for the skill.          |
  56. |   expOffset           - Returns the container offset for the experience.     |
  57. -----------------------------------------------------------------------------*/
  58.       inline IString
  59.          getSkill() const {return (skill); };
  60.       inline IString
  61.          getExp()   const {return (exp); };
  62.  
  63.       inline SkillCnrObj
  64.         &setSkill( const IString& sk ) {skill=sk; return *this;};
  65.       inline SkillCnrObj
  66.         &setExp( const IString& ex ) {exp=ex; return *this;};
  67.  
  68.       inline unsigned long
  69.          skillOffset() { return offsetof(SkillCnrObj, skill); };
  70.       inline unsigned long
  71.          expOffset() { return offsetof(SkillCnrObj, exp); };
  72.  
  73.    private:
  74.  
  75.       unsigned long
  76.          unDoNum;
  77.  
  78.       IString
  79.          skill,
  80.          exp;  
  81. };
  82.  
  83.  
  84. /******************************************************************************
  85. * Class SkillPage - Skill page.                                               *
  86. ******************************************************************************/
  87. class SkillPage : public IMultiCellCanvas,
  88.                   public ICommandHandler
  89. {
  90.    public:
  91.       friend class QuerySkill;
  92.  
  93. /*------------------------ Constructors/Destructor ----------------------------
  94. | Construct the object in one of two ways:                                    |
  95. | 1) IWindow*, IString.                                                       |
  96. | 2) IWindow*, LQueryData.                                                    |
  97. -----------------------------------------------------------------------------*/
  98.       SkillPage( IWindow* pParent,
  99.                  const IString& aKey = NULL );
  100.  
  101.       SkillPage( IWindow* pParent,
  102.                  LQueryData& qd );
  103.  
  104.      ~SkillPage();
  105.  
  106. /*------------------------ Database Functions ---------------------------------
  107. | These functions are used to save data to the database:                      |
  108. |   verifyAndSave       - Verify the page data and save to the database.      |
  109. -----------------------------------------------------------------------------*/
  110.       Boolean
  111.          verifyAndSave( IString& theString,
  112.                         IString& theEntry,
  113.                         const IString saveName = NULL );
  114.  
  115. /*------------------------------ Accessors ------------------------------------
  116. | These functions provide a means of getting and setting the accessible       |
  117. | attributes of instances of this class:                                      |
  118. |   pageSettings        - Return the page settings for this page.             |
  119. |   key                 - Return the key.                                     |
  120. -----------------------------------------------------------------------------*/
  121.       inline INotebook::PageSettings
  122.          pageSettings() { return thePageSettings; };
  123.  
  124.       inline IString
  125.          &key() {return Key;};
  126.  
  127. /*----------------------------- Page Manipulation -----------------------------
  128. | These functions provide a means of manipulating the instances of this class:|
  129. |   fillEntryfields     - Fill the entryfields for the given container object.|
  130. -----------------------------------------------------------------------------*/
  131.       SkillPage&
  132.          fillEntryfields( SkillCnrObj* cnrObject );
  133.  
  134.  
  135.    protected: 
  136.  
  137. /*----------------------------- Event Processing ------------------------------
  138. | Handle and process events:                                                  |
  139. |   command             - Process command events.                             |
  140. |   handleIt            - Start handling events.                              |
  141. -----------------------------------------------------------------------------*/
  142.       Boolean
  143.          command( ICommandEvent& event );
  144.  
  145.       SkillPage&
  146.          handleIt();
  147.  
  148.    private:
  149.  
  150.       SkillPage
  151.         &setCells(),
  152.         &fillCnr(),
  153.         &unMark();
  154.  
  155.       Boolean
  156.          addSkill( IString& i1, IString& i2 ),
  157.          changeSkill( IString& i1, IString& i2, SkillCnrObj* cnrObj ),
  158.          setSkillData();
  159.  
  160.       PageButtons
  161.          pageButtons;
  162.  
  163.       PageCnrButtons
  164.          pageCnrButtons;
  165.  
  166.       QueryRange
  167.         *pSkillRange;
  168.  
  169.       IStaticText
  170.          skillText,
  171.          monthsExpText;
  172.  
  173.       IEntryField
  174.          skill;
  175.  
  176.       INumericSpinButton
  177.          monthsExp;
  178.  
  179.       IContainerControl
  180.         *pCnr;          
  181.  
  182.       SkillCnrObj
  183.         *pSkillCnrObj;    
  184.  
  185.       IContainerColumn
  186.         *pColSkill,
  187.         *pColExp;
  188.  
  189.       LSkillData
  190.          skillData,
  191.          origSkillData;
  192.  
  193.       IString
  194.          Key;
  195.  
  196.       INotebook::PageSettings
  197.          thePageSettings;
  198.  
  199.       Boolean
  200.          isAquery;
  201.  
  202.       PageCnrSelHandler
  203.          cnrSelHandler;
  204. };
  205. #endif
  206.