ReactOS
0.4.17-dev-1321-g5c122a9
documentmgr.h
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS CTF
3
* LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
4
* PURPOSE: Implementation of ITfDocumentMgr and IEnumTfContexts
5
* COPYRIGHT: Copyright 2009 Aric Stewart, CodeWeavers
6
* Copyright 2025 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
7
*/
8
9
#pragma once
10
12
// CDocumentMgr
13
14
class
CDocumentMgr
15
:
public
ITfDocumentMgr
16
,
public
ITfSource
17
{
18
public
:
19
CDocumentMgr
(
ITfThreadMgrEventSink
*threadMgrSink);
20
virtual
~CDocumentMgr
();
21
22
static
HRESULT
23
CreateInstance
(
24
_In_
ITfThreadMgrEventSink
*pThreadMgrSink,
25
_Out_
ITfDocumentMgr
**ppOut);
26
27
// ** IUnknown methods **
28
STDMETHODIMP
QueryInterface
(
REFIID
iid,
LPVOID
*ppvObject)
override
;
29
STDMETHODIMP_
(
ULONG
)
AddRef
()
override
;
30
STDMETHODIMP_
(
ULONG
)
Release
()
override
;
31
32
// ** ITfDocumentMgr methods **
33
STDMETHODIMP
CreateContext
(
34
TfClientId
tidOwner,
35
DWORD
dwFlags
,
36
IUnknown
*
punk
,
37
ITfContext
**ppic,
38
TfEditCookie
*pecTextStore)
override
;
39
STDMETHODIMP
Push
(
ITfContext
*pic)
override
;
40
STDMETHODIMP
Pop
(
DWORD
dwFlags
)
override
;
41
STDMETHODIMP
GetTop
(
ITfContext
**ppic)
override
;
42
STDMETHODIMP
GetBase
(
ITfContext
**ppic)
override
;
43
STDMETHODIMP
EnumContexts
(
IEnumTfContexts
**ppEnum)
override
;
44
45
// ** ITfSource methods **
46
STDMETHODIMP
AdviseSink
(
REFIID
riid
,
IUnknown
*
punk
,
DWORD
*pdwCookie)
override
;
47
STDMETHODIMP
UnadviseSink
(
DWORD
pdwCookie)
override
;
48
49
friend
class
CEnumTfContext
;
50
51
protected
:
52
LONG
m_cRefs
;
53
ITfCompartmentMgr
*
m_pCompartmentMgr
;
54
ITfContext
*
m_initialContext
;
55
ITfContext
*
m_contextStack
[2];
// limit of 2 contexts
56
ITfThreadMgrEventSink
*
m_pThreadMgrSink
;
57
struct
list
m_transitoryExtensionSink
;
58
};
59
60
EXTERN_C
61
HRESULT
EnumTfContext_Constructor
(
CDocumentMgr
*mgr,
IEnumTfContexts
**ppOut);
62
64
// CEnumTfContext
65
66
class
CEnumTfContext
67
:
public
IEnumTfContexts
68
{
69
public
:
70
CEnumTfContext
(
_In_opt_
CDocumentMgr
*mgr);
71
virtual
~CEnumTfContext
();
72
73
static
HRESULT
CreateInstance
(
_In_opt_
CDocumentMgr
*mgr,
_Out_
IEnumTfContexts
**ppOut);
74
75
// ** IUnknown methods **
76
STDMETHODIMP
QueryInterface
(
REFIID
iid,
LPVOID
*ppvObject)
override
;
77
STDMETHODIMP_
(
ULONG
)
AddRef
()
override
;
78
STDMETHODIMP_
(
ULONG
)
Release
()
override
;
79
80
// ** IEnumTfContexts methods **
81
STDMETHODIMP
Next
(
ULONG
ulCount,
ITfContext
**rgContext,
ULONG
*pcFetched)
override
;
82
STDMETHODIMP
Skip
(
ULONG
celt)
override
;
83
STDMETHODIMP
Reset
()
override
;
84
STDMETHODIMP
Clone
(
IEnumTfContexts
**ppenum)
override
;
85
86
protected
:
87
LONG
m_cRefs
;
88
DWORD
m_index
;
89
CDocumentMgr
*
m_pDocMgr
;
90
};
EXTERN_C
#define EXTERN_C
Definition:
basetyps.h:12
STDMETHODIMP
#define STDMETHODIMP
Definition:
basetyps.h:43
CDocumentMgr
Definition:
documentmgr.h:17
CDocumentMgr::Push
STDMETHODIMP Push(ITfContext *pic) override
Definition:
documentmgr.cpp:143
CDocumentMgr::m_cRefs
LONG m_cRefs
Definition:
documentmgr.h:52
CDocumentMgr::m_transitoryExtensionSink
struct list m_transitoryExtensionSink
Definition:
documentmgr.h:57
CDocumentMgr::STDMETHODIMP_
STDMETHODIMP_(ULONG) Release() override
CDocumentMgr::CreateContext
STDMETHODIMP CreateContext(TfClientId tidOwner, DWORD dwFlags, IUnknown *punk, ITfContext **ppic, TfEditCookie *pecTextStore) override
Definition:
documentmgr.cpp:132
CDocumentMgr::Pop
STDMETHODIMP Pop(DWORD dwFlags) override
Definition:
documentmgr.cpp:179
CDocumentMgr::UnadviseSink
STDMETHODIMP UnadviseSink(DWORD pdwCookie) override
Definition:
documentmgr.cpp:299
CDocumentMgr::GetTop
STDMETHODIMP GetTop(ITfContext **ppic) override
Definition:
documentmgr.cpp:227
CDocumentMgr::m_initialContext
ITfContext * m_initialContext
Definition:
documentmgr.h:54
CDocumentMgr::EnumContexts
STDMETHODIMP EnumContexts(IEnumTfContexts **ppEnum) override
Definition:
documentmgr.cpp:275
CDocumentMgr::m_pThreadMgrSink
ITfThreadMgrEventSink * m_pThreadMgrSink
Definition:
documentmgr.h:56
CDocumentMgr::GetBase
STDMETHODIMP GetBase(ITfContext **ppic) override
Definition:
documentmgr.cpp:250
CDocumentMgr::STDMETHODIMP_
STDMETHODIMP_(ULONG) AddRef() override
CDocumentMgr::m_pCompartmentMgr
ITfCompartmentMgr * m_pCompartmentMgr
Definition:
documentmgr.h:53
CDocumentMgr::m_contextStack
ITfContext * m_contextStack[2]
Definition:
documentmgr.h:55
CDocumentMgr::~CDocumentMgr
virtual ~CDocumentMgr()
Definition:
documentmgr.cpp:35
CEnumTfContext
Definition:
documentmgr.h:68
CEnumTfContext::m_pDocMgr
CDocumentMgr * m_pDocMgr
Definition:
documentmgr.h:89
CEnumTfContext::Reset
STDMETHODIMP Reset() override
Definition:
documentmgr.cpp:419
CEnumTfContext::~CEnumTfContext
virtual ~CEnumTfContext()
Definition:
documentmgr.cpp:320
CEnumTfContext::STDMETHODIMP_
STDMETHODIMP_(ULONG) Release() override
CEnumTfContext::m_index
DWORD m_index
Definition:
documentmgr.h:88
CEnumTfContext::STDMETHODIMP_
STDMETHODIMP_(ULONG) AddRef() override
CEnumTfContext::m_cRefs
LONG m_cRefs
Definition:
documentmgr.h:87
CEnumTfContext::Clone
STDMETHODIMP Clone(IEnumTfContexts **ppenum) override
Definition:
documentmgr.cpp:426
list
Definition:
list.h:39
QueryInterface
_Check_return_ _In_ PQUERY_INTERFACE QueryInterface
Definition:
dispmprt.h:1318
EnumTfContext_Constructor
EXTERN_C HRESULT EnumTfContext_Constructor(CDocumentMgr *mgr, IEnumTfContexts **ppOut)
Definition:
documentmgr.cpp:457
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
riid
REFIID riid
Definition:
atlbase.h:39
CreateInstance
static CInternetFolder * CreateInstance(void)
Definition:
inetfolder.c:328
HRESULT
Definition:
metahost.idl:58
IEnumTfContexts
Definition:
msctf.idl:1752
ITfCompartmentMgr
Definition:
msctf.idl:1722
ITfContext
Definition:
msctf.idl:410
ITfDocumentMgr
Definition:
msctf.idl:270
ITfSource
Definition:
msctf.idl:515
ITfThreadMgrEventSink
Definition:
msctf.idl:1041
IUnknown
Definition:
unknwn.idl:39
IUnknown::AddRef
ULONG AddRef()
IUnknown::Release
ULONG Release()
void
Definition:
nsiface.idl:2307
AdviseSink
static IAdviseSinkEx AdviseSink
Definition:
htmldoc.c:5184
TfClientId
DWORD TfClientId
Definition:
msctf.idl:87
TfEditCookie
DWORD TfEditCookie
Definition:
msctf.idl:86
dwFlags
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition:
netsh.h:141
_Out_
#define _Out_
Definition:
no_sal2.h:160
_In_
#define _In_
Definition:
no_sal2.h:158
_In_opt_
#define _In_opt_
Definition:
no_sal2.h:212
LONG
long LONG
Definition:
pedump.c:60
REFIID
#define REFIID
Definition:
guiddef.h:118
punk
_In_opt_ IUnknown * punk
Definition:
shlwapi.h:158
Next
PACPI_METHOD_ARGUMENT Next
Definition:
slotdev.cpp:96
ULONG
uint32_t ULONG
Definition:
typedefs.h:59
Skip
USHORT Skip
Definition:
userreq.cpp:199
base
ctf
msctf
documentmgr.h
Generated on Tue Nov 10 2026 06:03:24 for ReactOS by
1.9.6