2020-09-30 16:53:55 +02:00

46 lines
850 B
C++

//
// statsink.h
//
// Generic ITfStatusSink object
//
#ifndef STATSINK_H
#define STATSINK_H
#include "private.h"
#define SES_INVALID_COOKIE ((DWORD)(-1))
typedef HRESULT (*SESCALLBACK)(void *pv, DWORD dwFlags);
class CStatusSink : public ITfStatusSink
{
public:
CStatusSink(SESCALLBACK pfnCallback, void *pv);
//
// IUnknown methods
//
STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
STDMETHODIMP_(ULONG) AddRef(void);
STDMETHODIMP_(ULONG) Release(void);
//
// ITfStatusSink
//
STDMETHODIMP OnStatusChange(ITfContext *pic, DWORD dwFlags);
HRESULT _Advise(ITfContext *pic);
HRESULT _Unadvise();
private:
long _cRef;
ITfContext *_pic;
DWORD _dwCookie;
SESCALLBACK _pfnCallback;
void *_pv;
};
#endif // STATSINK_H