home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / visbuild / oasearch / skill.cpv < prev    next >
Encoding:
Text File  |  1996-02-20  |  4.0 KB  |  118 lines

  1. /******************************************************************************
  2. * .FILE:        skill.cpv                                                     *
  3. *                                                                             *
  4. * .DESCRIPTION: Implementation of additional member functions for the class   *
  5. *               OASkill                                                       *
  6. *                                                                             *
  7. * .CLASSES:                                                                   *
  8. *                                                                             *
  9. * .COPYRIGHT:                                                                 *
  10. *    Licensed Material - Program-Property of IBM                              *
  11. *    (C) Copyright IBM Corp. 1992, 1995, 1996 - All Rights Reserved           *
  12. *                                                                             *
  13. * .DISCLAIMER:                                                                *
  14. *   The following [enclosed] code is sample code created by IBM               *
  15. *   Corporation.  This sample code is not part of any standard IBM product    *
  16. *   and is provided to you solely for the purpose of assisting you in the     *
  17. *   development of your applications.  The code is provided 'AS IS',          *
  18. *   without warranty of any kind.  IBM shall not be liable for any damages    *
  19. *   arising out of your use of the sample code, even if they have been        *
  20. *   advised of the possibility of such damages.                               *
  21. *                                                                             *
  22. * .NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          *
  23. *                                                                             *
  24. ******************************************************************************/
  25. // Default Part Code Generation begins here...
  26. INotificationId OASkill::skillNameId = "OASkill::skillName";
  27. INotificationId OASkill::contractorIDId = "OASkill::contractorID";
  28. INotificationId OASkill::yearsExpId = "OASkill::yearsExp";
  29. INotificationId OASkill::keyId = "OASkill::key";
  30.  
  31. IString OASkill::skillName() const
  32. {
  33.   return iSkillName;
  34. }
  35.  
  36. OASkill & OASkill::setSkillName(const IString & aSkillName)
  37. {
  38.   if (iSkillName != aSkillName)
  39.   {
  40.     iSkillName = aSkillName;
  41.     notifyObservers(INotificationEvent(OASkill::skillNameId, *this));
  42.   } // endif
  43.   return *this;
  44. }
  45.  
  46. IString OASkill::contractorID() const
  47. {
  48.   return iContractorID;
  49. }
  50.  
  51. OASkill & OASkill::setContractorID(const IString & aContractorID)
  52. {
  53.   if (iContractorID != aContractorID)
  54.   {
  55.     iContractorID = aContractorID;
  56.     setKey("");
  57.     notifyObservers(INotificationEvent(OASkill::contractorIDId, *this));
  58.   } // endif
  59.   return *this;
  60. }
  61.  
  62. IString OASkill::yearsExp() const
  63. {
  64.   return iYearsExp;
  65. }
  66.  
  67. OASkill & OASkill::setYearsExp(const long aValue)
  68. {
  69.   IString tempYears = IString(aValue);
  70.  
  71.   if (iYearsExp != tempYears)
  72.     iYearsExp = tempYears;
  73.  
  74. // Signal event even when value of yearsExp attribute has not changed
  75.  
  76.   notifyObservers(INotificationEvent(OASkill::yearsExpId, *this));
  77.  
  78.   return *this;
  79. }
  80.  
  81. OASkill & OASkill::setYearsExp(const IString & aYearsExp)
  82. {
  83.   if (iYearsExp != aYearsExp)
  84.   {
  85.     iYearsExp = aYearsExp;
  86.     notifyObservers(INotificationEvent(OASkill::yearsExpId, *this));
  87.   } // endif
  88.   return *this;
  89. }
  90.  
  91. IString OASkill::key() const
  92. {
  93.   return iKey;
  94. }
  95.  
  96. OASkill & OASkill::setKey(const IString & aKey)
  97. {
  98.   if (iKey != aKey)
  99.     {
  100.        iKey = aKey;
  101.        notifyObservers(INotificationEvent(OASkill::keyId, *this));
  102.      }
  103.   return *this;
  104. }
  105.  
  106. // Copy constructor
  107. // Necessary for skillBase support
  108.  
  109. OASkill::OASkill(const OASkill & aSkill)
  110.   : IStandardNotifier(aSkill),
  111.   iSkillName(aSkill.skillName()),
  112.   iContractorID(aSkill.contractorID()),
  113.   iYearsExp(aSkill.yearsExp()),
  114.   iKey(aSkill.key())
  115.   {
  116.     enableNotification();
  117.   }
  118.