forked from EasyIME/PIME
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCandidateListUIElement.cpp
97 lines (75 loc) · 1.99 KB
/
CandidateListUIElement.cpp
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include "CandidateListUIElement.h"
#include <assert.h>
namespace Ime {
CandidateListUIElement::CandidateListUIElement(ITfContext* context):
context_(context),
refCount_(1) {
}
CandidateListUIElement::~CandidateListUIElement(void) {
}
// COM stuff
// IUnknown
STDMETHODIMP CandidateListUIElement::QueryInterface(REFIID riid, void **ppvObj) {
if (ppvObj == NULL)
return E_INVALIDARG;
if(IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfCandidateListUIElement))
*ppvObj = (ITfCandidateListUIElement*)this;
else
*ppvObj = NULL;
if(*ppvObj) {
AddRef();
return S_OK;
}
return E_NOINTERFACE;
}
STDMETHODIMP_(ULONG) CandidateListUIElement::AddRef(void) {
return ++refCount_;
}
STDMETHODIMP_(ULONG) CandidateListUIElement::Release(void) {
assert(refCount_ > 0);
--refCount_;
if(0 == refCount_)
delete this;
return refCount_;
}
// ITfUIElement
STDMETHODIMP CandidateListUIElement::GetDescription(BSTR *pbstrDescription) {
return S_OK;
}
STDMETHODIMP CandidateListUIElement::GetGUID(GUID *pguid) {
return S_OK;
}
STDMETHODIMP CandidateListUIElement::Show(BOOL bShow) {
return S_OK;
}
STDMETHODIMP CandidateListUIElement::IsShown(BOOL *pbShow) {
return S_OK;
}
// ITfCandidateListUIElement
STDMETHODIMP CandidateListUIElement::GetUpdatedFlags(DWORD *pdwFlags) {
return S_OK;
}
STDMETHODIMP CandidateListUIElement::GetDocumentMgr(ITfDocumentMgr **ppdim) {
if(!context_)
return E_FAIL;
return context_->GetDocumentMgr(ppdim);
}
STDMETHODIMP CandidateListUIElement::GetCount(UINT *puCount) {
return S_OK;
}
STDMETHODIMP CandidateListUIElement::GetSelection(UINT *puIndex) {
return S_OK;
}
STDMETHODIMP CandidateListUIElement::GetString(UINT uIndex, BSTR *pstr) {
return S_OK;
}
STDMETHODIMP CandidateListUIElement::GetPageIndex(UINT *pIndex, UINT uSize, UINT *puPageCnt) {
return S_OK;
}
STDMETHODIMP CandidateListUIElement::SetPageIndex(UINT *pIndex, UINT uPageCnt) {
return S_OK;
}
STDMETHODIMP CandidateListUIElement::GetCurrentPage(UINT *puPage) {
return S_OK;
}
}