1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_mscom_IHandlerProvider_h
8 #define mozilla_mscom_IHandlerProvider_h
10 #include "mozilla/NotNull.h"
11 #include "mozilla/mscom/Ptr.h"
20 struct HandlerProvider
{
21 virtual STDMETHODIMP
GetHandler(NotNull
<CLSID
*> aHandlerClsid
) = 0;
22 virtual STDMETHODIMP
GetHandlerPayloadSize(
23 NotNull
<IInterceptor
*> aInterceptor
, NotNull
<DWORD
*> aOutPayloadSize
) = 0;
24 virtual STDMETHODIMP
WriteHandlerPayload(NotNull
<IInterceptor
*> aInterceptor
,
25 NotNull
<IStream
*> aStream
) = 0;
26 virtual STDMETHODIMP_(REFIID
) MarshalAs(REFIID aIid
) = 0;
27 virtual STDMETHODIMP
DisconnectHandlerRemotes() = 0;
30 * Determine whether this interface might be supported by objects using
31 * this HandlerProvider.
32 * This is used to avoid unnecessary cross-thread QueryInterface calls for
33 * interfaces known to be unsupported.
34 * Return S_OK if the interface might be supported, E_NOINTERFACE if it
35 * definitely isn't supported.
37 virtual STDMETHODIMP
IsInterfaceMaybeSupported(REFIID aIid
) { return S_OK
; }
40 struct IHandlerProvider
: public IUnknown
, public HandlerProvider
{
41 virtual STDMETHODIMP_(REFIID
)
42 GetEffectiveOutParamIid(REFIID aCallIid
, ULONG aCallMethod
) = 0;
43 virtual STDMETHODIMP
NewInstance(
44 REFIID aIid
, InterceptorTargetPtr
<IUnknown
> aTarget
,
45 NotNull
<IHandlerProvider
**> aOutNewPayload
) = 0;
49 } // namespace mozilla
51 #endif // mozilla_mscom_IHandlerProvider_h