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.

80 lines
1.9 KiB

  1. //
  2. // LM Lattice Object class definition
  3. //
  4. #ifndef LMLATTIC_H
  5. #define LMLATTIC_H
  6. //
  7. // CLMLattice
  8. //
  9. //
  10. class CLMLattice : public ITfLMLattice
  11. {
  12. public:
  13. // ctor / dtor
  14. CLMLattice(CSapiIMX *p_tip, IUnknown *pResWrap);
  15. ~CLMLattice();
  16. // IUnknown
  17. STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
  18. STDMETHODIMP_(ULONG) AddRef(void);
  19. STDMETHODIMP_(ULONG) Release(void);
  20. // ITfLMLattice
  21. STDMETHODIMP QueryType(REFGUID refguidType, BOOL *pfSupported);
  22. STDMETHODIMP EnumLatticeElements( DWORD dwFrameStart,
  23. REFGUID refguidType,
  24. IEnumTfLatticeElements **ppEnum);
  25. private:
  26. CComPtr<IUnknown> m_cpResWrap;
  27. ULONG m_ulStartSRElement;
  28. ULONG m_ulNumSRElements;
  29. CSapiIMX *m_pTip;
  30. LONG m_cRef;
  31. };
  32. //
  33. // CEnumLatticeElements
  34. //
  35. class CEnumLatticeElements : public IEnumTfLatticeElements,
  36. public CStructArray<TF_LMLATTELEMENT>
  37. {
  38. public:
  39. // ctor / dtor
  40. CEnumLatticeElements(DWORD dwFrameStart);
  41. ~CEnumLatticeElements();
  42. // IUnknown
  43. STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
  44. STDMETHODIMP_(ULONG) AddRef(void);
  45. STDMETHODIMP_(ULONG) Release(void);
  46. // ITfEnumLatticeElements
  47. STDMETHODIMP Clone(IEnumTfLatticeElements **ppEnum);
  48. STDMETHODIMP Next(ULONG ulCount, TF_LMLATTELEMENT *rgsElements, ULONG *pcFetched);
  49. STDMETHODIMP Reset();
  50. STDMETHODIMP Skip(ULONG ulCount);
  51. // internal APIs
  52. HRESULT _InitFromPhrase
  53. (
  54. SPPHRASE *pPhrase, // pointer to a phrase object
  55. ULONG ulStartElem, // start/num elements used in this phrase
  56. ULONG ulNumElem // for this lattice
  57. );
  58. ULONG _Find(DWORD dwFrame, ULONG *pul);
  59. private:
  60. DWORD m_dwFrameStart;
  61. ULONG m_ulCur;
  62. ULONG m_ulTotal;
  63. LONG m_cRef;
  64. };
  65. #endif // LMLATTIC_H