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

  1. #ifndef _INOTIFY_
  2. #define _INOTIFY_
  3. /*******************************************************************************
  4. * FILE NAME: inotify.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     INotifier                                                                *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 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. *******************************************************************************/
  18.  
  19. #include <ivbase.hpp>
  20.  
  21. class IObserver;
  22. class IObserverList;
  23. class INotificationEvent;
  24. class IEventData;
  25.  
  26. #pragma pack(4)
  27.  
  28. typedef const char
  29.  *INotificationId;
  30.  
  31. class INotifier : public IVBase {
  32. typedef IVBase
  33.   Inherited;
  34.  
  35. public:
  36. /*---------------------------- Constructors ----------------------------------*/
  37.   INotifier  ( );
  38. virtual
  39.   ~INotifier ( );
  40.  
  41. /*----------------------- Notification Members -------------------------------*/
  42. virtual INotifier
  43.  &enableNotification        ( Boolean enable=true ) = 0,
  44.  &disableNotification       ( ) = 0;
  45.  
  46. virtual Boolean
  47.   isEnabledForNotification  ( ) const = 0;
  48.  
  49. /*-------------------------- Observer Notification ---------------------------*/
  50. virtual INotifier
  51.  ¬ifyObservers       ( const INotificationEvent& event ) = 0;
  52.  
  53. protected:
  54. /*------------------------ Observer Addition and Removal ---------------------*/
  55. virtual INotifier
  56.  &addObserver           ( IObserver&        observer,
  57.                           const IEventData& userData ) = 0,
  58.  &removeObserver        ( IObserver&  observer ) = 0,
  59.  &removeAllObservers    ( ) = 0;
  60.  
  61. virtual IObserverList
  62.  &observerList          ( ) const = 0;
  63.  
  64. /*---------------------------- Observer Notification -------------------------*/
  65. virtual INotifier
  66.   ¬ifyObservers      ( const INotificationId& id ) = 0;
  67.  
  68. private:
  69. /*--------------------------------- Private ----------------------------------*/
  70. friend class IObserver;
  71. };  //INotifier
  72.  
  73. #pragma pack()
  74.  
  75. #endif // _INOTIFY_
  76.