//
//
// (C) Copyright 1998-1999 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted, 
// provided that the above copyright notice appears in all copies and 
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting 
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC. 
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to 
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
// ipstdrop.idl : IDL source for the post-drop (drop with right button mouse) API
//
//

import "oaidl.idl";
import "ocidl.idl";

[
    object,
#ifndef _WIN64
    uuid(17FFF82D-2C82-11d2-BA24-0060B0B5E151),
#else
    uuid(21E36561-85E4-40C2-81DD-EC5DECA63A5D),
#endif
    helpstring("IAcPostDrop Interface"),
    pointer_default(unique)
]

// The purpose of this interface is to allow a component to handle right drag and drop
// in the most flexible way.
// A component may or may not want to handle the drop. Its reply to QueryDoDrop() indicates
// that the default processing will occur, or that the component will handle the drop.
// If the component wants to handle the drop, the interface allows two situations. The first one
// is that the component wants an immediate action for the drop. Then it will run the drop code from
// the PreparePostDrop() method, and will return a value indicating that the drop is done. The second situation
// is that the component wants to present a menu for the user to choose an action. PreparePostDrop() will then 
// return a value indicating the drop is not done yet. In this situation, QueryContextMenu() will be called,
// allowing the component to supply a menu. The user selection will be giving to the component by the component
// by the InvokeCommand() method. Finally, in both situation where PreparePostDrop() has been called, 
// EndPostDrop() is called to let the component performing some cleanup if necessary.

interface IAcPostDrop : IUnknown
{
	// called to ask the component if it wants to handle the drop by its own. or let
	// the default processing happen
    [helpstring ("method QueryDoDrop")]
    HRESULT QueryDoDrop (
			[out, retval] boolean *pbHandleDrop 	// true if the component handle the drop
	);

	// called to prepare the drop. 
    [helpstring ("method PreparePostDrop")]
    HRESULT PreparePostDrop (
			[out, retval] boolean *pbContinue	// tells if QueryContextMenu will be called or not
	);

	// called to get from the component a popup menu
    [helpstring ("method QueryContextMenu")]
    HRESULT QueryContextMenu (
			[out] INT_PTR *phMenu					// handle of popup menu returned by the component
	);

	// called when the user selected a command a the popup menu
    [helpstring ("method InvokeCommand")]
    HRESULT InvokeCommand (
	        [in] int nMenuItemID,					// menu ID
			[out, retval] boolean *pbCancelled		// if set to true the ongoing drop is finally canceled by the component
	);

	// called to allow cleanup
    [helpstring ("method EndPostDrop")]
    HRESULT EndPostDrop ();
}
