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.

87 lines
1.9 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. // id values used in NOTIFY_DATA
  19. #define NOTIFY_DATA_TEXT_ID 0x0001 // used by RTEXT
  20. // Flags values used in NOTIFY_DATA
  21. #define TN_TX_CELL_SHRINK 0x0001 // indicate some text cells have been removed.
  22. typedef struct
  23. {
  24. DWORD id;
  25. DWORD dwFlags;
  26. VOID *pData;
  27. } NOTIFY_DATA;
  28. /*
  29. * ITxNotify
  30. *
  31. * Purpose:
  32. * a notification sink for events happening to the backing store,
  33. * used by the Notification Manager
  34. */
  35. class ITxNotify
  36. {
  37. public:
  38. virtual void OnPreReplaceRange( LONG cp, LONG cchDel, LONG cchNew,
  39. LONG cpFormatMin, LONG cpFormatMax, NOTIFY_DATA *pNotifyData ) = 0;
  40. virtual void OnPostReplaceRange( LONG cp, LONG cchDel, LONG cchNew,
  41. LONG cpFormatMin, LONG cpFormatMax, NOTIFY_DATA *pNotifyData ) = 0;
  42. virtual void Zombie() = 0;
  43. private:
  44. ITxNotify * _pnext;
  45. friend class CNotifyMgr; // so it can manipulate _pnext
  46. };
  47. /*
  48. * CNotifyMgr
  49. *
  50. * Purpose:
  51. * the general notification manager; keeps track of all interested
  52. * notification sinks
  53. */
  54. class CNotifyMgr
  55. {
  56. public:
  57. void Add( ITxNotify *pITN );
  58. void Remove( ITxNotify *pITN );
  59. void NotifyPreReplaceRange( ITxNotify *pITNignore, LONG cp, LONG cchDel,
  60. LONG cchNew, LONG cpFormatMin, LONG cpFormatMax, NOTIFY_DATA *pNotifyData = NULL );
  61. void NotifyPostReplaceRange( ITxNotify *pITNignore, LONG cp, LONG cchDel,
  62. LONG cchNew, LONG cpFormatMin, LONG cpFormatMax, NOTIFY_DATA *pNotifyData = NULL );
  63. CNotifyMgr();
  64. ~CNotifyMgr();
  65. private:
  66. ITxNotify * _pitnlist;
  67. };
  68. #endif //_NOTMGR_H_