ReactOS 0.4.16-dev-1541-g7e1d9ef
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
15 : public ITfDocumentMgr
16 , public ITfSource
17{
18public:
19 CDocumentMgr(ITfThreadMgrEventSink *threadMgrSink);
20 virtual ~CDocumentMgr();
21
22 static HRESULT
24 _In_ ITfThreadMgrEventSink *pThreadMgrSink,
25 _Out_ ITfDocumentMgr **ppOut);
26
27 // ** IUnknown methods **
28 STDMETHODIMP QueryInterface(REFIID iid, LPVOID *ppvObject) override;
31
32 // ** ITfDocumentMgr methods **
34 TfClientId tidOwner,
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
51protected:
55 ITfContext *m_contextStack[2]; // limit of 2 contexts
58};
59
62
64// CEnumTfContext
65
67 : public IEnumTfContexts
68{
69public:
71 virtual ~CEnumTfContext();
72
74
75 // ** IUnknown methods **
76 STDMETHODIMP QueryInterface(REFIID iid, LPVOID *ppvObject) 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
86protected:
90};
#define EXTERN_C
Definition: basetyps.h:12
#define STDMETHODIMP
Definition: basetyps.h:43
STDMETHODIMP Push(ITfContext *pic) override
struct list m_transitoryExtensionSink
Definition: documentmgr.h:57
STDMETHODIMP_(ULONG) Release() override
STDMETHODIMP CreateContext(TfClientId tidOwner, DWORD dwFlags, IUnknown *punk, ITfContext **ppic, TfEditCookie *pecTextStore) override
STDMETHODIMP Pop(DWORD dwFlags) override
STDMETHODIMP UnadviseSink(DWORD pdwCookie) override
STDMETHODIMP GetTop(ITfContext **ppic) override
ITfContext * m_initialContext
Definition: documentmgr.h:54
STDMETHODIMP EnumContexts(IEnumTfContexts **ppEnum) override
ITfThreadMgrEventSink * m_pThreadMgrSink
Definition: documentmgr.h:56
STDMETHODIMP GetBase(ITfContext **ppic) override
STDMETHODIMP QueryInterface(REFIID iid, LPVOID *ppvObject) override
Definition: documentmgr.cpp:92
STDMETHODIMP_(ULONG) AddRef() override
ITfCompartmentMgr * m_pCompartmentMgr
Definition: documentmgr.h:53
ITfContext * m_contextStack[2]
Definition: documentmgr.h:55
virtual ~CDocumentMgr()
Definition: documentmgr.cpp:35
STDMETHODIMP QueryInterface(REFIID iid, LPVOID *ppvObject) override
CDocumentMgr * m_pDocMgr
Definition: documentmgr.h:89
STDMETHODIMP Reset() override
virtual ~CEnumTfContext()
STDMETHODIMP_(ULONG) Release() override
STDMETHODIMP_(ULONG) AddRef() override
STDMETHODIMP Next(ULONG ulCount, ITfContext **rgContext, ULONG *pcFetched) override
STDMETHODIMP Skip(ULONG celt) override
STDMETHODIMP Clone(IEnumTfContexts **ppenum) override
Definition: list.h:37
EXTERN_C HRESULT EnumTfContext_Constructor(CDocumentMgr *mgr, IEnumTfContexts **ppOut)
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID riid
Definition: atlbase.h:39
static CInternetFolder * CreateInstance(void)
Definition: inetfolder.c:330
ULONG AddRef()
ULONG Release()
LPCWSTR LPCWSTR LPCWSTR DWORD dwFlags
Definition: env.c:37
static IAdviseSinkEx AdviseSink
Definition: htmldoc.c:5184
DWORD TfClientId
Definition: msctf.idl:87
DWORD TfEditCookie
Definition: msctf.idl:86
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
long LONG
Definition: pedump.c:60
#define REFIID
Definition: guiddef.h:118
uint32_t ULONG
Definition: typedefs.h:59