/* -*- 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_IMSGSTORE_DEF
#define F2T_IMSGSTORE_DEF

#pragma prefix "omc.brutus"

#include "types.idl"
#include "IMAPIProp.idl"
#include "IMAPIAdviseSink.idl"
#include "IMAPITable.idl"
#include "IMessage.idl"
#include "IExchangeManageStore.idl"

module BRUTUS {

        interface IMsgStore : IMAPIProp {
                BRESULT Advise(in ENTRYID lpEntryID,                  
                               in BDEFINE ulEventMask,                
                               in IMAPIAdviseSink lpAdviseSink,               
                               out unsigned long lpulConnection);      

                BRESULT Unadvise(in unsigned long ulConnection);        

                BRESULT CompareEntryIDs(in ENTRYID lpEntryID1,                 
                                        in ENTRYID lpEntryID2,                 
                                        in BDEFINE ulFlags, 
                                        out boolean lpulResult);          

                BRESULT OpenEntry(in ENTRYID lpEntryID,                  
                                  in GUID lpInterface,                
                                  in BDEFINE ulFlags,                    
                                  out BDEFINE lpulObjType,                
                                  out IUnknown lppUnk);              

                BRESULT SetReceiveFolder(in string lpszMessageClass,           
                                         in BDEFINE ulFlags,                    
                                         in ENTRYID lpEntryID);           

                BRESULT GetReceiveFolder(in string lpszMessageClass,           
                                         in BDEFINE ulFlags,                    
                                         out ENTRYID lppEntryID,                 
                                         out string lppszExplicitClass);

                BRESULT GetReceiveFolderTable(in BDEFINE ulFlags,                    
                                              out IMAPITable lppTable);            

                BRESULT StoreLogoff(inout BDEFINE lpulFlags);           

                BRESULT AbortSubmit(in ENTRYID lpEntryID,                  
                                    in BDEFINE ulFlags);             

                BRESULT GetOutgoingQueue(in BDEFINE ulFlags, 
                                         out IMAPITable lppTable);            

                BRESULT SetLockState(in ENTRYID Message,                  
                                     in unsigned long ulLockState);         

                BRESULT FinishedMsg(in BDEFINE ulFlags,                    
                                    in ENTRYID lpEntryID);           

                BRESULT NotifyNewMail(); // Not implemented - Only called by MAPI spooler

		// Alternative to QueryInterface()
		BRESULT GetIExchangeManageStore(out IExchangeManageStore MngStore);

		// Hack alert! Needed by e.g IMAPISession::MailboxLogon()
		// A client should *NEVER* have any use for this method!
                BRESULT GetLocalPointer(out unsigned long long Pointer);
        };

}; // End of module BRUTUS


#endif
