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

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //                      SAMPLE CODE
  3. //
  4. // FileName: ACDFMdl2.hpp
  5. //
  6. // ClassName: ACompDocFwkModel
  7. //
  8. // Description: Compound Document Framework (SimpleServer) Model header file
  9. //              This sample is to illustrates the use of notification in the
  10. //              server application.When the model data is changed, a notification
  11. //              event will be sent to the view object, in this example the notification ID
  12. //              is "Data String Changed".
  13. //              There are 'get' and 'set' methods for all of the model data. 
  14. //              When the model data is streamed out the pointer to 'MyObject'
  15. //              is 'flatten'ed, and when the streamed in the pointer is 'resurrect'ed
  16. ///////////////////////////////////////////////////////////////////////////////
  17. #ifndef _COMPDOCFWK_MODEL_
  18. #define _COMPDOCFWK_MODEL_
  19.  
  20. #ifdef IC_TRACE_DEVELOP
  21.     #include <itrace.hpp>
  22. #else
  23.     #define IFUNCTRACE_DEVELOP()
  24.     #define ITRACE_DEVELOP(x)
  25. #endif
  26.  
  27. #include <inotifev.hpp>
  28. #include <istring.hpp>
  29. #include <iModel.hpp>
  30.  
  31. class ACompDocFwkMyObject;
  32.  
  33. class ACompDocFwkModel : public IModel  // Inherit from the IModel class
  34. {
  35. public:
  36.  
  37.     TypeExtensionDeclarationsMacro(ACompDocFwkModel)
  38.  
  39.     static const INotificationId kDataPointerChange;
  40.     static const INotificationId kDataStringChange1;
  41.     static const INotificationId kDataStringChange2;
  42.  
  43.                             ACompDocFwkModel();
  44.     virtual                 ~ACompDocFwkModel();
  45.  
  46.     virtual IString         getString1() const;
  47.     virtual IBoolean        setString1(const IString&);
  48.  
  49.     virtual IString         getString2() const;
  50.     virtual IBoolean        setString2(const IString&);
  51.  
  52.     virtual IString         getPointerMyString() const;
  53.     virtual Boolean         setPointerMyString(const IString&);
  54.  
  55.     virtual IBaseStream&    operator>>=( IBaseStream& towhere ) const;
  56.     virtual IBaseStream&    operator<<=( IBaseStream& fromwhere );
  57.  
  58. protected:
  59.                             ACompDocFwkModel( const ACompDocFwkModel&);
  60.  
  61. private:
  62.     enum                    { kOriginalVersion };
  63.     ACompDocFwkModel&       operator=(const ACompDocFwkModel&);
  64.  
  65.     IString                 fDataString1;
  66.     IString                 fDataString2;
  67.     ACompDocFwkMyObject*    fPointerMyString;
  68. };
  69.  
  70. #endif
  71.