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.

166 lines
5.3 KiB

  1. #ifndef _CONFLNK_HPP_
  2. #define _CONFLNK_HPP_
  3. // ConfLink flags
  4. typedef enum _conflnkflags
  5. {
  6. CONFLNK_FL_DIRTY = 0x0001,
  7. ALL_CONFLNK_FLAGS = CONFLNK_FL_DIRTY
  8. }
  9. CONFLNKFLAGS;
  10. class CConfLink :
  11. public RefCount,
  12. public IDataObject,
  13. public IPersistFile,
  14. public IPersistStream,
  15. public IShellExtInit,
  16. // public IShellPropSheetExt,
  17. public IConferenceLink
  18. {
  19. private:
  20. DWORD m_dwFlags;
  21. DWORD m_dwTransport;
  22. DWORD m_dwCallFlags;
  23. PSTR m_pszFile;
  24. PSTR m_pszName;
  25. PSTR m_pszAddress;
  26. PSTR m_pszRemoteConfName;
  27. // Data transfer
  28. DWORD STDMETHODCALLTYPE GetFileContentsSize(void);
  29. HRESULT STDMETHODCALLTYPE TransferFileContents(PFORMATETC pfmtetc, PSTGMEDIUM pstgmed);
  30. #if 0
  31. HRESULT STDMETHODCALLTYPE TransferText(PFORMATETC pfmtetc, PSTGMEDIUM pstgmed);
  32. HRESULT STDMETHODCALLTYPE TransferFileGroupDescriptor(PFORMATETC pfmtetc, PSTGMEDIUM pstgmed);
  33. HRESULT STDMETHODCALLTYPE TransferConfLink(PFORMATETC pfmtetc, PSTGMEDIUM pstgmed);
  34. #endif // 0
  35. public:
  36. CConfLink(OBJECTDESTROYEDPROC);
  37. ~CConfLink(void);
  38. // IDataObject methods
  39. HRESULT STDMETHODCALLTYPE GetData(PFORMATETC pfmtetcIn, PSTGMEDIUM pstgmed);
  40. HRESULT STDMETHODCALLTYPE GetDataHere(PFORMATETC pfmtetc, PSTGMEDIUM pstgpmed);
  41. HRESULT STDMETHODCALLTYPE QueryGetData(PFORMATETC pfmtetc);
  42. HRESULT STDMETHODCALLTYPE GetCanonicalFormatEtc(PFORMATETC pfmtetcIn, PFORMATETC pfmtetcOut);
  43. HRESULT STDMETHODCALLTYPE SetData(PFORMATETC pfmtetc, PSTGMEDIUM pstgmed, BOOL bRelease);
  44. HRESULT STDMETHODCALLTYPE EnumFormatEtc(DWORD dwDirection, PIEnumFORMATETC *ppienumFormatEtc);
  45. HRESULT STDMETHODCALLTYPE DAdvise(PFORMATETC pfmtetc, DWORD dwAdviseFlags, PIAdviseSink piadvsink, PDWORD pdwConnection);
  46. HRESULT STDMETHODCALLTYPE DUnadvise(DWORD dwConnection);
  47. HRESULT STDMETHODCALLTYPE EnumDAdvise(PIEnumSTATDATA *ppienumStatData);
  48. // IPersist methods
  49. HRESULT STDMETHODCALLTYPE GetClassID(PCLSID pclsid);
  50. // IPersistFile methods
  51. HRESULT STDMETHODCALLTYPE IsDirty(void);
  52. HRESULT STDMETHODCALLTYPE Save(LPCOLESTR pcwszFileName, BOOL bRemember);
  53. HRESULT STDMETHODCALLTYPE SaveCompleted(LPCOLESTR pcwszFileName);
  54. HRESULT STDMETHODCALLTYPE Load(LPCOLESTR pcwszFileName, DWORD dwMode);
  55. HRESULT STDMETHODCALLTYPE GetCurFile(LPOLESTR *ppwszFileName);
  56. // IPersistStream methods
  57. HRESULT STDMETHODCALLTYPE Save(PIStream pistr, BOOL bClearDirty);
  58. HRESULT STDMETHODCALLTYPE Load(PIStream pistr);
  59. HRESULT STDMETHODCALLTYPE GetSizeMax(PULARGE_INTEGER pcbSize);
  60. // IShellExtInit methods
  61. HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pcidlFolder, LPDATAOBJECT pidobj, HKEY hkeyProgID);
  62. // IShellPropSheetExt methods
  63. // HRESULT STDMETHODCALLTYPE AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam);
  64. // HRESULT STDMETHODCALLTYPE ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplaceWith, LPARAM lParam);
  65. // IConferenceLink methods
  66. HRESULT STDMETHODCALLTYPE SetName(PCSTR pcszName);
  67. HRESULT STDMETHODCALLTYPE GetName(PSTR *ppszName);
  68. HRESULT STDMETHODCALLTYPE SetAddress(PCSTR pcszAddress);
  69. HRESULT STDMETHODCALLTYPE GetAddress(PSTR *ppszAddress);
  70. HRESULT STDMETHODCALLTYPE SetRemoteConfName(PCSTR pcszRemoteConfName);
  71. HRESULT STDMETHODCALLTYPE GetRemoteConfName(PSTR *ppszRemoteConfName);
  72. HRESULT STDMETHODCALLTYPE SetCallFlags(DWORD dwCallFlags);
  73. HRESULT STDMETHODCALLTYPE GetCallFlags(DWORD *pdwCallFlags);
  74. HRESULT STDMETHODCALLTYPE SetTransport(DWORD dwTransport);
  75. HRESULT STDMETHODCALLTYPE GetTransport(DWORD *pdwTransport);
  76. HRESULT STDMETHODCALLTYPE InvokeCommand(PCLINVOKECOMMANDINFO pclici);
  77. // IUnknown methods
  78. HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *ppvObj);
  79. ULONG STDMETHODCALLTYPE AddRef(void);
  80. ULONG STDMETHODCALLTYPE Release(void);
  81. // other methods
  82. HRESULT STDMETHODCALLTYPE SaveToFile(PCSTR pcszFile, BOOL bRemember);
  83. HRESULT STDMETHODCALLTYPE LoadFromFile(PCSTR pcszFile, BOOL bRemember);
  84. HRESULT STDMETHODCALLTYPE GetCurFile(PSTR pszFile, UINT ucbLen);
  85. HRESULT STDMETHODCALLTYPE Dirty(BOOL bDirty);
  86. #ifdef DEBUG
  87. void STDMETHODCALLTYPE Dump(void);
  88. #endif
  89. // friends
  90. #ifdef DEBUG
  91. friend BOOL IsValidPCConfLink(const CConfLink *pcConfLink);
  92. #endif
  93. };
  94. HRESULT
  95. shellCallto
  96. (
  97. const TCHAR * const url,
  98. const bool notifyOnError
  99. );
  100. DECLARE_STANDARD_TYPES(CConfLink);
  101. // in dataobj.cpp:
  102. PUBLIC_CODE BOOL InitDataObjectModule(void);
  103. // in conflnk.cpp:
  104. PUBLIC_CODE BOOL AnyMeat(PCSTR pcsz);
  105. PUBLIC_CODE BOOL DataCopy(PCBYTE pcbyteSrc, ULONG ulcbLen, PBYTE *ppbyteDest);
  106. PUBLIC_CODE BOOL StringCopy(PCSTR pcszSrc, PSTR *ppszCopy);
  107. PUBLIC_CODE void MyLStrCpyN(PSTR pszDest, PCSTR pcszSrc, int ncb);
  108. PUBLIC_CODE BOOL GetConfLinkDefaultVerb(PSTR pszDefaultVerbBuf,
  109. UINT ucDefaultVerbBufLen);
  110. PUBLIC_CODE LRESULT GetRegKeyValue(HKEY hkeyParent, PCSTR pcszSubKey,
  111. PCSTR pcszValue, PDWORD pdwValueType,
  112. PBYTE pbyteBuf, PDWORD pdwcbBufLen);
  113. PUBLIC_CODE LRESULT GetRegKeyStringValue( HKEY hkeyParent, PCSTR pcszSubKey,
  114. PCSTR pcszValue, PSTR pszBuf,
  115. PDWORD pdwcbBufLen);
  116. PUBLIC_CODE LRESULT GetDefaultRegKeyValue( HKEY hkeyParent, PCSTR pcszSubKey,
  117. PSTR pszBuf, PDWORD pdwcbBufLen);
  118. PUBLIC_CODE BOOL GetClassDefaultVerb( PCSTR pcszClass, PSTR pszDefaultVerbBuf,
  119. UINT ucDefaultVerbBufLen);
  120. PUBLIC_CODE HRESULT MyReleaseStgMedium(PSTGMEDIUM pstgmed);
  121. extern "C"
  122. {
  123. void WINAPI OpenConfLink(HWND hwndParent, HINSTANCE hinst, PSTR pszCmdLine, int nShowCmd);
  124. }
  125. #endif // _CONFLNK_HPP_