/* -*- 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_ISTREAM_DEF
#define F2T_ISTREAM_DEF

#pragma prefix "omc.brutus"

#include "types.idl"
#include "ISequentialStream.idl"


module BRUTUS {

	interface IStream : ISequentialStream {
		BRESULT Clone(out IStream ppstm);

		BRESULT Commit(in STGC grfCommitFlags);

		BRESULT CopyTo(in IStream pstm, 
			       in unsigned long long cb,       
			       out unsigned long long pcbRead,  
			       out unsigned long long pcbWritten);

		BRESULT LockRegion(in unsigned long long libOffset,
				   in unsigned long long cb,
				   in LOCKTYPE dwLockType);

		BRESULT Revert();

		BRESULT Seek(in long long dlibMove,
			     in STREAM_SEEK dwOrigin,
			     out unsigned long long plibNewPosition); // offset from start of stream

		BRESULT SetSize(in unsigned long long libNewSize);

		BRESULT Stat(out STATSTG pstatstg,
			     in STATFLAG grfStatFlag);

		BRESULT UnlockRegion(in unsigned long long libOffset, 
				     in unsigned long long cb,
				     in LOCKTYPE dwLockType);

		BRESULT GetSize(out unsigned long long Size);

	};

}; // End of module BRUTUS


#endif
