home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-01-02 | 2.9 KB | 120 lines | [TEXT/????] |
- //
- // XBINDING.H
- //
- // Copyright (C) Microsoft Corporation, 1996
- //
-
- extern OLECHAR g_szBSCBHolder[];
-
- class CXBinding:
- public IBinding
- {
- private:
- ULONG m_cRef;
- #ifndef URLMON_DLL
- CXSite *m_pSite;
- #endif
-
- public:
- LPBINDSTATUSCALLBACK m_pbsc;
- BOOL m_fAborted;
-
- public:
- #ifdef URLMON_DLL
- inline CXBinding(void);
- #else
- inline CXBinding(CXSite *pSite);
- #endif
- ~CXBinding();
-
- HRESULT Bind(LPOLESTR pszURL, LPBINDSTATUSCALLBACK pbsc, unsigned long BindType);
-
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface)(REFIID riid, LPVOID *ppvObj);
- STDMETHOD_(ULONG, AddRef)(void);
- STDMETHOD_(ULONG, Release)(void);
-
- // *** IBinding methods ***
- STDMETHOD(Abort)(void);
- STDMETHOD(Suspend)(void);
- STDMETHOD(Resume)(void);
- STDMETHOD(SetPriority)(LONG nPriority);
- STDMETHOD(GetPriority)(LONG *pnPriority);
- STDMETHOD(GetBindResult)(LPCLSID pclsidProtocol, LPDWORD pdwResult, LPOLESTR
- *pszResult, LPDWORD pdwReserved);
- };
-
- inline
- #ifdef URLMON_DLL
- CXBinding::CXBinding(void)
- #else
- CXBinding::CXBinding(CXSite *pSite)
- #endif
- {
- m_cRef = 1;
- m_pbsc = NULL;
- m_fAborted = false;
- #ifndef URLMON_DLL
- m_pSite = pSite;
- #endif
- }
-
- class CBindingMemoryStreamNotify:
- public CMemoryOleStreamNotify
- {
- private:
- // Back pointer to the binding object that created this stream.
- CXBinding *m_pBinding;
-
- BOOL m_fDeliveredFirstNotify;
-
- public:
- inline CBindingMemoryStreamNotify(CXBinding *pBinding);
-
- virtual int32 OnWrite(NPStream *stream, int32 offset, int32 len, void
- *buffer);
- virtual NPError OnDestroyStream(NPStream *stream, NPError reason);
- };
-
- inline
- CBindingMemoryStreamNotify::CBindingMemoryStreamNotify(CXBinding *pBinding)
- {
- // Our implementation of the "new" operator will zero the structure so we
- // don't have to explicitly zero/null anything.
- m_pBinding = pBinding;
- }
-
- class CBindingFileStreamNotify:
- public CNetscapeStreamNotify,
- public IUnknown
- {
- private:
- ULONG m_cRef;
- // Back pointer to the binding object that created this stream.
- CXBinding *m_pBinding;
- unsigned long mBindType;
-
- public:
- inline CBindingFileStreamNotify(CXBinding *pBinding, unsigned long BindType);
-
- virtual NPError OnNewStream(NPMIMEType type, NPStream *stream, NPBool
- seekable, uint16 *stype);
- virtual void OnStreamAsFile(NPStream *stream, const char* fname);
- virtual NPError OnDestroyStream(NPStream *stream, NPError reason);
-
- // *** IUnknown methods ***
- STDMETHOD(QueryInterface)(REFIID riid, LPVOID *ppvObj);
- STDMETHOD_(ULONG,AddRef)(void);
- STDMETHOD_(ULONG,Release)(void);
- };
-
- inline
- CBindingFileStreamNotify::CBindingFileStreamNotify(CXBinding *pBinding, unsigned long BindType)
- {
- // Our implementation of the "new" operator will zero the structure so we
- // don't have to explicitly zero/null anything.
- m_cRef = 1;
- m_pBinding = pBinding;
- mBindType = BindType;
- }
-