/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */

/*
 *  Copyright (C) 2008 OMC Denmark ApS.
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as published by
 *  the Free Software Foundation, either version 3 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 Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "IMAPIViewAdviseSinkS_impl.h"
#include "obj_utils.h"

::BRUTUS::BRESULT BRUTUS_IMAPIViewAdviseSink_i::OnShutdown(void)

{
	//Add your implementation here
	return ::BRUTUS::BRUTUS_MAPI_E_NO_SUPPORT;
}

::BRUTUS::BRESULT BRUTUS_IMAPIViewAdviseSink_i::OnNewMessage(void)

{
	//Add your implementation here
	return ::BRUTUS::BRUTUS_MAPI_E_NO_SUPPORT;
}

::BRUTUS::BRESULT BRUTUS_IMAPIViewAdviseSink_i::OnPrint(::CORBA::ULong dwPageNumber,
							::CORBA::Long hrStatus)

{
	//Add your implementation here
	return ::BRUTUS::BRUTUS_MAPI_E_NO_SUPPORT;
}

::BRUTUS::BRESULT BRUTUS_IMAPIViewAdviseSink_i::OnSubmitted(void)

{
	//Add your implementation here
	return ::BRUTUS::BRUTUS_MAPI_E_NO_SUPPORT;
}

::BRUTUS::BRESULT BRUTUS_IMAPIViewAdviseSink_i::OnSaved(void)

{
	//Add your implementation here
	return ::BRUTUS::BRUTUS_MAPI_E_NO_SUPPORT;
}


::BRUTUS::BRESULT BRUTUS_IMAPIViewAdviseSink_i::QueryInterface(const char *iid,
							       ::BRUTUS::IUnknown_out ppvObject)
{
//         ppvObject = ::BRUTUS::IUnknown::_nil();

//         GUID mapi_iid;
//         if (!guid_brutus_to_mapi_no_alloc(iid, &mapi_iid)) {
//                 BRUTUS_LOG_BUG("Could not convert ::BRUTUS::GUID into MAPI GUID");
//                 return ::BRUTUS::BRUTUS_MAPI_E_INVALID_PARAMETER;
//         }

//         HRESULT hr;
//         void *object = NULL;
//         {
//                 ACE_Write_Guard<ACE_RW_Mutex> guard(mutex_);
//                 hr =  mapi_table_->QueryInterface(mapi_iid, &object);
//         }

//         ::BRUTUS::BRESULT br;
//         if (!hresult_to_bresult(hr, br)) {
//                 BRUTUS_LOG_BUG("Could not convert HRESULT into BRESULT");
//                 return ::BRUTUS::BRUTUS_INTERNAL_ERROR;
//         }

//         if (hr == S_OK) {
//                 if (!create_brutus_object(&iid, (LPUNKNOWN)object, poa_, ppvObject, mapi_session_)) {
//                         BRUTUS_LOG_BUG("Could not create brutus object.");
//                         ((LPUNKNOWN)object)->Release();
//                         return ::BRUTUS::BRUTUS_INTERNAL_ERROR;
//                 }
//         }

//         return br;
	return ::BRUTUS::BRUTUS_MAPI_E_NO_SUPPORT;
}

void BRUTUS_IMAPIViewAdviseSink_i::Destroy(::CORBA::ULong InstanceID)
{
	BRUTUS_LOG_INF("Entering BRUTUS_IMAPIViewAdviseSink_i::Destroy()");

	//Add your implementation here

	BRUTUS_LOG_INF("Leaving BRUTUS_IMAPIViewAdviseSink_i::Destroy()");
}
