//+------------------------------------------------------------------------- // // Microsoft Windows // Copyright (C) Microsoft Corporation, 1999. // // File: davinet.idl // //-------------------------------------------------------------------------- [ uuid(19F2DA5A-C859-11d2-B30C-00105A9974A0), version(1.0), helpstring("Windows CE DAV Transport") ] library DavAPI { #ifndef DO_NO_IMPORTS import "unknwn.idl"; import "wtypes.idl"; import "objidl.idl"; import "oaidl.idl"; #endif import "iasyncwnt.idl"; const DWORD DEPTH_INFINITY = 0xFFFFFFFE; const DWORD CCHMAX_DAV_USERNAME = 255; const DWORD CCHMAX_DAV_PASSWORD = 255; const DWORD DAVOPTIONS_DAVSUPPORT_1 = 0x1; const DWORD DAVOPTIONS_DAVSUPPORT_2 = 0x2; const DWORD DAVOPTIONS_DAVVERB_GET = 0x1; const DWORD DAVOPTIONS_DAVVERB_HEAD = 0x2; const DWORD DAVOPTIONS_DAVVERB_OPTIONS = 0x4; const DWORD DAVOPTIONS_DAVVERB_PUT = 0x8; const DWORD DAVOPTIONS_DAVVERB_POST = 0x10; const DWORD DAVOPTIONS_DAVVERB_DELETE = 0x20; const DWORD DAVOPTIONS_DAVVERB_MKCOL = 0x40; const DWORD DAVOPTIONS_DAVVERB_COPY = 0x80; const DWORD DAVOPTIONS_DAVVERB_MOVE = 0x100; const DWORD DAVOPTIONS_DAVVERB_PROPFIND = 0x200; const DWORD DAVOPTIONS_DAVVERB_PROPPATCH = 0x400; // --------------------------------------------------------------------------------------- // DAVPROPTYPE // --------------------------------------------------------------------------------------- typedef enum tagDAVPROPTYPE { DPT_BLOB, DPT_FILETIME, DPT_I2, DPT_I4, DPT_LPWSTR, DPT_UI2, DPT_UI4 } DAVPROPTYPE, *LPDAVPROPTYPE; // --------------------------------------------------------------------------------------- // DAVPROPID // --------------------------------------------------------------------------------------- typedef struct tagDAVPROPID { DWORD dwId; DAVPROPTYPE dpt; } DAVPROPID, *LPDAVPROPID; // --------------------------------------------------------------------------------------- // DAVBLOB // --------------------------------------------------------------------------------------- typedef struct tagDAVBLOB { DWORD cbBlob; [size_is(cbBlob)] BYTE *pb; } DAVBLOB, *LPDAVBLOB; // --------------------------------------------------------------------------------------- // DAVPROPVAL // --------------------------------------------------------------------------------------- typedef struct tagDAVPROPVAL { DWORD dwId; DAVPROPTYPE dpt; [switch_type(DAVPROPTYPE), switch_is(dpt)] union { [case(DPT_BLOB)] DAVBLOB dbVal; [case(DPT_FILETIME)] FILETIME ftVal; [case(DPT_I2)] short iVal; [case(DPT_I4)] long lVal; [case(DPT_LPWSTR)] LPWSTR pwszVal; [case(DPT_UI2)] USHORT uiVal; [case(DPT_UI4)] ULONG ulVal; [default]; }; } DAVPROPVAL, *LPDAVPROPVAL; // --------------------------------------------------------------------------------------- // IID_IPropFindRequest // --------------------------------------------------------------------------------------- [ uuid(391B226C-D032-11d2-B311-00105A9974A0), helpstring("DAV PropFind Request") ] interface IPropFindRequest : IUnknown { HRESULT SetPropInfo(LPCWSTR pwszNamespace, LPCWSTR pwszPropname, DAVPROPID propid); BOOL GetPropInfo(LPCWSTR pwszNamespace, LPCWSTR pwszPropName, LPDAVPROPID ppropid); HRESULT GetPropCount( [out] UINT* cProp); HRESULT GetXmlUtf8(IStream **ppStream); }; // --------------------------------------------------------------------------------------- // IID_IPropPatchRequest // --------------------------------------------------------------------------------------- [ uuid(9A508200-3EA3-4725-84EE-8A326976D483), helpstring("DAV PropPatch Request") ] interface IPropPatchRequest : IUnknown { HRESULT SetPropValue( [in] LPCWSTR pwszNamespace, [in] LPCWSTR pwszPropname, [in] LPDAVPROPVAL ppropval); BOOL GetPropInfo( [out] LPCWSTR pwszNamespace, [out] LPCWSTR pwszPropName, [in] LPDAVPROPID ppropid); HRESULT GetXmlUtf8( [out] IStream **ppStream); }; // --------------------------------------------------------------------------------------- // IID_IDavCallback // --------------------------------------------------------------------------------------- [ uuid(FC0D2910-C20D-11d2-B2F5-00105A9974A0), helpstring("DAV Callback Interface") ] interface IDavCallback : IUnknown { // ----------------------------------------------------------------------------------- // DAVCOMMAND // ----------------------------------------------------------------------------------- typedef enum tagDAVCOMMAND { DAV_NONE = 0, DAV_GET, DAV_OPTIONS, DAV_HEAD, DAV_PUT, DAV_MKCOL, DAV_POST, DAV_DELETE, DAV_COPY, DAV_MOVE, DAV_PROPFIND, DAV_PROPPATCH, DAV_SEARCH, DAV_REPLSEARCH, DAV_LAST } DAVCOMMAND; // ----------------------------------------------------------------------------------- // REPLCHANGETYPE // ----------------------------------------------------------------------------------- typedef enum tagREPLCHANGETYPE { REPL_ADD, REPL_DELETE, REPL_LAST } REPLCHANGETYPE; // ----------------------------------------------------------------------------------- // DAVGET // ----------------------------------------------------------------------------------- typedef struct tagDAVGET { BOOL fTotalKnown; // server provided a content-length (cbTotal is valid) DWORD cbIncrement; // bytes in this response DWORD cbCurrent; // bytes downloaded so far DWORD cbTotal; // total bytes in the response (if fTotalKnown == TRUE) LPVOID pvBody; // content bytes LPWSTR pwszContentType; } DAVGET; // ----------------------------------------------------------------------------------- // DAVHEAD // ----------------------------------------------------------------------------------- typedef struct tagDAVHEAD { DWORD cchRawHeaders; // characters in raw headers LPWSTR pwszRawHeaders; // raw headers } DAVHEAD; // ----------------------------------------------------------------------------------- // DAVOPTIONS // ----------------------------------------------------------------------------------- typedef struct tagDAVOPTIONS { DWORD cchRawHeaders; // characters in raw headers LPWSTR pwszRawHeaders; // raw headers BYTE bDavSupport; // bit vector of flags of DAV support (1,2) DWORD dwDavMethodsAllow; // bit vector of flags of DAV-verbs supported for this URL DWORD dwDavMethodsPublic; // bit vector of flags of DAV-verbs supported for this server } DAVOPTIONS; // ----------------------------------------------------------------------------------- // DAVPUT // ----------------------------------------------------------------------------------- typedef struct tagDAVPUT { LPCWSTR pwszLocation; // location header in the http response BOOL fResend; // true if first notification of data resend // due to authentication DWORD cbIncrement; // bytes sent since the last response DWORD cbCurrent; // bytes sent so far DWORD cbTotal; // total bytes to send } DAVPUT; // ----------------------------------------------------------------------------------- // DAVPOST // ----------------------------------------------------------------------------------- typedef DAVPUT DAVPOST; // identical to PUT // ----------------------------------------------------------------------------------- // DAVPROPFIND // ----------------------------------------------------------------------------------- typedef struct tagDAVPROPFIND { LPCWSTR pwszHref; WORD cPropVal; DAVPROPVAL *rgPropVal; } DAVPROPFIND; // ----------------------------------------------------------------------------------- // DAVPROPPATCH // ----------------------------------------------------------------------------------- typedef DAVPROPFIND DAVPROPPATCH; // ----------------------------------------------------------------------------------- // DAVSEARCH // ----------------------------------------------------------------------------------- typedef DAVPROPFIND DAVSEARCH; // ----------------------------------------------------------------------------------- // DAVREPLSEARCH // ----------------------------------------------------------------------------------- typedef struct tagDAVREPLSEARCH { ULONG cbCollblob; BYTE *pbCollblob; LPCWSTR pwszHref; REPLCHANGETYPE changetype; WORD cPropVal; DAVPROPVAL *rgPropVal; } DAVREPLSEARCH; // ----------------------------------------------------------------------------------- // DAVRESPONSE // ----------------------------------------------------------------------------------- typedef struct tagDAVRESPONSE { DAVCOMMAND command; BOOL fDone; HRESULT hrResult; UINT uHTTPReturnCode; [switch_type(DAVCOMMAND), switch_is(command)] union { [case(DAV_GET)] DAVGET rGet; [case(DAV_HEAD)] DAVHEAD rHead; [case(DAV_OPTIONS)] DAVOPTIONS rOptions; [case(DAV_PUT)] DAVPUT rPut; [case(DAV_POST)] DAVPOST rPost; [case(DAV_PROPFIND)] DAVPROPFIND rPropFind; [case(DAV_REPLSEARCH)] DAVREPLSEARCH rReplSearch; [default]; }; } DAVRESPONSE, *LPDAVRESPONSE; HRESULT OnAuthChallenge( [in,out] TCHAR szUserName[CCHMAX_DAV_USERNAME], [in,out] TCHAR szPassword[CCHMAX_DAV_PASSWORD]); HRESULT OnResponse( [in] DAVRESPONSE* pResponse); }; // --------------------------------------------------------------------------------------- // IID_IDavTransport // --------------------------------------------------------------------------------------- [ uuid(93F23B8C-C20C-11d2-B2F5-00105A9974A0), helpstring("DAV Transport"), ] interface IDavTransport : IUnknown { // ----------------------------------------------------------------------------------- // SetUserAgent // Set the HTTP UserAgent string. If this method is not called, the user agent // string sent by this transport will be the default user agent string sent // by Internet Explorer. // // Parameters: // pwszUserAgent User agent string sent in http queries // // Returns: // E_INVALIDARG An invalid parameter was passed in // E_OUTOFMEMORY An memory allocation failed // ----------------------------------------------------------------------------------- HRESULT SetUserAgent( [in] LPCWSTR pwszUserAgent); // ----------------------------------------------------------------------------------- // SetAuthentication // Optionally called to set authentication information that will be // pushed into connection handles. Passing this information may enable // the transport to pre-authenticate the connection. // This method can be called multiple times, and can be called with // null params. Calling with null params clears the username or // password as appropriate. // // Parameters: // pwszUserName User agent string sent in http queries // pwszPassword Specifies the Transport callback interface. // // Returns: // E_OUTOFMEMORY An memory allocation failed // ----------------------------------------------------------------------------------- HRESULT SetAuthentication( [in, optional] LPCWSTR pwszUserName, [in, optional] LPCWSTR pwszPassword); // ----------------------------------------------------------------------------------- // SetLogFilePath // Optionally called to set the path to a file that will be used to // log all requests and responses (with headers, but without data payloads) // sent to and received from the server. // // This method can be called multiple times, and can be called with // a null param. Calling with a null param clears the path. // // If the path has not been set or if it has been cleared, then no log is generated. // // A file is created at the path, overwriting any previous files // // Parameters: // pwszLogFilePath Path to file to use for log, or NULL to clear // // Returns: // E_OUTOFMEMORY An memory allocation failed // ----------------------------------------------------------------------------------- HRESULT SetLogFilePath( [in, optional] LPCWSTR pwszLogFilePath); // ----------------------------------------------------------------------------------- // CommandGET // Sends an HTTP GET command. // // Parameters: // pwszUrl The URL of the resource to retrieve. Must be // absolute (non-relative). // nAcceptTypes number of accept types specified // rgwszAcceptTypes array of accept types strings // fTranslate if FALSE, a "Translate: F" header will be included // in the request, otherwise not translate header will // be sent // pCallback Callback interface to which response will be sent. // dwCallbackParam Parameter to be passed to callback // ----------------------------------------------------------------------------------- HRESULT CommandGET( [in] LPCWSTR pwszUrl, [in] ULONG nAcceptTypes, [in, size_is(nAcceptTypes)] LPCWSTR rgwszAcceptTypes[], [in] BOOL fTranslate, [in] IDavCallback *pCallback, [in] DWORD dwCallbackParam); // ----------------------------------------------------------------------------------- // CommandOPTIONS // Sends an HTTP OPTIONS command. // // Parameters: // pwszUrl The URL of the resource to get server options on. // pCallback Callback interface to which response will be sent. // dwCallbackParam Parameter to be passed to callback // ----------------------------------------------------------------------------------- HRESULT CommandOPTIONS( [in] LPCWSTR pwszUrl, [in] IDavCallback *pCallback, [in] DWORD dwCallbackParam); // ----------------------------------------------------------------------------------- // CommandHEAD // Sends an HTTP HEAD command. // // Parameters: // pwszUrl The URL of the resource to get header information on. // pCallback Callback interface to which response will be sent. // dwCallbackParam Parameter to be passed to callback // ----------------------------------------------------------------------------------- HRESULT CommandHEAD( [in] LPCWSTR pwszUrl, [in] IDavCallback *pCallback, [in] DWORD dwCallbackParam); // ----------------------------------------------------------------------------------- // CommandPUT // Sends an HTTP PUT command. // // Parameters: // pwszUrl The URL of resource to create. // pStream Stream of bytes to PUT to the destination URL. // pwszContentType Type of data being PUT // pCallback Callback interface to which response will be sent. // dwCallbackParam Parameter to be passed to callback // ----------------------------------------------------------------------------------- HRESULT CommandPUT( [in] LPCWSTR pwszUrl, [in] IStream *pStream, [in] LPCWSTR pwszContentType, [in] IDavCallback *pCallback, [in] DWORD dwCallbackParam); // ----------------------------------------------------------------------------------- // CommandPOST // Sends an HTTP POST command. // // Parameters: // pwszUrl URL to which data should be POSTed. // pStream Stream of bytes to POST // pwszContentType Type of data being POSTed // pCallback Callback interface to which response will be sent. // dwCallbackParam Parameter to be passed to callback // ----------------------------------------------------------------------------------- HRESULT CommandPOST( [in] LPCWSTR pwszUrl, [in] IStream *pStream, [in] // used to be [in, optional], but this caused ERROR MIDL2090 LPCWSTR pwszContentType, [in] IDavCallback *pCallback, [in] DWORD dwCallbackParam); // ----------------------------------------------------------------------------------- // CommandMKCOL // Sends an HTTP MKCOL command. // // Parameters: // pwszUrl URL of collection to create // pCallback Callback interface to which response will be sent. // dwCallbackParam Parameter to be passed to callback // ----------------------------------------------------------------------------------- HRESULT CommandMKCOL( [in] LPCWSTR pwszUrl, [in] IDavCallback *pCallback, [in] DWORD dwCallbackParam); // ----------------------------------------------------------------------------------- // CommandDELETE // Sends an HTTP DELETE command. // // Parameters: // pwszUrl URL of resource to delete // pCallback Callback interface to which response will be sent. // dwCallbackParam Parameter to be passed to callback // ----------------------------------------------------------------------------------- HRESULT CommandDELETE( [in] LPCWSTR pwszUrl, [in] IDavCallback *pCallback, [in] DWORD dwCallbackParam); // ----------------------------------------------------------------------------------- // CommandCOPY // Sends an HTTP COPY command to copy resources on the same DAV server. // // Parameters: // pwszUrlSource URL of source resource // pwszUrlDest URL of dest resource // dwDepth depth to which we should copy (0 = just this, // fOverwrite Should we overwrite anything at the dest resource? // pCallback Callback interface to which response will be sent. // dwCallbackParam Parameter to be passed to callback // ----------------------------------------------------------------------------------- HRESULT CommandCOPY( [in] LPCWSTR pwszUrlSource, [in] LPCWSTR pwszUrlDest, [in] DWORD dwDepth, [in] BOOL fOverwrite, [in] IDavCallback *pCallback, [in] DWORD dwCallbackParam); // ----------------------------------------------------------------------------------- // CommandMOVE // Sends an HTTP MOVE command to move resources on the same DAV server. // // Parameters: // pwszUrlSource URL of source resource // pwszUrlDest URL of dest resource // fOverwrite Should we overwrite anything at the dest resource? // pCallback Callback interface to which response will be sent. // dwCallbackParam Parameter to be passed to callback // ----------------------------------------------------------------------------------- HRESULT CommandMOVE( [in] LPCWSTR pwszUrlSource, [in] LPCWSTR pwszUrlDest, [in] BOOL fOverwrite, [in] IDavCallback *pCallback, [in] DWORD dwCallbackParam); // ----------------------------------------------------------------------------------- // CommandPROPFIND // Sends a DAV PROPFIND command. // // Parameters: // pwszUrl URL of resource being queried // pRequest Request that describes the properties being requested // dwDepth PropFind depth header. Can be a non-neg integer or // the constant "DEPTH_INFINITY" (0 is "only this el") // BUGBUG: check this about the 0 thing // pCallback Callback interface to which response will be sent. // dwCallbackParam Parameter to be passed to callback // ----------------------------------------------------------------------------------- HRESULT CommandPROPFIND( [in] LPCWSTR pwszUrl, [in] IPropFindRequest *pRequest, [in] DWORD dwDepth, [in] BOOL fNoRoot, [in] IDavCallback *pCallback, [in] DWORD dwCallbackParam); // ----------------------------------------------------------------------------------- // CommandPROPPATCH // Sends a DAV PROPPATCH command. // // Parameters: // pwszUrl URL of resource being patched // pRequest Request that describes the properties being requested // pwszHeaders Additional HTTP headers to be prepended to the request // pCallback Callback interface to which response will be sent. // dwCallbackParam Parameter to be passed to callback // ----------------------------------------------------------------------------------- HRESULT CommandPROPPATCH( [in] LPCWSTR pwszUrl, [in] IPropPatchRequest *pRequest, [in] LPCWSTR pwszHeaders, [in] IDavCallback *pCallback, [in] DWORD dwCallbackParam); // ----------------------------------------------------------------------------------- // CommandSEARCH // Sends a SEARCH command.. // // Parameters: // pwszUrl URL of resource being queried // pCallback Callback interface to which response will be sent. // dwCallbackParam Parameter to be passed to callback // ----------------------------------------------------------------------------------- HRESULT CommandSEARCH( [in] LPCWSTR pwszUrl, /* more params go here to define the search criteria */ [in] IDavCallback *pCallback, [in] DWORD dwCallbackParam); // ----------------------------------------------------------------------------------- // CommandREPLSEARCH // Sends a SEARCH command.. // // Parameters: // pwszUrl URL of resource being queried // pCallback Callback interface to which response will be sent. // dwCallbackParam Parameter to be passed to callback // ----------------------------------------------------------------------------------- HRESULT CommandREPLSEARCH( [in] LPCWSTR pwszUrl, [in] ULONG cbCollblob, [in, size_is(cbCollblob)] // [in, optional, size_is(cbCollblob)] BYTE *pbCollblob, /* more params go here to define the search criteria */ [in] IDavCallback *pCallback, [in] DWORD dwCallbackParam); }; };