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.

115 lines
3.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // File: imx.h
  4. //
  5. // Contents: CIMX
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifndef DAP_H
  9. #define DAP_H
  10. #include "private.h"
  11. class CDisplayAttributeInfo;
  12. //+---------------------------------------------------------------------------
  13. //
  14. // CDisplayAttributeProvider
  15. //
  16. //----------------------------------------------------------------------------
  17. class __declspec(novtable) CDisplayAttributeProvider : public ITfDisplayAttributeProvider
  18. {
  19. public:
  20. CDisplayAttributeProvider();
  21. virtual ~CDisplayAttributeProvider();
  22. virtual STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj) = 0;
  23. virtual STDMETHODIMP_(ULONG) AddRef(void) = 0;
  24. virtual STDMETHODIMP_(ULONG) Release(void) = 0;
  25. STDMETHODIMP EnumDisplayAttributeInfo(IEnumTfDisplayAttributeInfo **ppEnum);
  26. STDMETHODIMP GetDisplayAttributeInfo(REFGUID guid, ITfDisplayAttributeInfo **ppInfo);
  27. CDisplayAttributeInfo *_pList;
  28. static WCHAR szProviderName[80];
  29. protected:
  30. void Add(GUID guid, WCHAR *pszDesc, TF_DISPLAYATTRIBUTE *pda);
  31. };
  32. //+---------------------------------------------------------------------------
  33. //
  34. // CDisplayAttributeInfo
  35. //
  36. //----------------------------------------------------------------------------
  37. class CDisplayAttributeInfo : public ITfDisplayAttributeInfo
  38. {
  39. public:
  40. CDisplayAttributeInfo(GUID guid, WCHAR *pszDesc, TF_DISPLAYATTRIBUTE *pda);
  41. ~CDisplayAttributeInfo();
  42. //
  43. // IUnknown methods
  44. //
  45. virtual STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
  46. virtual STDMETHODIMP_(ULONG) AddRef(void);
  47. virtual STDMETHODIMP_(ULONG) Release(void);
  48. STDMETHODIMP GetGUID(GUID *pguid);
  49. STDMETHODIMP GetDescription(BSTR *pbstr);
  50. STDMETHODIMP GetAttributeInfo(TF_DISPLAYATTRIBUTE *pda);
  51. STDMETHODIMP SetAttributeInfo(const TF_DISPLAYATTRIBUTE *pda);
  52. STDMETHODIMP Reset();
  53. CDisplayAttributeInfo *_pNext;
  54. HRESULT _SaveAttribute(const TCHAR *pszKey, WCHAR *pszDesc, const GUID *pguid, TF_DISPLAYATTRIBUTE *pda);
  55. HRESULT _OpenAttribute(const TCHAR *pszKey, WCHAR *pszDesc, const GUID *pguid, TF_DISPLAYATTRIBUTE *pda);
  56. HRESULT _DeleteAttribute(const TCHAR *pszKey, WCHAR *pszDesc, const GUID *pguid);
  57. GUID _guid;
  58. WCHAR _szDesc[MAX_PATH];
  59. TF_DISPLAYATTRIBUTE _da;
  60. TF_DISPLAYATTRIBUTE _daDefault;
  61. int _cRef;
  62. };
  63. //+---------------------------------------------------------------------------
  64. //
  65. // CEnumDisplayAttributeInfo
  66. //
  67. //----------------------------------------------------------------------------
  68. class CEnumDisplayAttributeInfo : public IEnumTfDisplayAttributeInfo
  69. {
  70. public:
  71. CEnumDisplayAttributeInfo(CDisplayAttributeProvider *pProvider);
  72. ~CEnumDisplayAttributeInfo();
  73. // IUnknown methods
  74. //
  75. virtual STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
  76. virtual STDMETHODIMP_(ULONG) AddRef(void);
  77. virtual STDMETHODIMP_(ULONG) Release(void);
  78. //
  79. // IEnumTfDisplayAttributeInfo
  80. //
  81. STDMETHODIMP Clone(IEnumTfDisplayAttributeInfo **ppEnum);
  82. STDMETHODIMP Next(ULONG ulCount, ITfDisplayAttributeInfo **ppInfo, ULONG *pcFetched);
  83. STDMETHODIMP Reset();
  84. STDMETHODIMP Skip(ULONG ulCount);
  85. private:
  86. CDisplayAttributeInfo *_pCur;
  87. int _cRef;
  88. CDisplayAttributeProvider *_pProvider;
  89. };
  90. #endif // DAP_H