Files
admin
base
com
developer
drivers
ds
enduser
inetcore
inetsrv
loc
mergedcomponents
multimedia
net
printscan
public
published
sdktools
shell
termsrv
tools
windows
advcore
appcompat
core
ddk
dload
feime
chnuconv
chs
cht
ddk
fe
jpn
kor
ime2k
cicerolib
inc
catutil.h
ccstock.h
cleanup.h
cmydc.h
computil.h
cuilib.h
dap.h
dbgid.h
debug.h
dispattr.h
editcb.h
fnprbase.h
globals.h
helpers.h
iconlib.h
icrtfree.h
immxutil.h
insert.h
kes.h
makefile
mem.h
mes.h
mscandui.idl
msctfp.idl
nuibase.h
osver.h
proj.h
proputil.h
ptrary.h
regimx.h
regsvr.h
sdo.h
slbarid.h
softkbd.h
softkbd.idl
sources
statsink.h
strary.h
tes.h
timsink.h
validate.h
xstring.h
src
dirs
dicts
doc
embedded
fecommon
hanjadic
help
hwx
imkrinst
imm32
inc
ntmigexe
setup
tip
version
common.inc
dirs
johab
res
uhc
uniime
wansung
dirs
escape.c
hangeul.h
hatmt.c
hatmt.h
hkeytbl.c
imeui.c
main.c
tools
usa
dirs
netdde
oleacc
published
richedit
winstate
dirs
project.mk
dirs
makefil0
2025-04-27 07:49:33 -04:00

121 lines
3.1 KiB
C++

//
// dispattr.h
//
#ifndef DISPATTR_H
#define DISPATTR_H
#include "strary.h"
#include "ctffunc.h"
typedef struct tagDISPATTRPROP {
GUID guid;
} DISPATTRPROP;
class CDispAttrPropCache
{
public:
CDispAttrPropCache() {}
void Add(REFGUID rguid)
{
if (!FindGuid(rguid))
{
int i = Count();
_rgDispAttrProp.Insert(i, 1);
DISPATTRPROP *pProp = _rgDispAttrProp.GetPtr(i);
pProp->guid = rguid;
}
}
void Remove(REFGUID rguid)
{
int nCnt = _rgDispAttrProp.Count();
int i;
for (i = 0; i < nCnt; i++)
{
DISPATTRPROP *pProp = _rgDispAttrProp.GetPtr(i);
if (IsEqualGUID(pProp->guid, rguid))
{
_rgDispAttrProp.Remove(i, 1);
return;
}
}
}
BOOL FindGuid(REFGUID rguid)
{
int nCnt = _rgDispAttrProp.Count();
int i;
for (i = 0; i < nCnt; i++)
{
DISPATTRPROP *pProp = _rgDispAttrProp.GetPtr(i);
if (IsEqualGUID(pProp->guid, rguid))
{
return TRUE;
}
}
return FALSE;
}
int Count()
{
return _rgDispAttrProp.Count();
}
GUID *GetPropTable()
{
return (GUID *)_rgDispAttrProp.GetPtr(0);
}
CStructArray<DISPATTRPROP> _rgDispAttrProp;
};
ITfDisplayAttributeMgr *GetDAMLib(LIBTHREAD *plt);
HRESULT InitDisplayAttrbuteLib(LIBTHREAD *plt);
HRESULT UninitDisplayAttrbuteLib(LIBTHREAD *plt);
HRESULT GetDisplayAttributeTrackPropertyRange(TfEditCookie ec, ITfContext *pic, ITfRange *pRange, ITfReadOnlyProperty **ppProp, IEnumTfRanges **ppEnum, ULONG *pulNumProp);
HRESULT GetDisplayAttributeData(LIBTHREAD *plt, TfEditCookie ec, ITfReadOnlyProperty *pProp, ITfRange *pRange, TF_DISPLAYATTRIBUTE *pda, TfClientId *pguid, ULONG ulNumProp);
HRESULT GetReconversionFromDisplayAttribute(LIBTHREAD *plt, TfEditCookie ec, ITfThreadMgr *ptim, ITfContext *pic, ITfRange *pRange, ITfFnReconversion **ppReconv, ITfDisplayAttributeMgr *pDAM);
HRESULT GetAttributeColor(TF_DA_COLOR *pdac, COLORREF *pcr);
HRESULT SetAttributeColor(TF_DA_COLOR *pdac, COLORREF cr);
HRESULT SetAttributeSysColor(TF_DA_COLOR *pdac, int nIndex);
HRESULT ClearAttributeColor(TF_DA_COLOR *pdac);
typedef HRESULT (*DANSCALLBACK)(void *pv);
class CDisplayAttributeNotifySink : public ITfDisplayAttributeNotifySink
{
public:
CDisplayAttributeNotifySink(DANSCALLBACK pfnCallback, void *pv);
//
// IUnknown methods
//
STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
STDMETHODIMP_(ULONG) AddRef(void);
STDMETHODIMP_(ULONG) Release(void);
//
// ITfDisplayAttributeNotifySink
//
STDMETHODIMP OnUpdateInfo();
HRESULT _Advise(ITfThreadMgr *ptim);
HRESULT _Unadvise();
private:
long _cRef;
ITfThreadMgr *_ptim;
DWORD _dwCookie;
DANSCALLBACK _pfnCallback;
void *_pv;
};
#endif // DISPATTR_H