Menu

[r192]: / trunk / src / Callback.h  Maximize  Restore  History

Download this file

135 lines (109 with data), 3.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// CommitMonitor - simple checker for new commits in svn repositories
// Copyright (C) 2007 - Stefan Kueng
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
#pragma once
#include <string>
using namespace std;
class CCallback : public IBindStatusCallback, public IAuthenticate, public IHttpSecurity
{
public:
CCallback();
~CCallback();
void SetAuthData(const wstring& username, const wstring& password) {m_username = username; m_password = password;}
// IHttpSecurity method
STDMETHOD(OnSecurityProblem)(DWORD /*dwProblem*/)
{ return S_OK; }
STDMETHOD(GetWindow)(
/* [in] */ REFGUID /*rguidReason*/,
/* [out] */ HWND * /*phwnd*/)
{ return E_NOTIMPL; }
// IAuthenticate method
STDMETHOD(Authenticate)(
/* [out] */ HWND * phwnd,
/* [out] */ LPWSTR * pszUsername,
/* [out] */ LPWSTR * pszPassword);
// IBindStatusCallback methods. Note that the only method called by IE
// is OnProgress(), so the others just return E_NOTIMPL.
STDMETHOD(OnStartBinding)(
/* [in] */ DWORD /*dwReserved*/,
/* [in] */ IBinding __RPC_FAR * /*pib*/)
{ return E_NOTIMPL; }
STDMETHOD(GetPriority)(
/* [out] */ LONG __RPC_FAR * /*pnPriority*/)
{ return E_NOTIMPL; }
STDMETHOD(OnLowResource)(
/* [in] */ DWORD /*reserved*/)
{ return E_NOTIMPL; }
STDMETHOD(OnProgress)(
/* [in] */ ULONG /*ulProgress*/,
/* [in] */ ULONG /*ulProgressMax*/,
/* [in] */ ULONG /*ulStatusCode*/,
/* [in] */ LPCWSTR /*wszStatusText*/)
{ return S_OK; }
STDMETHOD(OnStopBinding)(
/* [in] */ HRESULT /*hresult*/,
/* [unique][in] */ LPCWSTR /*szError*/)
{ return E_NOTIMPL; }
STDMETHOD(GetBindInfo)(
/* [out] */ DWORD __RPC_FAR * /*grfBINDF*/,
/* [unique][out][in] */ BINDINFO __RPC_FAR * /*pbindinfo*/)
{ return E_NOTIMPL; }
STDMETHOD(OnDataAvailable)(
/* [in] */ DWORD /*grfBSCF*/,
/* [in] */ DWORD /*dwSize*/,
/* [in] */ FORMATETC __RPC_FAR * /*pformatetc*/,
/* [in] */ STGMEDIUM __RPC_FAR * /*pstgmed*/)
{ return E_NOTIMPL; }
STDMETHOD(OnObjectAvailable)(
/* [in] */ REFIID /*riid*/,
/* [iid_is][in] */ IUnknown __RPC_FAR * /*punk*/)
{ return E_NOTIMPL; }
// IUnknown methods. Note that IE never calls any of these methods, since
// the caller owns the IBindStatusCallback interface, so the methods all
// return zero/E_NOTIMPL.
STDMETHOD_(ULONG,AddRef)()
{ return 0; }
STDMETHOD_(ULONG,Release)()
{ return 0; }
STDMETHOD(QueryInterface)(
/* [in] */ REFIID riid,
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR * ppvObject)
{
if ( riid == IID_IAuthenticate ) {
*ppvObject = (void*) (IAuthenticate*)this;
return S_OK;
}
else if ( riid == IID_IUnknown ) {
*ppvObject = (void*) (IUnknown*)(IBindStatusCallback*)this;
return S_OK;
}
else if ( riid == IID_IBindStatusCallback ) {
*ppvObject = (void*) (IBindStatusCallback*)this;
return S_OK;
}
else if ( riid == IID_IHttpSecurity ) {
*ppvObject = (void*) (IHttpSecurity*)this;
return S_OK;
}
else if ( riid == IID_IWindowForBindingUI ) {
*ppvObject = (void*) (IWindowForBindingUI*)this;
return S_OK;
}
return E_NOINTERFACE;
}
private:
ULONG m_cRef;
wstring m_username;
wstring m_password;
};
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.