home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / MSINC.PAK / RECONCIL.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  6KB  |  202 lines

  1. /*
  2.  * reconcil.h - OLE reconciliation interface definitions.
  3.  */
  4.  
  5.  
  6. #ifndef __RECONCIL_H__
  7. #define __RECONCIL_H__
  8.  
  9.  
  10. /* Headers
  11.  **********/
  12.  
  13. #include <recguids.h>
  14.  
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {                        /* Assume C declarations for C++. */
  18. #endif   /* __cplusplus */
  19.  
  20.  
  21. /* Constants
  22.  ************/
  23.  
  24. /* for use in IStorage::SetStateBits() */
  25.  
  26. #define STATEBITS_FLAT                 (0x0001)
  27.  
  28. /* reconciliation SCODEs */
  29.  
  30. #define REC_S_IDIDTHEUPDATES           MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x1000)
  31. #define REC_S_NOTCOMPLETE              MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x1001)
  32. #define REC_S_NOTCOMPLETEBUTPROPAGATE  MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_ITF, 0x1002)
  33.  
  34. #define REC_E_ABORTED                  MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x1000)
  35. #define REC_E_NOCALLBACK               MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x1001)
  36. #define REC_E_NORESIDUES               MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x1002)
  37. #define REC_E_TOODIFFERENT             MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x1003)
  38. #define REC_E_INEEDTODOTHEUPDATES      MAKE_SCODE(SEVERITY_ERROR,   FACILITY_ITF, 0x1004)
  39.  
  40.  
  41. /* Interfaces
  42.  *************/
  43.  
  44. #undef  INTERFACE
  45. #define INTERFACE INotifyReplica
  46.  
  47. DECLARE_INTERFACE_(INotifyReplica, IUnknown)
  48. {
  49.    /* IUnknown methods */
  50.  
  51.    STDMETHOD(QueryInterface)(THIS_
  52.                              REFIID riid,
  53.                              PVOID *ppvObject) PURE;
  54.  
  55.    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  56.  
  57.    STDMETHOD_(ULONG, Release)(THIS) PURE;
  58.  
  59.    /* INotifyReplica methods */
  60.  
  61.    STDMETHOD(YouAreAReplica)(THIS_
  62.                              ULONG ulcOtherReplicas,
  63.                              IMoniker **rgpmkOtherReplicas) PURE;
  64. };
  65.  
  66. #undef  INTERFACE
  67. #define INTERFACE IReconcileInitiator
  68.  
  69. DECLARE_INTERFACE_(IReconcileInitiator, IUnknown)
  70. {
  71.    /* IUnknown methods */
  72.  
  73.    STDMETHOD(QueryInterface)(THIS_
  74.                              REFIID riid,
  75.                              PVOID *ppvObject) PURE;
  76.  
  77.    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  78.  
  79.    STDMETHOD_(ULONG, Release)(THIS) PURE;
  80.  
  81.    /* IReconcileInitiator methods */
  82.  
  83.    STDMETHOD(SetAbortCallback)(THIS_
  84.                                IUnknown *punkForAbort) PURE;
  85.  
  86.    STDMETHOD(SetProgressFeedback)(THIS_
  87.                                   ULONG ulProgress,
  88.                                   ULONG ulProgressMax) PURE;
  89. };
  90.  
  91. /* IReconcilableObject::Reconcile() flags */
  92.  
  93. typedef enum _reconcilef
  94. {
  95.    /* interaction with the user is allowed */
  96.  
  97.    RECONCILEF_MAYBOTHERUSER         = 0x0001,
  98.  
  99.    /*
  100.     * hwndProgressFeedback may be used to provide reconciliation progress
  101.     * feedback to the user.
  102.     */
  103.  
  104.    RECONCILEF_FEEDBACKWINDOWVALID   = 0x0002,
  105.  
  106.    /* residue support not required */
  107.  
  108.    RECONCILEF_NORESIDUESOK          = 0x0004,
  109.  
  110.    /* caller not interested in callee's residues */
  111.  
  112.    RECONCILEF_OMITSELFRESIDUE       = 0x0008,
  113.  
  114.    /*
  115.     * Reconcile() call resuming after a previous Reconcile() call returned
  116.     * REC_E_NOTCOMPLETE
  117.     */
  118.  
  119.    RECONCILEF_RESUMERECONCILIATION  = 0x0010,
  120.  
  121.    /* Object may perform all updates. */
  122.  
  123.    RECONCILEF_YOUMAYDOTHEUPDATES    = 0x0020,
  124.  
  125.    /* Only this object has been changed. */
  126.  
  127.    RECONCILEF_ONLYYOUWERECHANGED    = 0x0040,
  128.  
  129.    /* flag combinations */
  130.  
  131.    ALL_RECONCILE_FLAGS              = (RECONCILEF_MAYBOTHERUSER |
  132.                                        RECONCILEF_FEEDBACKWINDOWVALID |
  133.                                        RECONCILEF_NORESIDUESOK |
  134.                                        RECONCILEF_OMITSELFRESIDUE |
  135.                                        RECONCILEF_RESUMERECONCILIATION |
  136.                                        RECONCILEF_YOUMAYDOTHEUPDATES |
  137.                                        RECONCILEF_ONLYYOUWERECHANGED)
  138. }
  139. RECONCILEF;
  140.  
  141. #undef  INTERFACE
  142. #define INTERFACE IReconcilableObject
  143.  
  144. DECLARE_INTERFACE_(IReconcilableObject, IUnknown)
  145. {
  146.    /* IUnknown methods */
  147.  
  148.    STDMETHOD(QueryInterface)(THIS_
  149.                              REFIID riid,
  150.                              PVOID *ppvObject) PURE;
  151.  
  152.    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  153.  
  154.    STDMETHOD_(ULONG, Release)(THIS) PURE;
  155.  
  156.    /* IReconcilableObject methods */
  157.  
  158.    STDMETHOD(Reconcile)(THIS_
  159.                         IReconcileInitiator *pInitiator,
  160.                         DWORD dwFlags,
  161.                         HWND hwndOwner,
  162.                         HWND hwndProgressFeedback,
  163.                         ULONG ulcInput,
  164.                         IMoniker **rgpmkOtherInput,
  165.                         PLONG plOutIndex,
  166.                         IStorage *pstgNewResidues,
  167.                         PVOID pvReserved) PURE;
  168.  
  169.    STDMETHOD(GetProgressFeedbackMaxEstimate)(THIS_
  170.                                              PULONG pulProgressMax) PURE;
  171. };
  172.  
  173. #undef  INTERFACE
  174. #define INTERFACE IBriefcaseInitiator
  175.  
  176. DECLARE_INTERFACE_(IBriefcaseInitiator, IUnknown)
  177. {
  178.    /* IUnknown methods */
  179.  
  180.    STDMETHOD(QueryInterface)(THIS_
  181.                              REFIID riid,
  182.                              PVOID *ppvObject) PURE;
  183.  
  184.    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  185.  
  186.    STDMETHOD_(ULONG, Release)(THIS) PURE;
  187.  
  188.    /* IBriefcaseInitiator methods */
  189.  
  190.    STDMETHOD(IsMonikerInBriefcase)(THIS_
  191.                                    IMoniker *pmk) PURE;
  192. };
  193.  
  194.  
  195. #ifdef __cplusplus
  196. }                                   /* End of extern "C" {. */
  197. #endif   /* __cplusplus */
  198.  
  199.  
  200. #endif   /* ! __RECONCIL_H__ */
  201.  
  202.