// Copyright (c) Microsoft Corporation. All rights reserved. // // vsscceng.idl // // IDL of COM wrapper for SCC API // // Interface Definition Language description // of Common Object Model wrapper // for Source Code Control Application Programm(er|ing) Interface // // import "objidl.idl"; import "vsshell.idl"; import "servprov.idl"; #include "VseeGuids.h" enum tagVSSCC_CAP { VSSCC_CAP_CACHED_QUERYINFO = 0x01, VSSCC_CAP_DIRECTORY_BASED_PROJECT = 0x02, VSSCC_CAP_ENABLE_WHEN_SLOW = 0x04, VSSCC_CAP_READONLY_LOGINID = 0x08, VSSCC_CAP_NO_REFRESH = 0x10 }; typedef DWORD VSSCC_CAP; cpp_quote("#if defined(__cplusplus)") cpp_quote("extern \"C++\" {") cpp_quote("inline tagVSSCC_CAP operator|(tagVSSCC_CAP x, tagVSSCC_CAP y)") cpp_quote("{") cpp_quote(" typedef unsigned long ulong;") cpp_quote(" return tagVSSCC_CAP(ulong(x)|ulong(y));") cpp_quote("}") cpp_quote("inline tagVSSCC_CAP operator&(tagVSSCC_CAP x, tagVSSCC_CAP y)") cpp_quote("{") cpp_quote(" typedef unsigned long ulong;") cpp_quote(" return tagVSSCC_CAP(ulong(x)&ulong(y));") cpp_quote("}") cpp_quote("} // extern C++") cpp_quote("#endif") // REVIEW How do we handle const ints across languages? And, extracting them from C/C++ headers? cpp_quote("#ifndef __cplusplus") cpp_quote("#ifndef SCCCOMMAND_DEFINED") cpp_quote("#define SCCCOMMAND_DEFINED") typedef enum SCCCOMMAND { SCCCOMMAND_PAD = 0 } SCCCOMMAND; cpp_quote("#endif") cpp_quote("#endif") cpp_quote("#if defined(_MSC_VER) || defined(__cplusplus) || defined(__STDC__) /* C or C++ */") cpp_quote("#include \"scc.h\"") cpp_quote("#endif") [ uuid(uuid_IVsSccPopulateList) ] interface IVsSccPopulateList : IUnknown { HRESULT CallbackPopulateList( // CONSIDER [in] DWORD dwContext, [in] BOOL bAddKeep, [in] DWORD dwStatus, [in] LPCOLESTR pszFile, [out] BOOL* pbResult); HRESULT CallbackPopulateDirList( // CONSIDER [in] DWORD dwContext, [in] BOOL bFolder, [in] LPCOLESTR pszDirectoryOrFileName, [out] BOOL* pbResult); } typedef struct __VSITEMSELECTION PAIR_IVSHIERARCHY_VSITEMID; /* { IVsHierarchy *pHier; VSITEMID itemid; } VSITEMSELECTION; */ [ // This interface is a fairly mechanical translation // of the C sccapi. The changes are // 1) change to unicode // 2) include arrays of PAIR_IVSHIERARCHY_VSITEMID along with filepath arrays // 3) change inout and out parameters // 4) SCCRTN changed to HRESULT with FACILITY_ITF uuid(uuid_IVsSccEngine) ] interface IVsSccEngine : IUnknown { HRESULT GetVersion([out]LONG* pnVersion); // major.minor => ((major << 16) | minor) HRESULT Initialize( [out] VSCOOKIE* pdwCookie, [in] HWND hWnd, [in] LPCOLESTR pszCallerName, // eg: "Visual Studio 98" [out] BSTR* pbstrSccName, // eg: "SourceSafe" [out] DWORD* pdwCapabilityBits, [out] VSSCC_CAP*pdwVSCapabilityBits, // eg: VSSCC_CAP_CACHED_QUERYINFO [out] BSTR* pbstrAuxPathLabel, // eg: "database" [out] LONG* pnCheckoutCommentLen, [out] LONG* pnCommentLen); HRESULT Uninitialize([in] VSCOOKIE cookie); HRESULT OpenProject( [in] VSCOOKIE dwCookie, [in] HWND hWnd, [in,out] BSTR* pbstrUser, [in,out] BSTR* pbstrProjName, [in] LPCOLESTR pszLocalProjPath, // REVIEW is this mutable? [in,out] BSTR* pbstrAuxProjPath, [in] LPCOLESTR pszComment, [in] DWORD dwFlags); HRESULT CloseProject(VSCOOKIE dwCookie); HRESULT GetProjPath( // The main point of this call is to return the ProjName and AuxProjPath values. // The in parameters are just optional, pre-flight defaults. [in] VSCOOKIE dwCookie, [in] HWND hWnd, [in,out] BSTR* pbstrUser, [in,out] BSTR* pbstrProjName, [in,out] BSTR* pbstrLocalPath, [in,out] BSTR* pbstrAuxProjPath, [in] BOOL bAllowChangePath, [in,out] BOOL* pbInNew); HRESULT Get( [in] VSCOOKIE dwCookie, [in] HWND hWnd, [in] LONG cFiles, [in, size_is(cFiles)] const LPCOLESTR rgpszFileNames[], [in, size_is(cFiles)] const PAIR_IVSHIERARCHY_VSITEMID rgHierarchyItemIDPairs[], // can be NULL [in] DWORD dwFlags, [in] DWORD dwOptions); HRESULT Checkout( [in] VSCOOKIE dwCookie, [in] HWND hWnd, [in] LONG cFiles, [in, size_is(cFiles)] const LPCOLESTR rgpszFileNames[], [in, size_is(cFiles)] const PAIR_IVSHIERARCHY_VSITEMID rgHierarchyItemIDPairs[], // can be NULL [in] LPCOLESTR pszComment, [in] DWORD dwFlags, [in] DWORD dwOptions); HRESULT Uncheckout( [in] VSCOOKIE dwCookie, [in] HWND hWnd, [in] LONG cFiles, [in, size_is(cFiles)] const LPCOLESTR rgpszFileNames[], [in, size_is(cFiles)] const PAIR_IVSHIERARCHY_VSITEMID rgHierarchyItemIDPairs[], // can be NULL [in] DWORD dwFlags, [in] DWORD dwOptions); HRESULT Checkin( [in] VSCOOKIE dwCookie, [in] HWND hWnd, [in] LONG cFiles, [in, size_is(cFiles)] const LPCOLESTR rgpszFileNames[], [in, size_is(cFiles)] const PAIR_IVSHIERARCHY_VSITEMID rgHierarchyItemIDPairs[], // can be NULL [in] LPCOLESTR pszComment, [in] DWORD dwFlags, [in] DWORD dwOptions); HRESULT Add( [in] VSCOOKIE dwCookie, [in] HWND hWnd, [in] LONG cFiles, [in, size_is(cFiles)] const LPCOLESTR rgpszFileNames[], [in, size_is(cFiles)] const PAIR_IVSHIERARCHY_VSITEMID rgHierarchyItemIDPairs[], // can be NULL [in] LPCOLESTR pszComment, [in, size_is(cFiles)] const DWORD rgdwFlags[], [in] DWORD dwOptions); HRESULT Remove( [in] VSCOOKIE dwCookie, [in] HWND hWnd, [in] LONG cFiles, [in, size_is(cFiles)] const LPCOLESTR rgpszFileNames[], [in, size_is(cFiles)] const PAIR_IVSHIERARCHY_VSITEMID rgHierarchyItemIDPairs[], // can be NULL [in] LPCOLESTR pszComment, [in] DWORD dwFlags, [in] DWORD dwOptions); HRESULT Rename( [in] VSCOOKIE dwCookie, [in] HWND hWnd, [in] LPCOLESTR pszFrom, [in] LPCOLESTR pszTo); // Note that Diff is overloaded between "visual diff" and "quick diff". // CONSIDER breaking it out into two seperate methods instead of using the flags. HRESULT Diff( [in] VSCOOKIE dwCookie, [in] HWND hWnd, [in] LPCOLESTR pszFilename, [in] const PAIR_IVSHIERARCHY_VSITEMID* pHierarchyItemIDPair, // can be NULL [in] DWORD dwFlags, [in] DWORD dwOptions); // This may only be supported for one file at a time, as indicated in the cap bits. HRESULT History( [in] VSCOOKIE dwCookie, [in] HWND hWnd, [in] LONG cFiles, [in, size_is(cFiles)] const LPCOLESTR rgpszFileNames[], [in, size_is(cFiles)] const PAIR_IVSHIERARCHY_VSITEMID rgHierarchyItemIDPairs[], // can be NULL [in] DWORD dwFlags, [in] DWORD dwOptions); HRESULT Properties( [in] VSCOOKIE dwCookie, [in] HWND hWnd, [in] LPCOLESTR pszFileName, [in] const PAIR_IVSHIERARCHY_VSITEMID* pHierarchyItemIDPair); // can be NULL HRESULT QueryInfo( [in] VSCOOKIE dwCookie, [in] LONG cFiles, [in, size_is(cFiles)] const LPCOLESTR rgpszFileNames[], [in, size_is(cFiles)] const PAIR_IVSHIERARCHY_VSITEMID rgHierarchyItemIDPairs[], // can be NULL [out, size_is(cFiles)] DWORD rgStatus[]); HRESULT PopulateList( [in] VSCOOKIE dwCookie, [in] SCCCOMMAND nCommand, [in] LONG cFiles, [in, size_is(cFiles)] const LPCOLESTR rgpszFileNames[], [in, size_is(cFiles)] const PAIR_IVSHIERARCHY_VSITEMID rgHierarchyItemIDPairs[], // can be NULL [in] IVsSccPopulateList* pfnPopulate, [out, size_is(cFiles)] DWORD rgStatus[], [in] DWORD dwFlags); HRESULT GetEvents( [in] VSCOOKIE dwCookie, [out] BSTR* pbstrFileName, [out] DWORD* dwStatus, [out] LONG* pnEventsRemaining); HRESULT RunScc( // aka "admin" [in] VSCOOKIE dwCookie, [in] HWND hWnd, [in] LONG cFiles, [in, size_is(cFiles)] const LPCOLESTR rgpszFileNames[], [in, size_is(cFiles)] const PAIR_IVSHIERARCHY_VSITEMID rgHierarchyItemIDPairs[]); // can be NULL HRESULT GetCommandOptions( [in] VSCOOKIE dwCookie, [in] HWND hWnd, [in] SCCCOMMAND nCommand, [in, out] DWORD* pdwOptions); HRESULT AddFromScc( // aka "share" [in] VSCOOKIE dwCookie, [in] HWND hWnd, [out] CALPOLESTR* pCaFileNames); HRESULT SetOption( [in] VSCOOKIE dwCookie, [in] LONG nOption, [in] DWORD dwVal); } // REVIEW How do we handle const ints across languages? And, extracting them from C/C++ headers? cpp_quote("#if defined(_MSC_VER) || defined(__cplusplus) || defined(__STDC__) /* C or C++ */") // "static" here is redundant in C++, but helps the C optimizer. // The compiler has been seen to strip unused consts; presumably it inlines them as well. // (Don't #include idl_i.c files in .cpp files.) // find #define\:b+\([A-Za-z_]+\)\:b+\:n // replace static const HRESULT HR\1 = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, \1); // UNDONE get MIDL to take this.. cpp_quote("static const HRESULT HRSCC_I_SHARESUBPROJOK = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x1000+(SCC_I_SHARESUBPROJOK));") cpp_quote("static const HRESULT HRSCC_I_FILEDIFFERS = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x1000+(SCC_I_FILEDIFFERS));") cpp_quote("static const HRESULT HRSCC_I_RELOADFILE = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x1000+(SCC_I_RELOADFILE));") cpp_quote("static const HRESULT HRSCC_I_FILENOTAFFECTED = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x1000+(SCC_I_FILENOTAFFECTED));") cpp_quote("static const HRESULT HRSCC_I_PROJECTCREATED = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x1000+(SCC_I_PROJECTCREATED));") cpp_quote("static const HRESULT HRSCC_I_OPERATIONCANCELED = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x1000+(SCC_I_OPERATIONCANCELED));") cpp_quote("static const HRESULT HRSCC_I_ADV_SUPPORT = MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x1000+(SCC_I_ADV_SUPPORT));") // find #define\:b+\([A-Za-z_]+\)\:b+-\:n // replace static const HRESULT HR\1 = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, \1); cpp_quote("static const HRESULT HRSCC_E_INITIALIZEFAILED = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_INITIALIZEFAILED));") cpp_quote("static const HRESULT HRSCC_E_UNKNOWNPROJECT = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_UNKNOWNPROJECT));") cpp_quote("static const HRESULT HRSCC_E_COULDNOTCREATEPROJECT = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_COULDNOTCREATEPROJECT));") cpp_quote("static const HRESULT HRSCC_E_NOTCHECKEDOUT = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_NOTCHECKEDOUT));") cpp_quote("static const HRESULT HRSCC_E_ALREADYCHECKEDOUT = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_ALREADYCHECKEDOUT));") cpp_quote("static const HRESULT HRSCC_E_FILEISLOCKED = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_FILEISLOCKED));") cpp_quote("static const HRESULT HRSCC_E_FILEOUTEXCLUSIVE = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_FILEOUTEXCLUSIVE));") cpp_quote("static const HRESULT HRSCC_E_ACCESSFAILURE = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_ACCESSFAILURE));") cpp_quote("static const HRESULT HRSCC_E_CHECKINCONFLICT = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_CHECKINCONFLICT));") cpp_quote("static const HRESULT HRSCC_E_FILEALREADYEXISTS = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_FILEALREADYEXISTS));") cpp_quote("static const HRESULT HRSCC_E_FILENOTCONTROLLED = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_FILENOTCONTROLLED));") cpp_quote("static const HRESULT HRSCC_E_FILEISCHECKEDOUT = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_FILEISCHECKEDOUT));") cpp_quote("static const HRESULT HRSCC_E_NOSPECIFIEDVERSION = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_NOSPECIFIEDVERSION));") cpp_quote("static const HRESULT HRSCC_E_OPNOTSUPPORTED = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_OPNOTSUPPORTED));") cpp_quote("static const HRESULT HRSCC_E_NONSPECIFICERROR = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_NONSPECIFICERROR));") cpp_quote("static const HRESULT HRSCC_E_OPNOTPERFORMED = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_OPNOTPERFORMED));") cpp_quote("static const HRESULT HRSCC_E_TYPENOTSUPPORTED = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_TYPENOTSUPPORTED));") cpp_quote("static const HRESULT HRSCC_E_VERIFYMERGE = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_VERIFYMERGE));") cpp_quote("static const HRESULT HRSCC_E_FIXMERGE = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_FIXMERGE));") cpp_quote("static const HRESULT HRSCC_E_SHELLFAILURE = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_SHELLFAILURE));") cpp_quote("static const HRESULT HRSCC_E_INVALIDUSER = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_INVALIDUSER));") cpp_quote("static const HRESULT HRSCC_E_PROJECTALREADYOPEN = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_PROJECTALREADYOPEN));") cpp_quote("static const HRESULT HRSCC_E_PROJSYNTAXERR = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_PROJSYNTAXERR));") cpp_quote("static const HRESULT HRSCC_E_INVALIDFILEPATH = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_INVALIDFILEPATH));") cpp_quote("static const HRESULT HRSCC_E_PROJNOTOPEN = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_PROJNOTOPEN));") cpp_quote("static const HRESULT HRSCC_E_NOTAUTHORIZED = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_NOTAUTHORIZED));") cpp_quote("static const HRESULT HRSCC_E_FILESYNTAXERR = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_FILESYNTAXERR));") cpp_quote("static const HRESULT HRSCC_E_FILENOTEXIST = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_FILENOTEXIST));") cpp_quote("static const HRESULT HRSCC_E_CONNECTIONFAILURE = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_CONNECTIONFAILURE));") cpp_quote("static const HRESULT HRSCC_E_UNKNOWNERROR = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_UNKNOWNERROR));") cpp_quote("static const HRESULT HRSCC_E_BACKGROUNDGETINPROGRESS = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1000-(SCC_E_BACKGROUNDGETINPROGRESS));") // There is no MSSCCI error defined for conversion errors, let's just came up with some values in the 1500-1600 range cpp_quote("static const HRESULT HRSCC_E_W2A_CONVERSION_FILES = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1500);") cpp_quote("static const HRESULT HRSCC_I_W2A_CONVERSION_FILES = MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF, 0x1500);") cpp_quote("static const HRESULT HRSCC_E_W2A_CONVERSION_FOLDERS = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1501);") cpp_quote("static const HRESULT HRSCC_I_W2A_CONVERSION_FOLDERS = MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF, 0x1501);") cpp_quote("static const HRESULT HRSCC_E_W2A_CONVERSION_PROJECT = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1502);") cpp_quote("static const HRESULT HRSCC_E_W2A_CONVERSION_PROJECT_OPENFROMSCC = MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x1503);") cpp_quote("#endif")