mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 07:13:01 +00:00
[MSCTF][SDK] Add stubs for CRange (#8096)
This PR is just a step, but a slightly great one for OS development history. JIRA issue: CORE-19361 - Add IAnchor interface into textstor.idl. - Fix ITfRangeAnchor interface (that was wrong). - Delete range.c. - Add range.cpp. - Add CRange class as stubs.
This commit is contained in:
parent
2c124893ec
commit
5b94656442
7 changed files with 583 additions and 446 deletions
141
base/ctf/msctf/range.h
Normal file
141
base/ctf/msctf/range.h
Normal file
|
@ -0,0 +1,141 @@
|
|||
#pragma once
|
||||
|
||||
DEFINE_GUID(IID_PRIV_CRANGE, 0xB68832F0, 0x34B9, 0x11D3, 0xA7, 0x45, 0x00, 0x50, 0x04, 0x0A, 0xB4, 0x07);
|
||||
|
||||
class CRange
|
||||
: public ITfRangeACP
|
||||
, public ITfRangeAnchor
|
||||
, public ITfSource
|
||||
{
|
||||
protected:
|
||||
DWORD m_dwLockType;
|
||||
IAnchor *m_pAnchorStart;
|
||||
IAnchor *m_pAnchorEnd;
|
||||
CInputContext *m_pInputContext;
|
||||
DWORD m_dwCookie;
|
||||
TfGravity m_gravity;
|
||||
LONG m_cRefs;
|
||||
|
||||
public:
|
||||
CRange(
|
||||
_In_ CInputContext *pIC,
|
||||
_In_ DWORD dwLockType,
|
||||
_In_ IAnchor *pAnchorStart,
|
||||
_In_ IAnchor *pAnchorEnd,
|
||||
_In_ TfGravity gravity);
|
||||
|
||||
virtual ~CRange();
|
||||
|
||||
// ** IUnknown methods **
|
||||
STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj) override;
|
||||
STDMETHODIMP_(ULONG) AddRef() override;
|
||||
STDMETHODIMP_(ULONG) Release() override;
|
||||
|
||||
// ** ITfRange methods **
|
||||
STDMETHODIMP GetText(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ DWORD dwFlags,
|
||||
_Out_ WCHAR *pchText,
|
||||
_In_ ULONG cchMax,
|
||||
_Out_ ULONG *pcch) override;
|
||||
STDMETHODIMP SetText(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ DWORD dwFlags,
|
||||
_In_ const WCHAR *pchText,
|
||||
_In_ LONG cch) override;
|
||||
STDMETHODIMP GetFormattedText(
|
||||
_In_ TfEditCookie ec,
|
||||
_Out_ IDataObject **ppDataObject) override;
|
||||
STDMETHODIMP GetEmbedded(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ REFGUID rguidService,
|
||||
_In_ REFIID riid,
|
||||
_Out_ IUnknown **ppunk) override;
|
||||
STDMETHODIMP InsertEmbedded(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ DWORD dwFlags,
|
||||
_In_ IDataObject *pDataObject) override;
|
||||
STDMETHODIMP ShiftStart(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ LONG cchReq,
|
||||
_Out_ LONG *pcch,
|
||||
_In_ const TF_HALTCOND *pHalt) override;
|
||||
STDMETHODIMP ShiftEnd(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ LONG cchReq,
|
||||
_Out_ LONG *pcch,
|
||||
_In_ const TF_HALTCOND *pHalt) override;
|
||||
STDMETHODIMP ShiftStartToRange(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ ITfRange *pRange,
|
||||
_In_ TfAnchor aPos) override;
|
||||
STDMETHODIMP ShiftEndToRange(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ ITfRange *pRange,
|
||||
_In_ TfAnchor aPos) override;
|
||||
STDMETHODIMP ShiftStartRegion(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ TfShiftDir dir,
|
||||
_Out_ BOOL *pfNoRegion) override;
|
||||
STDMETHODIMP ShiftEndRegion(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ TfShiftDir dir,
|
||||
_Out_ BOOL *pfNoRegion) override;
|
||||
STDMETHODIMP IsEmpty(_In_ TfEditCookie ec, _Out_ BOOL *pfEmpty) override;
|
||||
STDMETHODIMP Collapse(_In_ TfEditCookie ec, _In_ TfAnchor aPos) override;
|
||||
STDMETHODIMP IsEqualStart(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ ITfRange *pWith,
|
||||
_In_ TfAnchor aPos,
|
||||
_Out_ BOOL *pfEqual) override;
|
||||
STDMETHODIMP IsEqualEnd(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ ITfRange *pWith,
|
||||
_In_ TfAnchor aPos,
|
||||
_Out_ BOOL *pfEqual) override;
|
||||
STDMETHODIMP CompareStart(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ ITfRange *pWith,
|
||||
_In_ TfAnchor aPos,
|
||||
_Out_ LONG *plResult) override;
|
||||
STDMETHODIMP CompareEnd(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ ITfRange *pWith,
|
||||
_In_ TfAnchor aPos,
|
||||
_Out_ LONG *plResult) override;
|
||||
STDMETHODIMP AdjustForInsert(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ ULONG cchInsert,
|
||||
_Out_ BOOL *pfInsertOk) override;
|
||||
STDMETHODIMP GetGravity(_Out_ TfGravity *pgStart, _Out_ TfGravity *pgEnd) override;
|
||||
STDMETHODIMP SetGravity(
|
||||
_In_ TfEditCookie ec,
|
||||
_In_ TfGravity gStart,
|
||||
_In_ TfGravity gEnd) override;
|
||||
STDMETHODIMP Clone(_Out_ ITfRange **ppClone) override;
|
||||
STDMETHODIMP GetContext(_Out_ ITfContext **ppContext) override;
|
||||
|
||||
// ** ITfRangeACP methods **
|
||||
STDMETHODIMP GetExtent(_Out_ LONG *pacpAnchor, _Out_ LONG *pcch) override;
|
||||
STDMETHODIMP SetExtent(_In_ LONG acpAnchor, _In_ LONG cch) override;
|
||||
|
||||
// ** ITfRangeAnchor methods **
|
||||
STDMETHODIMP GetExtent(_Out_ IAnchor **ppStart, _Out_ IAnchor **ppEnd) override;
|
||||
STDMETHODIMP SetExtent(_In_ IAnchor *pAnchorStart, _In_ IAnchor *pAnchorEnd) override;
|
||||
|
||||
// ** ITfSource methods **
|
||||
STDMETHODIMP AdviseSink(_In_ REFIID riid, _In_ IUnknown *punk, _Out_ DWORD *pdwCookie) override;
|
||||
STDMETHODIMP UnadviseSink(_In_ DWORD dwCookie) override;
|
||||
|
||||
protected:
|
||||
CRange *_Clone();
|
||||
|
||||
HRESULT _IsEqualX(TfEditCookie ec, BOOL bEnd, ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual);
|
||||
|
||||
HRESULT _CompareX(
|
||||
TfEditCookie ec,
|
||||
BOOL bEnd,
|
||||
ITfRange *pWidth,
|
||||
TfAnchor aPos,
|
||||
LONG *plResult);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue