Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.5 KiB

  1. /*
  2. * _NOTMGR.H
  3. *
  4. * Purpose:
  5. * Notification Manager declarations
  6. *
  7. * Author:
  8. * AlexGo 6/5/95
  9. *
  10. * Copyright (c) 1995-1997, Microsoft Corporation. All rights reserved.
  11. */
  12. #ifndef _NOTMGR_H_
  13. #define _NOTMGR_H_
  14. // forward declaration
  15. class CNotifyMgr;
  16. // Set cp to this to signal that the control has converted from rich to plain.
  17. const DWORD CONVERT_TO_PLAIN = 0xFFFFFFFE;
  18. /*
  19. * ITxNotify
  20. *
  21. * Purpose:
  22. * a notification sink for events happening to the backing store,
  23. * used by the Notification Manager
  24. */
  25. class ITxNotify
  26. {
  27. public:
  28. virtual void OnPreReplaceRange( LONG cp, LONG cchDel, LONG cchNew,
  29. LONG cpFormatMin, LONG cpFormatMax ) = 0;
  30. virtual void OnPostReplaceRange( LONG cp, LONG cchDel, LONG cchNew,
  31. LONG cpFormatMin, LONG cpFormatMax ) = 0;
  32. virtual void Zombie() = 0;
  33. private:
  34. ITxNotify * _pnext;
  35. friend class CNotifyMgr; // so it can manipulate _pnext
  36. };
  37. /*
  38. * CNotifyMgr
  39. *
  40. * Purpose:
  41. * the general notification manager; keeps track of all interested
  42. * notification sinks
  43. */
  44. class CNotifyMgr
  45. {
  46. public:
  47. void Add( ITxNotify *pITN );
  48. void Remove( ITxNotify *pITN );
  49. void NotifyPreReplaceRange( ITxNotify *pITNignore, LONG cp, LONG cchDel,
  50. LONG cchNew, LONG cpFormatMin, LONG cpFormatMax );
  51. void NotifyPostReplaceRange( ITxNotify *pITNignore, LONG cp, LONG cchDel,
  52. LONG cchNew, LONG cpFormatMin, LONG cpFormatMax );
  53. CNotifyMgr();
  54. ~CNotifyMgr();
  55. private:
  56. ITxNotify * _pitnlist;
  57. };
  58. #endif //_NOTMGR_H_