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

  1. /******************************************************************************
  2. * .FILE:         notify.hpp                                                   *
  3. *                                                                             *
  4. * .DESCRIPTION:  Notify Sample Application: Class Header                      *
  5. *                                                                             *
  6. * .CLASSES:      CustomerObject                                               *
  7. *                efObserver                                                   *
  8. *                MenuCommandHandler                                           *
  9. *                                                                             *
  10. * .COPYRIGHT:                                                                 *
  11. *    Licensed Material - Program-Property of IBM                              *
  12. *    (C) Copyright IBM Corp. 1992, 1996 - All Rights Reserved                 *
  13. *                                                                             *
  14. * .DISCLAIMER:                                                                *
  15. *   The following [enclosed] code is sample code created by IBM               *
  16. *   Corporation.  This sample code is not part of any standard IBM product    *
  17. *   and is provided to you solely for the purpose of assisting you in the     *
  18. *   development of your applications.  The code is provided 'AS IS',          *
  19. *   without warranty of any kind.  IBM shall not be liable for any damages    *
  20. *   arising out of your use of the sample code, even if they have been        *
  21. *   advised of the possibility of such damages.                               *
  22. *                                                                             *
  23. * .NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          *
  24. *                                                                             *
  25. ******************************************************************************/
  26. #include <ibase.hpp>
  27. #include <istring.hpp>
  28. #include <iobservr.hpp>
  29. #include <inotifev.hpp>
  30. #include <icmdhdr.hpp>
  31.  
  32. /*******************************************************************************
  33. * Class CustomerObject - A class that holds the name of the customer           *
  34. *******************************************************************************/
  35. class CustomerObject
  36. {
  37.   public:
  38. /*------------------------------ Constructor  ---------------------------------|
  39. | Constructs object with                                                       |
  40. | 1) A string containing the name of the customer                              |
  41. ------------------------------------------------------------------------------*/
  42.     CustomerObject
  43.      &storeName(IString name);
  44.     IString
  45.       name();
  46.  
  47.   private:
  48.     IString
  49.       firstName;
  50. };
  51.  
  52. /*******************************************************************************
  53. * Class efObserver - Declare the entryField observer class.                    *
  54. *******************************************************************************/
  55. class efObserver : public IObserver
  56. {
  57.   public:
  58.  
  59. /*------------------------- Override the Function ----------------------------|
  60. | Override the dispatchNotificationEvent function and process the             |
  61. | notifications needed.                                                       |
  62. -----------------------------------------------------------------------------*/
  63.     virtual IObserver
  64.      &dispatchNotificationEvent (const INotificationEvent& anEvent);
  65.  
  66. };
  67.  
  68.  
  69. /*******************************************************************************
  70. * Class MenuCommandHandler - Handles menu commands                           *
  71. *******************************************************************************/
  72. class MenuCommandHandler : public ICommandHandler
  73. {
  74.   protected:
  75.  
  76. /*------------------------- Override the Function ----------------------------|
  77. | Override the command function to handle the menu items                      |
  78. -----------------------------------------------------------------------------*/
  79.     virtual Boolean
  80.       command(ICommandEvent& event);
  81. };
  82.