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.

116 lines
3.6 KiB

  1. /*==============================================================================
  2. Microsoft Denali
  3. Microsoft Confidential.
  4. Copyright 1996 Microsoft Corporation. All Rights Reserved.
  5. File: dbgcxt.h
  6. Maintained by: DGottner
  7. Component: include file for IDebugDocumentContext
  8. ==============================================================================*/
  9. #ifndef _DBGCXT_H
  10. #define _DBGCXT_H
  11. #include "activdbg.h"
  12. /* These GUIDs exist to enable the document to determine if an arbitrary
  13. IDebugDocumentContext object belongs to its document class. QueryInterface
  14. for this GUID causes the IDebugDocument object to return a pointer to
  15. the CDocumentContext (or CIncFileContext) class.
  16. */
  17. extern const GUID IID_IDenaliTemplateDocumentContext;
  18. extern const GUID IID_IDenaliIncFileDocumentContext;
  19. /* ============================================================================
  20. Class: CTemplateDocumentContext
  21. Synopsis: implementation of IDebugDocumentContext for CTemplate objects
  22. */
  23. class CTemplateDocumentContext : public IDebugDocumentContext
  24. {
  25. friend class CTemplate; // CTemplate is only user who even cares about this stuff
  26. public:
  27. // IUnknown methods
  28. virtual HRESULT STDMETHODCALLTYPE QueryInterface(const GUID &guid, void **ppvObj);
  29. virtual ULONG STDMETHODCALLTYPE AddRef();
  30. virtual ULONG STDMETHODCALLTYPE Release();
  31. // IDebugDocumentContext methods
  32. virtual HRESULT STDMETHODCALLTYPE GetDocument(
  33. /* [out] */ IDebugDocument **ppDebugDocument);
  34. virtual HRESULT STDMETHODCALLTYPE EnumCodeContexts(
  35. /* [out] */ IEnumDebugCodeContexts **ppEnum);
  36. // Constructor & destructor
  37. CTemplateDocumentContext(
  38. CTemplate *pTemplate,
  39. ULONG cchSourceOffset,
  40. ULONG cchText,
  41. IActiveScriptDebug *pDebugScript = NULL, // cached values
  42. ULONG idEngine = -1, // only initialize ctor if
  43. ULONG cchTargetOffset = -1 // values happen to be on hand
  44. );
  45. ~CTemplateDocumentContext();
  46. private:
  47. IActiveScriptDebug *m_pDebugScript; // pointer to script engine
  48. CTemplate * m_pTemplate; // pointer to source document
  49. ULONG m_idEngine; // Engine # in template
  50. ULONG m_cchSourceOffset; // character offset in source
  51. ULONG m_cchTargetOffset; // character offset in target (cached)
  52. ULONG m_cchText; // # of characters in the context
  53. LONG m_cRefs; // reference count
  54. };
  55. /* ============================================================================
  56. Class: CIncFileDocumentContext
  57. Synopsis: implementation of IDebugDocumentContext for CIncFile objects
  58. */
  59. class CIncFileDocumentContext : public IDebugDocumentContext
  60. {
  61. friend class CIncFile; // CIncFile is only user who even cares about this stuff
  62. friend class CIncFileEnumCodeContexts; // iterator class
  63. public:
  64. // IUnknown methods
  65. virtual HRESULT STDMETHODCALLTYPE QueryInterface(const GUID &guid, void **ppvObj);
  66. virtual ULONG STDMETHODCALLTYPE AddRef();
  67. virtual ULONG STDMETHODCALLTYPE Release();
  68. // IDebugDocumentContext methods
  69. virtual HRESULT STDMETHODCALLTYPE GetDocument(
  70. /* [out] */ IDebugDocument **ppDebugDocument);
  71. virtual HRESULT STDMETHODCALLTYPE EnumCodeContexts(
  72. /* [out] */ IEnumDebugCodeContexts **ppEnum);
  73. // Constructor & destructor
  74. CIncFileDocumentContext(
  75. CIncFile *pIncFile,
  76. ULONG cchSourceOffset,
  77. ULONG cchText
  78. );
  79. ~CIncFileDocumentContext();
  80. private:
  81. CIncFile * m_pIncFile; // pointer to source document
  82. ULONG m_cchSourceOffset; // character offset in source
  83. ULONG m_cchText; // # of characters in the context
  84. LONG m_cRefs; // reference count
  85. };
  86. #endif /* _DBGCXT_H */