Browse Source

adding events and ConnectionPoint

COM-121
Volker Birk 6 years ago
parent
commit
6868abd1b0
2 changed files with 54 additions and 5 deletions
  1. +46
    -5
      _IpEpEngineEvents_CP.h
  2. +8
    -0
      pEpCOMServerAdapter.idl

+ 46
- 5
_IpEpEngineEvents_CP.h View File

@ -1,10 +1,51 @@
#pragma once
using namespace ATL;
template <class T>
class CProxy_IpEpEngineEvents : public IConnectionPointImpl<T, &__uuidof( _IpEpEngineEvents ), CComDynamicUnkArray>
template<class T>
class CProxy_IpEpEngineEvents :
public ATL::IConnectionPointImpl<T, &__uuidof(_IpEpEngineEvents)>
{
// WARNING: This class may be regenerated by the wizard
public:
HRESULT Fire_messageToSend(text_message * msg)
{
HRESULT hr = S_OK;
T * pThis = static_cast<T *>(this);
int cConnections = m_vec.GetSize();
for (int iConnection = 0; iConnection < cConnections; iConnection++)
{
pThis->Lock();
CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
pThis->Unlock();
_IpEpEngineEvents * pConnection = static_cast<_IpEpEngineEvents *>(punkConnection.p);
if (pConnection)
{
hr = pConnection->messageToSend(msg);
}
}
return hr;
}
HRESULT Fire_showHandshake(pEp_identity_s * self, pEp_identity_s * partner, sync_handshake_result * result)
{
HRESULT hr = S_OK;
T * pThis = static_cast<T *>(this);
int cConnections = m_vec.GetSize();
for (int iConnection = 0; iConnection < cConnections; iConnection++)
{
pThis->Lock();
CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
pThis->Unlock();
_IpEpEngineEvents * pConnection = static_cast<_IpEpEngineEvents *>(punkConnection.p);
if (pConnection)
{
hr = pConnection->showHandshake(self, partner, result);
}
}
return hr;
}
};

+ 8
- 0
pEpCOMServerAdapter.idl View File

@ -261,6 +261,12 @@ interface IpEpEngine : IUnknown {
HRESULT decrypt_message([in] struct text_message *src, [out] struct text_message * dst, [out] SAFEARRAY(BSTR) *keylist, [out, retval] pEp_color *rating);
HRESULT outgoing_message_color([in] struct text_message *msg, [out, retval] pEp_color * pVal);
HRESULT identity_color([in] struct pEp_identity_s * ident, [out, retval] pEp_color * pVal);
typedef enum _sync_handshake_result {
SYNC_HANDSHAKE_CANCEL = -1,
SYNC_HANDSHAKE_ACCEPTED = 0,
SYNC_HANDSHAKE_REJECTED = 1
} sync_handshake_result;
};
[
@ -277,6 +283,8 @@ library pEpCOMServerAdapterLib
{
properties:
methods:
[id(1)] HRESULT messageToSend([in] struct text_message * msg);
[id(2)] HRESULT showHandshake([in] struct pEp_identity_s * self, [in] struct pEp_identity_s * partner, [out, retval] sync_handshake_result *result);
};
[
uuid(EF1B073D-5058-4E0E-829E-B4D22CA21EA2)


Loading…
Cancel
Save