ITextStoreACP interface
The ITextStoreACP interface is implemented by the application and is used by the TSF manager to manipulate text streams or text stores in TSF. An application can obtain an instance of this interface with a call to the ITfDocumentMgr::CreateContext method. The interface ID is IID_ITextStoreACP.
This interface exposes text stores through an application character position (ACP) format. Applications that use an anchor-based format should use ITextStoreAnchor.
Members
The ITextStoreACP interface inherits from the IUnknown interface. ITextStoreACP also has these types of members:
Methods
The ITextStoreACP interface has these methods.
| Method | Description |
|---|---|
| AdviseSink |
Identifies the sink interface of the TSF manager. |
| FindNextAttrTransition |
Determines the character position where an attribute transition occurs. |
| GetACPFromPoint |
Converts a point in screen coordinates to an application character position. |
| GetActiveView |
Returns a TsViewCookie data type that specifies the current active view. |
| GetEmbedded |
Obtains an embedded object from a document. |
| GetEndACP |
Returns the number of characters in a document. |
| GetFormattedText |
Returns formatted text information about a specified text string. |
| GetScreenExt |
Returns the bounding box, in screen coordinates, of the display surface where the text stream is rendered. |
| GetSelection |
Returns the character position of a text selection in a document. |
| GetStatus |
Used by the application to obtain the document status. |
| GetText |
Returns information about text at a specified character position. |
| GetTextExt |
Returns the bounding box, in screen coordinates, of the text at a specified character position. |
| GetWnd |
Returns the handle to a window that corresponds to the current document. |
| InsertEmbedded |
Inserts an object into a document. |
| InsertEmbeddedAtSelection |
Inserts an IDataObject object at the insertion point or selection. |
| InsertTextAtSelection |
Inserts text at the insertion point or selection. |
| QueryInsert |
Called by an application to determine if the document can accept text at the selection or insertion point. |
| QueryInsertEmbedded |
Determines if the document can accept an embedded object through the ITextStoreACP::InsertEmbedded or the ITextStoreACP::InsertEmbeddedAtSelection methods. |
| RequestAttrsAtPosition |
Obtains the attributes at the specified application character position. |
| RequestAttrsTransitioningAtPosition |
Obtains a list of attributes that begin or end at the specified application character position. |
| RequestLock |
Called by the TSF manager to provide a document lock so that the TSF manager can modify the document. This method calls the ITextStoreACPSink::OnLockGranted method to create the document lock. |
| RequestSupportedAttrs |
Obtains the supported attributes of a document. |
| RetrieveRequestedAttrs |
Returns the attributes obtained by the ITextStoreACP::RequestAttrsAtPosition, TextStoreACP::RequestAttrsTransitioningAtPosition, or the ITextStoreACP::RequestSupportedAttrs methods. |
| SetSelection |
Selects text within the document. |
| SetText |
Sets the text selection to the supplied character positions. |
| UnadviseSink |
Called by the application to indicate that the application no longer requires notifications from the TSF manager. |
Examples
class CTSFEditWnd : public ITextStoreACP { public: CTSFEditWnd(HINSTANCE hInstance, HWND hwndParent); ~CTSFEditWnd(); //IUnknown methods. STDMETHOD (QueryInterface)(REFIID, LPVOID*); STDMETHOD_ (DWORD, AddRef)(); STDMETHOD_ (DWORD, Release)(); //ITextStoreACP methods. STDMETHODIMP AdviseSink(REFIID riid, IUnknown *punk, DWORD dwMask); STDMETHODIMP UnadviseSink(IUnknown *punk); STDMETHODIMP RequestLock(DWORD dwLockFlags, HRESULT *phrSession); STDMETHODIMP GetStatus(TS_STATUS *pdcs); STDMETHODIMP QueryInsert(LONG acpTestStart, LONG acpTestEnd, ULONG cch, LONG *pacpResultStart, LONG *pacpResultEnd); STDMETHODIMP GetSelection(ULONG ulIndex, ULONG ulCount, TS_SELECTION_ACP *pSelection, ULONG *pcFetched); STDMETHODIMP SetSelection(ULONG ulCount, const TS_SELECTION_ACP *pSelection); STDMETHODIMP GetText(LONG acpStart, LONG acpEnd, WCHAR *pchPlain, ULONG cchPlainReq, ULONG *pcchPlainOut, TS_RUNINFO *prgRunInfo, ULONG ulRunInfoReq, ULONG *pulRunInfoOut, LONG *pacpNext); STDMETHODIMP SetText(DWORD dwFlags, LONG acpStart, LONG acpEnd, const WCHAR *pchText, ULONG cch, TS_TEXTCHANGE *pChange); STDMETHODIMP GetFormattedText(LONG acpStart, LONG acpEnd, IDataObject **ppDataObject); STDMETHODIMP GetEmbedded(LONG acpPos, REFGUID rguidService, REFIID riid, IUnknown **ppunk); STDMETHODIMP QueryInsertEmbedded(const GUID *pguidService, const FORMATETC *pFormatEtc, BOOL *pfInsertable); STDMETHODIMP InsertEmbedded(DWORD dwFlags, LONG acpStart, LONG acpEnd, IDataObject *pDataObject, TS_TEXTCHANGE *pChange); STDMETHODIMP RequestSupportedAttrs(DWORD dwFlags, ULONG cFilterAttrs, const TS_ATTRID *paFilterAttrs); STDMETHODIMP RequestAttrsAtPosition(LONG acpPos, ULONG cFilterAttrs, const TS_ATTRID *paFilterAttrs, DWORD dwFlags); STDMETHODIMP RequestAttrsTransitioningAtPosition(LONG acpPos, ULONG cFilterAttrs, const TS_ATTRID *paFilterAttrs, DWORD dwFlags); STDMETHODIMP FindNextAttrTransition(LONG acpStart, LONG acpHalt, ULONG cFilterAttrs, const TS_ATTRID *paFilterAttrs, DWORD dwFlags, LONG *pacpNext, BOOL *pfFound, LONG *plFoundOffset); STDMETHODIMP RetrieveRequestedAttrs(ULONG ulCount, TS_ATTRVAL *paAttrVals, ULONG *pcFetched); STDMETHODIMP GetEndACP(LONG *pacp); STDMETHODIMP GetActiveView(TsViewCookie *pvcView); STDMETHODIMP GetACPFromPoint(TsViewCookie vcView, const POINT *pt, DWORD dwFlags, LONG *pacp); STDMETHODIMP GetTextExt(TsViewCookie vcView, LONG acpStart, LONG acpEnd, RECT *prc, BOOL *pfClipped); STDMETHODIMP GetScreenExt(TsViewCookie vcView, RECT *prc); STDMETHODIMP GetWnd(TsViewCookie vcView, HWND *phwnd); STDMETHODIMP InsertTextAtSelection(DWORD dwFlags, const WCHAR *pchText, ULONG cch, LONG *pacpStart, LONG *pacpEnd, TS_TEXTCHANGE *pChange); STDMETHODIMP InsertEmbeddedAtSelection(DWORD dwFlags, IDataObject *pDataObject, LONG *pacpStart, LONG *pacpEnd, TS_TEXTCHANGE *pChange); };
HRESULT hr;
ITextStoreACP *ptsiACP;
hr = punk->QueryInterface(IID_ITextStoreACP, (void **)&ptsiACP);
Requirements
|
Minimum supported client |
Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows 2000 Server [desktop apps only] |
|
Redistributable |
TSF 1.0 on Windows 2000 Professional |
|
Header |
|
|
IDL |
|
|
DLL |
|
See also