Read.h
Read.h
//-------------------------------------------------------------
//
// File: read.h, Declaration of the Cread
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-------------------------------------------------------------
#ifndef __READ_H_
#define __READ_H_
// Main symbols
#include "resource.h"
// My includes
#include "windows.h"
#include "smtpevent.h"
#include "mailmsg.h"
#include "seo.h"
#include "Sinkutil.h"
/////////////////////////////////////////////////////////////////////////////
// Cread
class ATL_NO_VTABLE Cread :
public CComObjectRootEx<CComMultiThreadModel>,
public CComCoClass<Cread, &CLSID_read>,
public IMailTransportCategorize,
public IEventIsCacheable,
public IDispatchImpl<Iread, &IID_Iread, &LIBID_CATREADERLib>
{
public:
Cread()
{
m_fSinkInitSuccess = FALSE;
m_fTrySinkInit = FALSE;
InitializeCriticalSection(&m_cs);
}
~Cread()
{
m_fSinkInitSuccess = FALSE;
m_fTrySinkInit = FALSE;
DeleteCriticalSection(&m_cs);
}
DECLARE_REGISTRY_RESOURCEID(IDR_READ)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(Cread)
COM_INTERFACE_ENTRY(Iread)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IMailTransportCategorize)
COM_INTERFACE_ENTRY(IEventIsCacheable)
END_COM_MAP()
// Iread
public:
// IEventIsCachable
STDMETHOD (IsCacheable) ();
// IMailTransportCategorize
STDMETHOD (Register)(
ICategorizerParameters *pICatParams);
STDMETHOD (BeginMessageCategorization)(
ICategorizerMailMsgs * pICatMsgs)
{
return E_NOTIMPL;
}
STDMETHOD (EndMessageCategorization)(
ICategorizerMailMsgs *pICatMsgs,
HRESULT hrCatStatus)
{
return E_NOTIMPL;
}
STDMETHOD (BuildQuery)(
ICategorizerParameters *pICatParams,
ICategorizerItem *pICatItem)
{
return E_NOTIMPL;
}
STDMETHOD (BuildQueries)(
ICategorizerParameters *pICatParams,
DWORD dwcAddresses,
ICategorizerItem **rgpICategorizerItems,
ICategorizerQueries *ICatQueries)
{
return E_NOTIMPL;
}
STDMETHOD (SendQuery)(
ICategorizerParameters *pICatParams,
ICategorizerQueries *ICatQueries,
ICategorizerAsyncContext *ICatAsyncCtx,
PVOID pvQueryContext)
{
return E_NOTIMPL;
}
STDMETHOD (SortQueryResult)(
ICategorizerParameters *pICatParams,
HRESULT hrResolutionStatus,
DWORD dwcAddresses,
ICategorizerItem **rgpICategorizerItems,
DWORD dwcResults,
ICategorizerItemAttributes **rgpICategorizerItemAttributes)
{
return E_NOTIMPL;
}
STDMETHOD (ProcessItem)(
ICategorizerParameters *,
ICategorizerItem *);
STDMETHOD (ExpandItem)(
ICategorizerParameters *,
ICategorizerItem *,
IMailTransportNotify *,
PVOID)
{
return E_NOTIMPL;
}
STDMETHOD (CompleteItem)(
ICategorizerParameters *,
ICategorizerItem *)
{
return E_NOTIMPL;
}
HRESULT AllocAndSetPropIdInfo(
eSourceType SourceType,
IMailMsgProperties *pIMailMsgProperties,
IMailMsgRecipientsAdd * pIMailMsgRecipientsAdd,
DWORD dwRecipIndex,
CAttrEntry * pCurrent,
DWORD dwAttrValueCount,
DWORD *pdwPropIdOffset);
HRESULT SaveAttributeValueOnPropIdInfo(
eSourceType SourceType,
IMailMsgProperties *pIMailMsgProperties,
IMailMsgRecipientsAdd *pIMailMsgRecipientsAdd,
DWORD dwRecipIndex,
DWORD dwPropIdOffset,
DWORD dwcbAttributeValue,
PVOID pvAttributeValue);
HRESULT FindAndProcessAttributeFromCat(eSourceType SourceType,
IMailMsgProperties *pIMailMsgProperties,
IMailMsgRecipientsAdd *pIMailMsgRecipientsAdd,
ICategorizerItemRawAttributes * pIRawAttributes,
DWORD dwRecipIndex,
CAttrEntry * pCurrent);
private:
HRESULT CheckIfSinkHasInitalised();
BOOL m_fSinkInitSuccess;
BOOL m_fTrySinkInit;
CAttrList m_attrList;
CRITICAL_SECTION m_cs;
};
#endif //__READ_H_