4731
|
1 #ifndef TSF_HPP
|
|
2 #define TSF_HPP
|
|
3
|
|
4 #include <msctf.h>
|
4732
|
5 #include <atlbase.h>
|
4731
|
6
|
|
7 class TSF
|
|
8 {
|
|
9 public:
|
|
10
|
|
11 protected:
|
|
12 class UI_Sink : public ITfUIElementSink, public ITfInputProcessorProfileActivationSink
|
|
13 {
|
|
14 public:
|
|
15 UI_Sink();
|
|
16 ~UI_Sink();
|
|
17
|
|
18 // IUnknown
|
|
19 STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
|
|
20 STDMETHODIMP_(ULONG) AddRef(void);
|
|
21 STDMETHODIMP_(ULONG) Release(void);
|
|
22
|
|
23 // ITfUIElementSink
|
|
24 STDMETHODIMP BeginUIElement(DWORD dwUIElementId, BOOL *pbShow);
|
|
25 STDMETHODIMP UpdateUIElement(DWORD dwUIElementId);
|
|
26 STDMETHODIMP EndUIElement(DWORD dwUIElementId);
|
|
27
|
|
28 // ITfInputProcessorProfileActivationSink
|
|
29 STDMETHODIMP OnActivated(DWORD dwProfileType, LANGID langid,
|
|
30 REFCLSID clsid, REFGUID catid,
|
|
31 REFGUID guidProfile, HKL hkl,
|
|
32 DWORD dwFlags);
|
|
33
|
|
34 // ITfCompartmentEventSink
|
|
35 STDMETHODIMP OnChange(REFGUID rguid);
|
|
36
|
|
37 private:
|
|
38 LONG my_Reference_Count;
|
|
39 };
|
|
40
|
4732
|
41 TSF();
|
|
42 ~TSF();
|
|
43
|
|
44 void Initialize();
|
|
45 void Finalize();
|
|
46
|
4731
|
47 private:
|
4732
|
48 bool my_COM_Initialized;
|
4731
|
49
|
4732
|
50 CComPtr<ITfThreadMgrEx> my_Thread_Manager;
|
|
51 UI_Sink *my_UI_Sink;
|
|
52
|
|
53 DWORD my_UI_Element_Sink_Cookie;
|
|
54 DWORD my_IPPA_Sink_Cookie;
|
4731
|
55 };
|
|
56
|
|
57 #endif
|