Source code of Windows XP (NT5)
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.

139 lines
5.1 KiB

  1. // GROUPIMP.H: Definition of CITGroupLocal
  2. #ifndef __GROUPIMP_H__
  3. #define __GROUPIMP_H__
  4. #include "verinfo.h"
  5. class CITGroupLocal :
  6. public IITGroup,
  7. public CComObjectRootEx<CComMultiThreadModel>,
  8. public CComCoClass<CITGroupLocal, &CLSID_IITGroupLocal>
  9. {
  10. public:
  11. ~CITGroupLocal();
  12. CITGroupLocal() : m_lpGroup(NULL) {} // constructor--initialize member
  13. // variable to NULL
  14. BEGIN_COM_MAP(CITGroupLocal)
  15. COM_INTERFACE_ENTRY(IITGroup)
  16. END_COM_MAP()
  17. DECLARE_REGISTRY(CLSID_IITGroupLocal, "ITIR.LocalGroup.4",
  18. "ITIR.LocalGroup", 0, THREADFLAGS_BOTH)
  19. // ITGroup methods (member functions) go here. CITGroupLocal inherits
  20. // these methods from the pure, virtual functions of IITGroup.
  21. public:
  22. STDMETHOD(Initiate)(DWORD lcGrpItem);
  23. STDMETHOD(CreateFromBitVector)(LPBYTE lpBits, DWORD dwSize, DWORD dwItems);
  24. STDMETHOD(CreateFromBuffer)(HANDLE h);
  25. STDMETHOD(Open)(IITDatabase* lpITDB, LPCWSTR lpszMoniker);
  26. STDMETHOD(Free)(void);
  27. STDMETHOD(CopyOutBitVector)(IITGroup* pIITGroup);
  28. STDMETHOD(AddItem)(DWORD dwGrpItem);
  29. STDMETHOD(RemoveItem)(DWORD dwGrpItem);
  30. STDMETHOD(FindTopicNum)(DWORD dwCount, LPDWORD lpdwOutputTopicNum);
  31. STDMETHOD(FindOffset)(DWORD dwTopicNum, LPDWORD lpdwOutputOffset);
  32. STDMETHOD(GetSize)(LPDWORD lpdwGrpSize);
  33. STDMETHOD(Trim)(void);
  34. STDMETHOD(And)(IITGroup* pIITGroup);
  35. STDMETHOD(And)(IITGroup* pIITGroupIn, IITGroup* pIITGroupOut);
  36. STDMETHOD(Or)(IITGroup* pIITGroup);
  37. STDMETHOD(Or)(IITGroup* pIITGroupIn, IITGroup* pIITGroupOut);
  38. STDMETHOD(Not)(void);
  39. STDMETHOD(Not)(IITGroup* pIITGroupOut);
  40. STDMETHOD(IsBitSet)(DWORD dwTopicNum);
  41. STDMETHOD(CountBitsOn)(LPDWORD lpdwTotalNumBitsOn);
  42. STDMETHOD(Clear)(void);
  43. STDMETHOD_(LPVOID, GetLocalImageOfGroup)(void);
  44. STDMETHOD(PutRemoteImageOfGroup)(LPVOID lpGroupIn);
  45. // private data members
  46. private:
  47. _LPGROUP m_lpGroup;
  48. };
  49. class CITGroupArrayLocal :
  50. public IITGroupArray,
  51. public CComObjectRootEx<CComMultiThreadModel>,
  52. public CComCoClass<CITGroupArrayLocal, &CLSID_IITGroupArrayLocal>
  53. {
  54. public:
  55. CITGroupArrayLocal(): m_pGroup(NULL),
  56. m_fDirty(TRUE),
  57. m_iDefaultOp(ITGP_OPERATOR_OR), // note that OR is the default operator
  58. m_iEntryMax(0),
  59. m_rgfEntries(0L){}; // constructor--initialize member
  60. ~CITGroupArrayLocal();
  61. // variable to NULL
  62. BEGIN_COM_MAP(CITGroupArrayLocal)
  63. COM_INTERFACE_ENTRY(IITGroup)
  64. COM_INTERFACE_ENTRY(IITGroupArray)
  65. END_COM_MAP()
  66. DECLARE_REGISTRY(CLSID_IITGroupArrayLocal, "ITIR.LocalGroupArray.4",
  67. "ITIR.LocalGroupArray", 0, THREADFLAGS_BOTH)
  68. // ITGroup methods (member functions) go here. CITGroupLocal inherits
  69. // these methods from the pure, virtual functions of IITGroup.
  70. public:
  71. // UNDONE: Currently most IITGroup interfaces are not supported. We have only
  72. // put in enough support for xBookshelf.
  73. STDMETHOD(Initiate)(DWORD lcGrpItem) {return E_NOTIMPL;};
  74. STDMETHOD(CreateFromBitVector)(LPBYTE lpBits, DWORD dwSize, DWORD dwItems) {return E_NOTIMPL;};
  75. STDMETHOD(CreateFromBuffer)(HANDLE h) {return E_NOTIMPL;};
  76. STDMETHOD(Open)(IITDatabase* lpITDB, LPCWSTR lpszMoniker) {return E_NOTIMPL;};
  77. STDMETHOD(Free)(void) {return E_NOTIMPL;}
  78. STDMETHOD(CopyOutBitVector)(IITGroup* pIITGroup) {return E_NOTIMPL;}
  79. STDMETHOD(AddItem)(DWORD dwGrpItem){return E_NOTIMPL;}
  80. STDMETHOD(RemoveItem)(DWORD dwGrpItem){return E_NOTIMPL;}
  81. STDMETHOD(FindTopicNum)(DWORD dwCount, LPDWORD lpdwOutputTopicNum){return E_NOTIMPL;}
  82. STDMETHOD(FindOffset)(DWORD dwTopicNum, LPDWORD lpdwOutputOffset){return E_NOTIMPL;}
  83. STDMETHOD(GetSize)(LPDWORD lpdwGrpSize){return E_NOTIMPL;}
  84. STDMETHOD(Trim)(void){return E_NOTIMPL;}
  85. STDMETHOD(And)(IITGroup* pIITGroup){return E_NOTIMPL;}
  86. STDMETHOD(And)(IITGroup* pIITGroupIn, IITGroup* pIITGroupOut){return E_NOTIMPL;}
  87. STDMETHOD(Or)(IITGroup* pIITGroup){return E_NOTIMPL;}
  88. STDMETHOD(Or)(IITGroup* pIITGroupIn, IITGroup* pIITGroupOut){return E_NOTIMPL;}
  89. STDMETHOD(Not)(void){return E_NOTIMPL;}
  90. STDMETHOD(Not)(IITGroup* pIITGroupOut){return E_NOTIMPL;}
  91. STDMETHOD(IsBitSet)(DWORD dwTopicNum){return E_NOTIMPL;}
  92. STDMETHOD(CountBitsOn)(LPDWORD lpdwTotalNumBitsOn){return E_NOTIMPL;}
  93. STDMETHOD(PutRemoteImageOfGroup)(LPVOID lpGroupIn){return E_NOTIMPL;}
  94. // UNDONE: The following are the only IITGroup methods currently supported. Sort of lame, but
  95. // it is all the local code currently requires and time doesn't permit fully expanding this
  96. STDMETHOD_(LPVOID, GetLocalImageOfGroup)(void);
  97. STDMETHOD(Clear)(void) {return ClearEntry(ITGP_ALL_ENTRIES);}
  98. public:
  99. // ITGroupArray methods go here
  100. STDMETHOD(InitEntry)(IITDatabase *piitDB, LPCWSTR lpwszName, LONG& lEntryNum);
  101. STDMETHOD(InitEntry)(IITGroup *piitGroup, LONG& lEntryNum);
  102. STDMETHOD(SetEntry)(LONG lEntryNum);
  103. STDMETHOD(ClearEntry)(LONG lEntryNum);
  104. STDMETHOD(SetDefaultOp)(LONG iDefaultOp);
  105. STDMETHOD(ToString)(LPWSTR *ppwBuffer);
  106. // private data members
  107. private:
  108. LONG m_fDirty;
  109. LONG m_iEntryMax;
  110. LONG m_rgfEntries; // 32-bit flag
  111. LONG m_iDefaultOp;
  112. IITGroup* m_rgpGroup[ITGP_MAX_GROUPARRAY_ENTRIES];
  113. IITGroup* m_pGroup; // the composed group
  114. };
  115. #endif // __GROUPIMP_H__