-
Notifications
You must be signed in to change notification settings - Fork 0
/
TfTextLayoutSink.h
51 lines (40 loc) · 1.5 KB
/
TfTextLayoutSink.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved
#pragma once
#include "Private.h"
class CSampleIME;
class CTfTextLayoutSink : public ITfTextLayoutSink
{
public:
CTfTextLayoutSink(_In_ CSampleIME *pTextService);
virtual ~CTfTextLayoutSink();
// IUnknown methods
STDMETHODIMP QueryInterface(REFIID riid, _Outptr_ void **ppvObj);
STDMETHODIMP_(ULONG) AddRef(void);
STDMETHODIMP_(ULONG) Release(void);
// ITfTextLayoutSink
STDMETHODIMP OnLayoutChange(_In_ ITfContext *pContext, TfLayoutCode lcode, _In_ ITfContextView *pContextView);
HRESULT _StartLayout(_In_ ITfContext *pContextDocument, TfEditCookie ec, _In_ ITfRange *pRangeComposition);
VOID _EndLayout();
HRESULT _GetTextExt(_Out_ RECT *lpRect);
ITfContext *_GetContextDocument()
{
return _pContextDocument;
};
virtual VOID _LayoutChangeNotification(_In_ RECT *lpRect) = 0;
virtual VOID _LayoutDestroyNotification() = 0;
private:
HRESULT _AdviseTextLayoutSink();
HRESULT _UnadviseTextLayoutSink();
private:
ITfRange *_pRangeComposition;
ITfContext *_pContextDocument;
TfEditCookie _tfEditCookie;
CSampleIME *_pTextService;
DWORD _dwCookieTextLayoutSink;
LONG _refCount;
};