' ########################################################################################
' Microsoft Windows
' File: mobsync.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
' ########################################################################################
' Library name: SyncObjects
' Version: 1.0, Locale ID = 0
' Documentation string: Microsoft Legacy Sync Objects
' Library GUID: {6E586F48-379C-459C-9BEB-624A7E8316EB}
' ########################################################################################
#IF NOT %DEF(PBX_mobsync_PBI)
#DEFINE PBX_mobsync_PBI
%EQUATE `MOBSYNC_INC = 1
'/* header files for imported files */
#INCLUDE ONCE "Legacy/COM/ObjIdl.inc"
#INCLUDE ONCE "Legacy/COM/OleIdl.inc"
#INCLUDE ONCE "Legacy/COM/ShObjIdl.inc"
'#define SYNCMGRITEMID GUID
'#define REFSYNCMGRITEMID REFGUID
'#define SYNCMGRERRORID GUID
'#define REFSYNCMGRERRORID REFGUID
%EQUATE `S_SYNCMGR_MISSINGITEMS = &H00040201 ' MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0201)
%EQUATE `S_SYNCMGR_RETRYSYNC = &H00040202 ' MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0202)
%EQUATE `S_SYNCMGR_CANCELITEM = &H00040203 ' MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0203)
%EQUATE `S_SYNCMGR_CANCELALL = &H00040204 ' MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0204)
%EQUATE `S_SYNCMGR_ITEMDELETED = &H00040210 ' MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0210)
%EQUATE `S_SYNCMGR_ENUMITEMS = &H00040211 ' MAKE_SCODE(SEVERITY_SUCCESS,FACILITY_ITF,0x0211)
$LIBID_SyncObjects = GUID$("{6E586F48-379C-459C-9BEB-624A7E8316EB}")
' ========================================================================================
' ClsIDs (Class identifiers)
' ========================================================================================
$CLSID_SyncMgr = GUID$("{6295DF27-35EE-11D1-8707-00C04FD93327}")
' ========================================================================================
' IIDs (Interface identifiers)
' ========================================================================================
$IID_ISyncMgrEnumItems = GUID$("{6295DF2A-35EE-11d1-8707-00C04FD93327}")
$IID_ISyncMgrSynchronizeCallback = GUID$("{6295DF41-35EE-11D1-8707-00C04FD93327}")
$IID_ISyncMgrSynchronize = GUID$("{6295DF40-35EE-11d1-8707-00C04FD93327}")
$IID_ISyncMgrSynchronizeInvoke = GUID$("{6295DF2C-35EE-11D1-8707-00C04FD93327}")
$IID_ISyncMgrRegister = GUID$("{6295DF42-35EE-11D1-8707-00C04FD93327}")
' ########################################################################################
' Interface name = ISyncMgrSynchronizeCallback
' IID = 6295DF41-35EE-11d1-8707-00C04FD93327
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%ISyncMgrSynchronizeCallback_INTERFACE_DEFINED)
 %ISyncMgrSynchronizeCallback_INTERFACE_DEFINED = 1
%EQUATE `SYNCMGRPROGRESSITEM_STATUSTEXT = &H0001
%EQUATE `SYNCMGRPROGRESSITEM_STATUSTYPE = &H0002
%EQUATE `SYNCMGRPROGRESSITEM_PROGVALUE = &H0004
%EQUATE `SYNCMGRPROGRESSITEM_MAXVALUE = &H0008
' enum SYNCMGRSTATUS
%EQUATE `SYNCMGRSTATUS_STOPPED = 0
%EQUATE `SYNCMGRSTATUS_SKIPPED = &H1
%EQUATE `SYNCMGRSTATUS_PENDING = &H2
%EQUATE `SYNCMGRSTATUS_UPDATING = &H3
%EQUATE `SYNCMGRSTATUS_SUCCEEDED = &H4
%EQUATE `SYNCMGRSTATUS_FAILED = &H5
%EQUATE `SYNCMGRSTATUS_PAUSED = &H6
%EQUATE `SYNCMGRSTATUS_RESUMING = &H7
%EQUATE `SYNCMGRSTATUS_UPDATING_INDETERMINATE = &H8
%EQUATE `SYNCMGRSTATUS_DELETED = &H100
' // Size = 24 bytes
TYPE SYNCMGRPROGRESSITEM DWORD
 cbSize AS DWORD
 mask AS DWORD ' UINT
 lpcStatusText AS WSTRINGZ PTR
 dwStatusType AS DWORD
 iProgValue AS LONG ' int
 iMaxValue AS LONG ' int
END TYPE
' enum SYNCMGRLOGLEVEL
%EQUATE `SYNCMGRLOGLEVEL_INFORMATION = &H1
%EQUATE `SYNCMGRLOGLEVEL_WARNING = &H2
%EQUATE `SYNCMGRLOGLEVEL_ERROR = &H3
%EQUATE `SYNCMGRLOGLEVEL_LOGLEVELMAX = &H3
%EQUATE `SYNCMGRLOGERROR_ERRORFLAGS = &H0001
%EQUATE `SYNCMGRLOGERROR_ERRORID = &H0002
%EQUATE `SYNCMGRLOGERROR_ITEMID = &H0004
' enum SYNCMGRERRORFLAGS
%EQUATE `SYNCMGRERRORFLAG_ENABLEJUMPTEXT = &H1
' // Size = 44 bytes
TYPE SYNCMGRLOGERRORINFO DWORD
 cbSize AS DWORD
 mask AS DWORD
 dwSyncMgrErrorFlags AS DWORD
 ErrorID AS GUID ' GUID
 ItemID AS GUID ' GUID
END TYPE
INTERFACE ISyncMgrSynchronizeCallback $IID_ISyncMgrSynchronizeCallback
 INHERIT IUnknown
 ' =====================================================================================
 METHOD ShowPropertiesCompleted ( ' VTable offset = 12
 BYVAL hr AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD PrepareForSyncCompleted ( ' VTable offset = 16
 BYVAL hr AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SynchronizeCompleted ( ' VTable offset = 20
 BYVAL hr AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD ShowErrorCompleted ( ' VTable offset = 24
 BYVAL hr AS LONG
 , BYVAL cItems AS DWORD
 , BYREF pItemIDs AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD EnableModeless ( ' VTable offset = 28
 BYVAL fEnable AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD Progress ( ' VTable offset = 32
 BYREF ItemID AS GUID
 , BYREF pSyncProgressItem AS SYNCMGRPROGRESSITEM
 ) AS LONG
 ' =====================================================================================
 METHOD LogError ( ' VTable offset = 36
 BYVAL dwErrorLevel AS DWORD
 , BYREF pszErrorText AS WSTRINGZ
 , BYREF pSyncLogError AS SYNCMGRLOGERRORINFO
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteLogError ( ' VTable offset = 40
 BYREF ErrorID AS GUID
 , BYVAL dwReserved AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD EstablishConnection ( ' VTable offset = 44
 BYREF pwszConnection AS WSTRINGZ
 , BYVAL dwReserved AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __ISyncMgrSynchronizeCallback_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = ISyncMgrEnumItems
' IID = 6295DF2A-35EE-11D1-8707-00C04FD93327
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%ISyncMgrEnumItems_INTERFACE_DEFINED)
 %ISyncMgrEnumItems_INTERFACE_DEFINED = 1
' enum SYNCMGRITEMFLAGS
%EQUATE `SYNCMGRITEM_HASPROPERTIES = &H1
%EQUATE `SYNCMGRITEM_TEMPORARY = &H2
%EQUATE `SYNCMGRITEM_ROAMINGUSER = &H4
%EQUATE `SYNCMGRITEM_LASTUPDATETIME = &H8
%EQUATE `SYNCMGRITEM_MAYDELETEITEM = &H10
%EQUATE `SYNCMGRITEM_HIDDEN = &H20
%EQUATE `SYNCMGRITEM_ITEMFLAGMASK = &H007F
%EQUATE `MAX_SYNCMGRITEMNAME = 128
' // Size = 296 bytes
TYPE SYNCMGRITEM DWORD
 cbSize AS DWORD
 dwFlags AS DWORD
 ItemID AS GUID ' GUID
 dwItemState AS DWORD
 hIcon AS DWORD ' HICON
 wszItemName AS WSTRINGZ * 128 ' WCHAR wszItemName[128]
 ftLastUpdate AS FILETIME ' FILETIME
END TYPE
INTERFACE ISyncMgrEnumItems $IID_ISyncMgrEnumItems
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Next ( ' VTable offset = 12
 BYVAL celt AS DWORD
 , BYREF rgelt AS SYNCMGRITEM
 , BYREF pceltFetched AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Skip ( ' VTable offset = 16
 BYVAL celt AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Reset ( ' VTable offset = 20
 ) AS LONG
 ' =====================================================================================
 METHOD Clone ( ' VTable offset = 24
 BYREF ppenum AS ISyncMgrEnumItems
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __ISyncMgrEnumItems_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = ISyncMgrSynchronize
' IID = 6295DF40-35EE-11d1-8707-00C04FD93327
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%ISyncMgrSynchronize_INTERFACE_DEFINED)
 %ISyncMgrSynchronize_INTERFACE_DEFINED = 1
' enum SYNCMGRFLAG
%EQUATE `SYNCMGRFLAG_CONNECT = &H1
%EQUATE `SYNCMGRFLAG_PENDINGDISCONNECT = &H2
%EQUATE `SYNCMGRFLAG_MANUAL = &H3
%EQUATE `SYNCMGRFLAG_IDLE = &H4
%EQUATE `SYNCMGRFLAG_INVOKE = &H5
%EQUATE `SYNCMGRFLAG_SCHEDULED = &H6
%EQUATE `SYNCMGRFLAG_EVENTMASK = &Hff
%EQUATE `SYNCMGRFLAG_SETTINGS = &H100
%EQUATE `SYNCMGRFLAG_MAYBOTHERUSER = &H200
' enum SYNCMGRHANDLERFLAGS
%EQUATE `SYNCMGRHANDLER_HASPROPERTIES = &H1
%EQUATE `SYNCMGRHANDLER_MAYESTABLISHCONNECTION = &H2
%EQUATE `SYNCMGRHANDLER_ALWAYSLISTHANDLER = &H4
%EQUATE `SYNCMGRHANDLER_HIDDEN = &H8
%EQUATE `SYNCMGRHANDLERFLAG_MASK = &H000f
%EQUATE `MAX_SYNCMGRHANDLERNAME = 32
' // Size = 76 bytes
TYPE SYNCMGRHANDLERINFO DWORD
 cbSize AS DWORD
 hIcon AS DWORD ' HICON
 SyncMgrHandlerFlags AS DWORD
 wszHandlerName AS WSTRINGZ * 32 ' WCHAR wszHandlerName[32]
END TYPE
' enum SYNCMGRITEMSTATE
%EQUATE `SYNCMGRITEMSTATE_UNCHECKED = 0
%EQUATE `SYNCMGRITEMSTATE_CHECKED = &H1
INTERFACE ISyncMgrSynchronize $IID_ISyncMgrSynchronize
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Initialize ( ' VTable offset = 12
 BYVAL dwReserved AS DWORD
 , BYVAL dwSyncMgrFlags AS DWORD
 , BYVAL cbCookie AS DWORD
 , BYVAL lpCookie AS BYTE PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetHandlerInfo ( ' VTable offset = 16
 BYREF ppSyncMgrHandlerInfo AS SYNCMGRHANDLERINFO
 ) AS LONG
 ' =====================================================================================
 METHOD EnumSyncMgrItems ( ' VTable offset = 20
 BYREF ppSyncMgrEnumItems AS ISyncMgrEnumItems
 ) AS LONG
 ' =====================================================================================
 METHOD GetItemObject ( ' VTable offset = 24
 BYREF ItemID AS GUID
 , BYREF riid AS GUID
 , BYREF ppv AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD ShowProperties ( ' VTable offset = 28
 BYVAL hWndParent AS DWORD
 , BYREF ItemID AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD SetProgressCallback ( ' VTable offset = 32
 BYVAL lpCallBack AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD PrepareForSync ( ' VTable offset = 36
 BYVAL cbNumItems AS DWORD
 , BYREF pItemIDs AS GUID
 , BYVAL hWndParent AS DWORD
 , BYVAL dwReserved AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Synchronize ( ' VTable offset = 40
 BYVAL hWndParent AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetItemStatus ( ' VTable offset = 44
 BYREF pItemID AS GUID
 , BYVAL dwSyncMgrStatus AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD ShowError ( ' VTable offset = 48
 BYVAL hWndParent AS DWORD
 , BYREF ErrorID AS GUID
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __ISyncMgrSynchronize_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = ISyncMgrSynchronizeInvoke
' IID = {6295DF2C-35EE-11D1-8707-00C04FD93327}
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%ISyncMgrSynchronizeInvoke_INTERFACE_DEFINED)
 %ISyncMgrSynchronizeInvoke_INTERFACE_DEFINED = 1
' enum SYNCMGRINVOKEFLAGS
%EQUATE `SYNCMGRINVOKE_STARTSYNC = &H2
%EQUATE `SYNCMGRINVOKE_MINIMIZED = &H4
INTERFACE ISyncMgrSynchronizeInvoke $IID_ISyncMgrSynchronizeInvoke
 INHERIT IUnknown
 ' =====================================================================================
 METHOD UpdateItems ( ' VTable offset = 12
 BYVAL dwInvokeFlags AS DWORD
 , BYREF clsid AS GUID
 , BYVAL cbCookie AS DWORD
 , BYVAL pCookie AS BYTE PTR
 ) AS LONG
 ' =====================================================================================
 METHOD UpdateAll ( ' VTable offset = 16
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __ISyncMgrSynchronizeInvoke_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = ISyncMgrRegister
' IID = 6295DF42-35EE-11D1-8707-00C04FD93327
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%ISyncMgrRegister_INTERFACE_DEFINED)
 %ISyncMgrRegister_INTERFACE_DEFINED = 1
' enum SYNCMGRREGISTERFLAGS
%EQUATE `SYNCMGRREGISTERFLAG_CONNECT = &H1
%EQUATE `SYNCMGRREGISTERFLAG_PENDINGDISCONNECT = &H2
%EQUATE `SYNCMGRREGISTERFLAG_IDLE = &H4
%EQUATE `SYNCMGRREGISTERFLAGS_MASK = &H07
INTERFACE ISyncMgrRegister $IID_ISyncMgrRegister
 INHERIT IUnknown
 ' =====================================================================================
 METHOD RegisterSyncMgrHandler ( ' VTable offset = 12
 BYREF clsidHandler AS GUID
 , BYREF pwszDescription AS WSTRINGZ
 , BYVAL dwSyncMgrRegisterFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD UnregisterSyncMgrHandler ( ' VTable offset = 16
 BYREF clsidHandler AS GUID
 , BYVAL dwReserved AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetHandlerRegistrationInfo ( ' VTable offset = 20
 BYREF clsidHandler AS GUID
 , BYREF pdwSyncMgrRegisterFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __ISyncMgrRegister_INTERFACE_DEFINED__ */
#ENDIF
