Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
4.0 KiB

  1. // AttrStrA.h : Declaration of the CMLStrAttrAStr
  2. #ifndef __ATTRSTRA_H_
  3. #define __ATTRSTRA_H_
  4. #include "mlatl.h"
  5. #include "attrstr.h"
  6. /////////////////////////////////////////////////////////////////////////////
  7. // CMLStrAttrAStr
  8. class ATL_NO_VTABLE CMLStrAttrAStr :
  9. public CMLStrAttrStrCommon,
  10. public CComObjectRoot,
  11. public CComCoClass<CMLStrAttrAStr, &CLSID_CMLStrAttrAStr>,
  12. public IMLStrAttrAStr,
  13. public IMLangStringNotifySink,
  14. public IConnectionPointContainerImpl<CMLStrAttrAStr>,
  15. public IConnectionPointImpl<CMLStrAttrAStr, &IID_IMLStrAttrNotifySink>
  16. {
  17. typedef CMLStrAttrAStr* POWNER;
  18. public:
  19. CMLStrAttrAStr(void);
  20. DECLARE_NO_REGISTRY()
  21. BEGIN_COM_MAP(CMLStrAttrAStr)
  22. COM_INTERFACE_ENTRY(IMLStrAttr)
  23. COM_INTERFACE_ENTRY(IMLStrAttrAStr)
  24. COM_INTERFACE_ENTRY(IMLangStringNotifySink)
  25. COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
  26. END_COM_MAP()
  27. BEGIN_CONNECTION_POINT_MAP(CMLStrAttrAStr)
  28. CONNECTION_POINT_ENTRY(IID_IMLStrAttrNotifySink)
  29. END_CONNECTION_POINT_MAP()
  30. public:
  31. // IMLStrAttr
  32. STDMETHOD(SetClient)(/*[in]*/ IUnknown* pUnk);
  33. STDMETHOD(GetClient)(/*[out]*/ IUnknown** ppUnk);
  34. STDMETHOD(QueryAttr)(/*[in]*/ REFIID riid, /*[in]*/ LPARAM lParam, /*[out]*/ IUnknown** ppUnk, /*[out]*/ long* lConf);
  35. STDMETHOD(GetAttrInterface)(/*[out]*/ IID* pIID, /*[out]*/ LPARAM* plParam);
  36. STDMETHOD(SetMLStr)(/*[in]*/ long lDestPos, /*[in]*/ long lDestLen, /*[in]*/ IUnknown* pSrcMLStr, /*[in]*/ long lSrcPos, /*[in]*/ long lSrcLen);
  37. // IMLStrAttrAStr
  38. STDMETHOD(SetAStr)(/*[in]*/ long lDestPos, /*[in]*/ long lDestLen, /*[in]*/ UINT uCodePage, /*[in, size_is(cchSrc)]*/ const CHAR* pszSrc, /*[in]*/ long cchSrc, /*[out]*/ long* pcchActual, /*[out]*/ long* plActualLen);
  39. STDMETHOD(SetStrBufA)(/*[in]*/ long lDestPos, /*[in]*/ long lDestLen, /*[in]*/ UINT uCodePage, /*[in]*/ IMLangStringBufA* pSrcBuf, /*[out]*/ long* pcchActual, /*[out]*/ long* plActualLen);
  40. STDMETHOD(GetAStr)(/*[in]*/ long lSrcPos, /*[in]*/ long lSrcLen, /*[in]*/ UINT uCodePageIn, /*[out]*/ UINT* puCodePageOut, /*[out, size_is(cchDest)]*/ CHAR* pszDest, /*[in]*/ long cchDest, /*[out]*/ long* pcchActual, /*[out]*/ long* plActualLen);
  41. STDMETHOD(GetStrBufA)(/*[in]*/ long lSrcPos, /*[in]*/ long lSrcMaxLen, /*[out]*/ UINT* puDestCodePage, /*[out]*/ IMLangStringBufA** ppDestBuf, /*[out]*/ long* plDestLen);
  42. STDMETHOD(LockAStr)(/*[in]*/ long lSrcPos, /*[in]*/ long lSrcLen, /*[in]*/ long lFlags, /*[in]*/ UINT uCodePageIn, /*[in]*/ long cchRequest, /*[out]*/ UINT* puCodePageOut, /*[out, size_is(,*pcchDest)]*/ CHAR** ppszDest, /*[out]*/ long* pcchDest, /*[out]*/ long* plDestLen);
  43. STDMETHOD(UnlockAStr)(/*[in, size_is(cchSrc)]*/ const CHAR* pszSrc, /*[in]*/ long cchSrc, /*[out]*/ long* pcchActual, /*[out]*/ long* plActualLen);
  44. // IMLangStringNotifySink
  45. STDMETHOD(OnRegisterAttr)(/*[in]*/ IUnknown* pUnk);
  46. STDMETHOD(OnUnregisterAttr)(/*[in]*/ IUnknown* pUnk);
  47. STDMETHOD(OnRequestEdit)(/*[in]*/ long lDestPos, /*[in]*/ long lDestLen, /*[in]*/ long lNewLen, /*[in]*/ REFIID riid, /*[in]*/ LPARAM lParam, /*[in]*/ IUnknown* pUnk);
  48. STDMETHOD(OnCanceledEdit)(/*[in]*/ long lDestPos, /*[in]*/ long lDestLen, /*[in]*/ long lNewLen, /*[in]*/ REFIID riid, /*[in]*/ LPARAM lParam, /*[in]*/ IUnknown* pUnk);
  49. STDMETHOD(OnChanged)(/*[in]*/ long lDestPos, /*[in]*/ long lDestLen, /*[in]*/ long lNewLen, /*[in]*/ REFIID riid, /*[in]*/ LPARAM lParam, /*[in]*/ IUnknown* pUnk);
  50. protected:
  51. ~CMLStrAttrAStr(void);
  52. IMLStrAttr* GetMLStrAttr(void) {return this;}
  53. HRESULT PrepareMLangCodePages(void)
  54. {
  55. HRESULT hr = S_OK;
  56. if (!m_pMLCPs)
  57. hr = ::CoCreateInstance(CLSID_CMultiLanguage, NULL, CLSCTX_INPROC_SERVER, IID_IMLangCodePages, (void**)&m_pMLCPs);
  58. return hr;
  59. }
  60. IMLangCodePages* GetMLangCodePages(void) const {return m_pMLCPs;}
  61. HRESULT StartEndConnectionMLStr(IUnknown* const pUnk, BOOL fStart);
  62. IMLangCodePages* m_pMLCPs;
  63. IMLangString* m_pMLStr;
  64. DWORD m_dwMLStrCookie;
  65. };
  66. #endif //__ATTRSTRA_H_