/* -*- Mode: IDL; 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/>.
 */

#ifndef F2T_ITNEF_DEF
#define F2T_ITNEF_DEF

#pragma prefix "omc.brutus"

#include "types.idl"
#include "IMAPITable.idl"
#include "IMessage.idl"
#include "IStream.idl"

module BRUTUS {

        interface ITnef : IUnknown {
		// lpvData is IStreamTnef if (ulFlags & TNEF_PROP_CONTAINED_TNEF).
		// So - what is it?? IStreamTnef is non-existant so I assumes that 
		// it is identical to IStream. Please correct me on this one...
		// BTW, the IStream interface is given by the "stream" parameter
		// for this case, not the lpvData parameter.
		BRESULT AddProps(in BDEFINE ulFlags,
				 in unsigned long ulElemID,
				 in seq_octet lpvData,
				 in IStream stream,
				 in SPropTagArray lpPropList);

		BRESULT ExtractProps(in BDEFINE ulFlags,
				     in SPropTagArray lpPropList,
				     out STnefProblemArray lpProblems);

		BRESULT Finish(in BDEFINE ulFlags,
			       out unsigned short lpKey,
			       out STnefProblemArray lpProblems);

		// The IMessage *must* reside under the same IMAPISession 
		// as the ITnef reference.
		// This is due to the IMessage::GetLocalPointer() hack
		BRESULT OpenTaggedBody(in IMessage lpMessage,
				       in BDEFINE ulFlags,
				       out IStream lppStream);

		// I am confused.. How can a single SPropValue
		// contain several properties? I will assume for now
		// that lpProps is one and only one SPropValue.
		// Consult MSDN on this one and see for yourself.
		BRESULT SetProps(in BDEFINE ulFlags,
				 in unsigned long ulElemID,
				 in SPropValue lpProps);

		// The IMAPITable *must* reside under the same IMAPISession 
		// as the ITnef reference.
		// This is due to the IMAPITable::GetLocalPointer() hack
		BRESULT EncodeRecips(in BDEFINE ulFlags,
				     in IMAPITable lpRecipientTable);

		BRESULT FinishComponent(in BDEFINE ulFlags,
					in unsigned long ulComponentID,
					in SPropTagArray lpCustomPropList,
					in SPropValue lpCustomProps,
					in SPropTagArray lpPropList,
					out STnefProblemArray lpProblems);
        };

}; // End of module BRUTUS


#endif
