Leaked source code of windows server 2003
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.

453 lines
18 KiB

  1. //****************************************************************************
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // File: syncmgr.idl
  6. //
  7. // Contents: Interfaces for Synchronization Manager
  8. //
  9. //****************************************************************************
  10. #ifndef DO_NO_IMPORTS
  11. import "objidl.idl";
  12. import "oleidl.idl";
  13. #endif
  14. interface ISyncMgrSynchronize;
  15. interface ISyncMgrSynchronizeCallback;
  16. interface ISyncMgrEnumItems;
  17. interface ISyncMgrSynchronizeInvoke;
  18. interface ISyncMgrRegister;
  19. typedef GUID SYNCMGRITEMID;
  20. typedef REFGUID REFSYNCMGRITEMID;
  21. typedef GUID SYNCMGRERRORID;
  22. typedef REFGUID REFSYNCMGRERRORID;
  23. // {6295DF27-35EE-11d1-8707-00C04FD93327}
  24. cpp_quote("DEFINE_GUID(CLSID_SyncMgr,0x6295df27, 0x35ee, 0x11d1, 0x87, 0x7, 0x0, 0xc0, 0x4f, 0xd9, 0x33, 0x27);")
  25. // {6295DF40-35EE-11d1-8707-00C04FD93327}
  26. cpp_quote("DEFINE_GUID(IID_ISyncMgrSynchronize,0x6295df40, 0x35ee, 0x11d1, 0x87, 0x7, 0x0, 0xc0, 0x4f, 0xd9, 0x33, 0x27);")
  27. // {6295DF41-35EE-11d1-8707-00C04FD93327}
  28. cpp_quote("DEFINE_GUID(IID_ISyncMgrSynchronizeCallback,0x6295df41, 0x35ee, 0x11d1, 0x87, 0x7, 0x0, 0xc0, 0x4f, 0xd9, 0x33, 0x27);")
  29. // {6295DF42-35EE-11d1-8707-00C04FD93327}
  30. cpp_quote("DEFINE_GUID(IID_ISyncMgrRegister, 0x6295df42, 0x35ee, 0x11d1, 0x87, 0x7, 0x0, 0xc0, 0x4f, 0xd9, 0x33, 0x27);")
  31. // {6295DF2A-35EE-11d1-8707-00C04FD93327}
  32. cpp_quote("DEFINE_GUID(IID_ISyncMgrEnumItems,0x6295df2a, 0x35ee, 0x11d1, 0x87, 0x7, 0x0, 0xc0, 0x4f, 0xd9, 0x33, 0x27);")
  33. // {6295DF2C-35EE-11d1-8707-00C04FD93327}
  34. cpp_quote("DEFINE_GUID(IID_ISyncMgrSynchronizeInvoke,0x6295df2c, 0x35ee, 0x11d1, 0x87, 0x7, 0x0, 0xc0, 0x4f, 0xd9, 0x33, 0x27);")
  35. // Success codes specific to SyncMgr interfaces
  36. cpp_quote("#define S_SYNCMGR_MISSINGITEMS MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0201)")
  37. cpp_quote("#define S_SYNCMGR_RETRYSYNC MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0202)")
  38. cpp_quote("#define S_SYNCMGR_CANCELITEM MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0203)")
  39. cpp_quote("#define S_SYNCMGR_CANCELALL MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0204)")
  40. // success codes that may be returned in ShowPropertiesCompleted.
  41. cpp_quote("#define S_SYNCMGR_ITEMDELETED MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0210)")
  42. cpp_quote("#define S_SYNCMGR_ENUMITEMS MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0211)")
  43. [
  44. local,
  45. object,
  46. uuid(6295DF40-35EE-11d1-8707-00C04FD93327) // IID_ISyncMgrSynchronize
  47. ]
  48. interface ISyncMgrSynchronize: IUnknown
  49. {
  50. typedef [unique] ISyncMgrSynchronize *LPSYNCMGRSYNCHRONIZE;
  51. typedef enum _tagSYNCMGRFLAG { // flags for Synchronization Event
  52. SYNCMGRFLAG_CONNECT = 0x0001, // Sync was invoked by a network connect
  53. SYNCMGRFLAG_PENDINGDISCONNECT = 0x0002, // Sync was invoked by a pending network disconnect
  54. SYNCMGRFLAG_MANUAL = 0x0003, // Sync was invoked manually
  55. SYNCMGRFLAG_IDLE = 0x0004, // Sync was invoked by an idle event
  56. SYNCMGRFLAG_INVOKE = 0x0005, // Sync was programmatically invoked by handler
  57. SYNCMGRFLAG_SCHEDULED = 0x0006, // Sync was invoked by a scheduled update
  58. SYNCMGRFLAG_EVENTMASK = 0x00FF,
  59. SYNCMGRFLAG_SETTINGS = 0x0100, // Sync was invoked for configuration only
  60. SYNCMGRFLAG_MAYBOTHERUSER = 0x0200, // Interaction with the user is permitted
  61. } SYNCMGRFLAG;
  62. const USHORT MAX_SYNCMGRHANDLERNAME = 32;
  63. cpp_quote("#define SYNCMGRHANDLERFLAG_MASK 0x07")
  64. cpp_quote("")
  65. typedef enum _tagSYNCMGRHANDLERFLAGS { // flags that apply to this handler.
  66. SYNCMGRHANDLER_HASPROPERTIES = 0x01, // have a properties dialog for this handler
  67. SYNCMGRHANDLER_MAYESTABLISHCONNECTION = 0x02, // may call callback EstablishConnection method
  68. SYNCMGRHANDLER_ALWAYSLISTHANDLER = 0x04, // Show Handler in Choice even if not items
  69. } SYNCMGRHANDLERFLAGS;
  70. typedef struct _tagSYNCMGRHANDLERINFO {
  71. DWORD cbSize;
  72. HICON hIcon;
  73. DWORD SyncMgrHandlerFlags;
  74. WCHAR wszHandlerName[MAX_SYNCMGRHANDLERNAME];
  75. } SYNCMGRHANDLERINFO, *LPSYNCMGRHANDLERINFO;
  76. cpp_quote("#define SYNCMGRITEMSTATE_UNCHECKED 0x0000")
  77. cpp_quote("#define SYNCMGRITEMSTATE_CHECKED 0x0001")
  78. cpp_quote("")
  79. typedef enum _tagSYNCMGRSTATUS {
  80. SYNCMGRSTATUS_STOPPED = 0x0000,
  81. SYNCMGRSTATUS_SKIPPED = 0x0001,
  82. SYNCMGRSTATUS_PENDING = 0x0002,
  83. SYNCMGRSTATUS_UPDATING = 0x0003,
  84. SYNCMGRSTATUS_SUCCEEDED = 0x0004,
  85. SYNCMGRSTATUS_FAILED = 0x0005,
  86. SYNCMGRSTATUS_PAUSED = 0x0006,
  87. SYNCMGRSTATUS_RESUMING = 0x0007,
  88. SYNCMGRSTATUS_DELETED = 0x0100, // send to indicate to item that the item has been deleted.
  89. } SYNCMGRSTATUS;
  90. HRESULT Initialize(
  91. [in] DWORD dwReserved,
  92. [in] DWORD dwSyncMgrFlags,
  93. [in] DWORD cbCookie,
  94. [in, unique, size_is(cbCookie)] BYTE const*lpCookie);
  95. HRESULT GetHandlerInfo(
  96. [out] LPSYNCMGRHANDLERINFO *ppSyncMgrHandlerInfo);
  97. HRESULT EnumSyncMgrItems(
  98. [out] ISyncMgrEnumItems **ppSyncMgrEnumItems);
  99. HRESULT GetItemObject(
  100. [in] REFSYNCMGRITEMID ItemID,
  101. [in] REFIID riid,
  102. [out, iid_is(riid)] void** ppv);
  103. HRESULT ShowProperties(
  104. [in] HWND hWndParent,
  105. [in] REFSYNCMGRITEMID ItemID);
  106. HRESULT SetProgressCallback(
  107. [in,unique] ISyncMgrSynchronizeCallback *lpCallBack);
  108. HRESULT PrepareForSync(
  109. [in] ULONG cbNumItems,
  110. [in, size_is(cbNumItems)] SYNCMGRITEMID* pItemIDs,
  111. [in] HWND hWndParent,
  112. [in] DWORD dwReserved);
  113. HRESULT Synchronize(
  114. [in] HWND hWndParent);
  115. HRESULT SetItemStatus(
  116. [in] REFSYNCMGRITEMID pItemID,
  117. [in] DWORD dwSyncMgrStatus);
  118. HRESULT ShowError(
  119. [in] HWND hWndParent,
  120. [in] REFSYNCMGRERRORID ErrorID);
  121. }
  122. [
  123. local,
  124. object,
  125. uuid(6295DF41-35EE-11d1-8707-00C04FD93327) // IID_ISyncMgrSynchronizeCallback
  126. ]
  127. interface ISyncMgrSynchronizeCallback: IUnknown
  128. {
  129. typedef [unique] ISyncMgrSynchronizeCallback *LPSYNCMGRSYNCHRONIZECALLBACK;
  130. cpp_quote("#define SYNCMGRPROGRESSITEM_STATUSTEXT 0x0001")
  131. cpp_quote("#define SYNCMGRPROGRESSITEM_STATUSTYPE 0x0002")
  132. cpp_quote("#define SYNCMGRPROGRESSITEM_PROGVALUE 0x0004")
  133. cpp_quote("#define SYNCMGRPROGRESSITEM_MAXVALUE 0x0008")
  134. cpp_quote("")
  135. typedef struct _tagSYNCMGRPROGRESSITEM {
  136. DWORD cbSize;
  137. UINT mask;
  138. LPCWSTR lpcStatusText;
  139. DWORD dwStatusType;
  140. INT iProgValue;
  141. INT iMaxValue;
  142. } SYNCMGRPROGRESSITEM, *LPSYNCMGRPROGRESSITEM;
  143. typedef enum _tagSYNCMGRLOGLEVEL {
  144. SYNCMGRLOGLEVEL_INFORMATION = 0x0001,
  145. SYNCMGRLOGLEVEL_WARNING = 0x0002,
  146. SYNCMGRLOGLEVEL_ERROR = 0x0003,
  147. } SYNCMGRLOGLEVEL;
  148. cpp_quote("#define SYNCMGRLOGERROR_ERRORFLAGS 0x0001")
  149. cpp_quote("#define SYNCMGRLOGERROR_ERRORID 0x0002")
  150. cpp_quote("#define SYNCMGRLOGERROR_ITEMID 0x0004")
  151. cpp_quote("")
  152. typedef enum _tagSYNCMGRERRORFLAGS { // flags that apply to the error.
  153. SYNCMGRERRORFLAG_ENABLEJUMPTEXT = 0x01, // ShowErrors should be called on this item.
  154. } SYNCMGRERRORFLAGS;
  155. typedef struct _tagSYNCMGRLOGERRORINFO {
  156. DWORD cbSize;
  157. DWORD mask;
  158. DWORD dwSyncMgrErrorFlags;
  159. SYNCMGRERRORID ErrorID;
  160. SYNCMGRITEMID ItemID;
  161. } SYNCMGRLOGERRORINFO, *LPSYNCMGRLOGERRORINFO;
  162. HRESULT ShowPropertiesCompleted(
  163. [in] HRESULT hr);
  164. HRESULT PrepareForSyncCompleted(
  165. [in] HRESULT hr);
  166. HRESULT SynchronizeCompleted(
  167. [in] HRESULT hr);
  168. HRESULT ShowErrorCompleted(
  169. [in] HRESULT hr,
  170. [in] ULONG cbNumItems,
  171. [in,unique,size_is(cbNumItems)] SYNCMGRITEMID *pItemIDs);
  172. HRESULT EnableModeless(
  173. [in] BOOL fEnable);
  174. HRESULT Progress(
  175. [in] REFSYNCMGRITEMID pItemID,
  176. [in,unique] LPSYNCMGRPROGRESSITEM lpSyncProgressItem);
  177. HRESULT LogError(
  178. [in] DWORD dwErrorLevel,
  179. [in] LPCWSTR lpcErrorText,
  180. [in,unique] LPSYNCMGRLOGERRORINFO lpSyncLogError);
  181. HRESULT DeleteLogError(
  182. [in] REFSYNCMGRERRORID ErrorID,
  183. [in] DWORD dwReserved);
  184. HRESULT EstablishConnection(
  185. [in,unique] LPCWSTR lpwszConnection,
  186. [in] DWORD dwReserved);
  187. }
  188. [
  189. local,
  190. object,
  191. uuid(6295DF2A-35EE-11d1-8707-00C04FD93327), // IID_ISyncMgrEnumItems
  192. pointer_default(unique)
  193. ]
  194. interface ISyncMgrEnumItems : IUnknown
  195. {
  196. typedef [unique] ISyncMgrEnumItems *LPSYNCMGRENUMITEMS;
  197. cpp_quote("#define SYNCMGRITEM_ITEMFLAGMASK 0x1F")
  198. const USHORT MAX_SYNCMGRITEMNAME = 128;
  199. typedef enum _tagSYNCMGRITEMFLAGS { // flags for this SyncMgr Item
  200. SYNCMGRITEM_HASPROPERTIES = 0x01, // have a properties dialog for this item
  201. SYNCMGRITEM_TEMPORARY = 0x02, // remove any stored preferences for this item
  202. SYNCMGRITEM_ROAMINGUSER = 0x04, // This item should roam with the User
  203. SYNCMGRITEM_LASTUPDATETIME = 0x08, // Indicates lastUpdateTime Field is valid
  204. SYNCMGRITEM_MAYDELETEITEM = 0x10, // Indicates Item can be deleted fron SyncMgr UI
  205. } SYNCMGRITEMFLAGS;
  206. typedef struct _tagSYNCMGRITEM {
  207. DWORD cbSize;
  208. DWORD dwFlags;
  209. SYNCMGRITEMID ItemID;
  210. DWORD dwItemState;
  211. HICON hIcon;
  212. WCHAR wszItemName[MAX_SYNCMGRITEMNAME];
  213. FILETIME ftLastUpdate;
  214. } SYNCMGRITEM, *LPSYNCMGRITEM;
  215. HRESULT Next(
  216. [in] ULONG celt,
  217. [out, size_is(celt), length_is(*pceltFetched)]
  218. LPSYNCMGRITEM rgelt,
  219. [out] ULONG *pceltFetched);
  220. HRESULT Skip(
  221. [in] ULONG celt);
  222. HRESULT Reset();
  223. HRESULT Clone(
  224. [out] ISyncMgrEnumItems **ppenum);
  225. }
  226. [
  227. local,
  228. object,
  229. uuid(6295DF2C-35EE-11d1-8707-00C04FD93327), // IID_ISyncMgrSynchronizeInvoke
  230. pointer_default(unique)
  231. ]
  232. interface ISyncMgrSynchronizeInvoke : IUnknown
  233. {
  234. typedef [unique] ISyncMgrSynchronizeInvoke *LPSYNCMGRSYNCHRONIZEINVOKE;
  235. typedef enum _tagSYNCMGRINVOKEFLAGS { // flags for how SyncMgr should be invoked.
  236. SYNCMGRINVOKE_STARTSYNC = 0x02, // Immediately start the sync without displaying choices
  237. SYNCMGRINVOKE_MINIMIZED = 0x04, // Dialog should be minimized by default
  238. } SYNCMGRINVOKEFLAGS;
  239. HRESULT UpdateItems(
  240. [in] DWORD dwInvokeFlags,
  241. [in] REFCLSID rclsid,
  242. [in] DWORD cbCookie,
  243. [in, unique, size_is(cbCookie)] const BYTE *lpCookie);
  244. HRESULT UpdateAll();
  245. }
  246. [
  247. local,
  248. object,
  249. uuid(6295DF42-35EE-11d1-8707-00C04FD93327), // IID_ISyncMgrSynchronizeRegister
  250. pointer_default(unique)
  251. ]
  252. interface ISyncMgrRegister : IUnknown
  253. {
  254. typedef [unique] ISyncMgrRegister *LPSYNCMGRREGISTER;
  255. cpp_quote("#define SYNCMGRREGISTERFLAGS_MASK 0x07")
  256. cpp_quote("")
  257. typedef enum _tagSYNCMGRREGISTERFLAGS {
  258. SYNCMGRREGISTERFLAG_CONNECT = 0x01, // Register to receive Connect Events
  259. SYNCMGRREGISTERFLAG_PENDINGDISCONNECT = 0x02, // Register to receive PendingDisconnect Events
  260. SYNCMGRREGISTERFLAG_IDLE = 0x04, // Register to receive Idle Events
  261. } SYNCMGRREGISTERFLAGS;
  262. HRESULT RegisterSyncMgrHandler(
  263. [in] REFCLSID rclsidHandler,
  264. [in,unique] LPCWSTR pwszDescription,
  265. [in] DWORD dwSyncMgrRegisterFlags);
  266. HRESULT UnregisterSyncMgrHandler(
  267. [in] REFCLSID rclsidHandler,
  268. [in] DWORD dwReserved);
  269. HRESULT GetHandlerRegistrationInfo(
  270. [in] REFCLSID rclsidHandler,
  271. [in,out] LPDWORD pdwSyncMgrRegisterFlags);
  272. }
  273. [
  274. uuid(6295DF27-35EE-11d1-8707-00C04FD93327),
  275. helpstring("Common Synchronization UI service")
  276. ]
  277. coclass SyncMgr
  278. {
  279. [default, source] interface ISyncMgrSynchronizeInvoke;
  280. };
  281. cpp_quote("")
  282. cpp_quote("// Declarations for Conflict resolution dialog ")
  283. cpp_quote("")
  284. cpp_quote("// Flags ")
  285. cpp_quote("#define RFCF_APPLY_ALL 0x0001 ")
  286. cpp_quote("")
  287. // If we require any of the elements in the dialog box, we can call the
  288. // caller back via the callback function and specify what we want
  289. cpp_quote("// Parameter values for RFCCM_NEEDELEMENT (unimplemented)")
  290. cpp_quote("#define RFCD_NAME 0x0001 ")
  291. cpp_quote("#define RFCD_KEEPBOTHICON 0x0002 ")
  292. cpp_quote("#define RFCD_KEEPLOCALICON 0x0004 ")
  293. cpp_quote("#define RFCD_KEEPSERVERICON 0x0008 ")
  294. cpp_quote("#define RFCD_NETWORKMODIFIEDBY 0x0010 ")
  295. cpp_quote("#define RFCD_NETWORKMODIFIEDON 0x0020 ")
  296. cpp_quote("#define RFCD_LOCALMODIFIEDBY 0x0040 ")
  297. cpp_quote("#define RFCD_LOCALMODIFIEDON 0x0080 ")
  298. cpp_quote("#define RFCD_NEWNAME 0x0100 ")
  299. cpp_quote("#define RFCD_LOCATION 0x0200 ")
  300. cpp_quote("#define RFCD_ALL 0x03FF ")
  301. cpp_quote("")
  302. // User clicks the view button. This is the message sent to the caller
  303. // via the callback
  304. cpp_quote("// Callback Messages ")
  305. cpp_quote("#define RFCCM_VIEWLOCAL 0x0001 ")
  306. cpp_quote("#define RFCCM_VIEWNETWORK 0x0002 ")
  307. cpp_quote("#define RFCCM_NEEDELEMENT 0x0003 ")
  308. cpp_quote("")
  309. cpp_quote("// Return values ")
  310. cpp_quote("#define RFC_CANCEL 0x00 ")
  311. cpp_quote("#define RFC_KEEPBOTH 0x01 ")
  312. cpp_quote("#define RFC_KEEPLOCAL 0x02 ")
  313. cpp_quote("#define RFC_KEEPNETWORK 0x03 ")
  314. cpp_quote("#define RFC_APPLY_TO_ALL 0x10 ")
  315. cpp_quote("")
  316. cpp_quote("typedef BOOL (WINAPI *PFNRFCDCALLBACK)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);")
  317. cpp_quote("")
  318. cpp_quote("typedef struct tagRFCDLGPARAMW { ")
  319. cpp_quote(" DWORD dwFlags; // RFCF_* ")
  320. cpp_quote(" LPCWSTR pszFilename; // File name of the file conflicted ")
  321. cpp_quote(" LPCWSTR pszLocation; // Location of the file ")
  322. cpp_quote(" LPCWSTR pszNewName; // The new name to give the file ")
  323. cpp_quote(" LPCWSTR pszNetworkModifiedBy; // Name of person who changed the net doc ")
  324. cpp_quote(" LPCWSTR pszLocalModifiedBy; // Name of person who changed the local doc ")
  325. cpp_quote(" LPCWSTR pszNetworkModifiedOn; // When the net doc was changed ")
  326. cpp_quote(" LPCWSTR pszLocalModifiedOn; // When the local doc was changed ")
  327. cpp_quote(" HICON hIKeepBoth; // Icon ")
  328. cpp_quote(" HICON hIKeepLocal; // ")
  329. cpp_quote(" HICON hIKeepNetwork; // ")
  330. cpp_quote(" PFNRFCDCALLBACK pfnCallBack; // Callback ")
  331. cpp_quote(" LPARAM lCallerData; // Place where the caller can keep some context data")
  332. cpp_quote("} RFCDLGPARAMW;")
  333. cpp_quote("")
  334. cpp_quote("typedef struct tagRFCDLGPARAMA {")
  335. cpp_quote(" DWORD dwFlags; // RFCF_* ")
  336. cpp_quote(" LPCSTR pszFilename; // File name of the file conflicted ")
  337. cpp_quote(" LPCSTR pszLocation; // Location of the file ")
  338. cpp_quote(" LPCSTR pszNewName; // The new name to give the file ")
  339. cpp_quote(" LPCSTR pszNetworkModifiedBy; // Name of person who changed the net doc ")
  340. cpp_quote(" LPCSTR pszLocalModifiedBy; // Name of person who changed the local doc ")
  341. cpp_quote(" LPCSTR pszNetworkModifiedOn; // When the net doc was changed ")
  342. cpp_quote(" LPCSTR pszLocalModifiedOn; // When the local doc was changed ")
  343. cpp_quote(" HICON hIKeepBoth; // Icon ")
  344. cpp_quote(" HICON hIKeepLocal; // ")
  345. cpp_quote(" HICON hIKeepNetwork; // ")
  346. cpp_quote(" PFNRFCDCALLBACK pfnCallBack; // Callback ")
  347. cpp_quote(" LPARAM lCallerData; // Place where the caller can keep some context data")
  348. cpp_quote("} RFCDLGPARAMA;")
  349. cpp_quote("")
  350. cpp_quote("")
  351. cpp_quote("int WINAPI SyncMgrResolveConflictW(HWND hWndParent, RFCDLGPARAMW *pdlgParam);")
  352. cpp_quote("int WINAPI SyncMgrResolveConflictA(HWND hWndParent, RFCDLGPARAMA *pdlgParam);")
  353. cpp_quote("")
  354. cpp_quote("#ifdef UNICODE ")
  355. cpp_quote("#define SyncMgrResolveConflict SyncMgrResolveConflictW ")
  356. cpp_quote("#define RFCDLGPARAM RFCDLGPARAMW ")
  357. cpp_quote("#else ")
  358. cpp_quote("#define SyncMgrResolveConflict SyncMgrResolveConflictA ")
  359. cpp_quote("#define RFCDLGPARAM RFCDLGPARAMA ")
  360. cpp_quote("#endif // !UNICODE ")
  361. cpp_quote("")