/* @(#)Z 1.1 nt/src/ui/MenuAdW.idl, odui, od96nt, odnt9712d 97/03/21 17:37:29 (96/09/25 15:05:23) */
//#====START_GENERATED_PROLOG======================================
//#
//#
//#   COMPONENT_NAME: odui
//#
//#   CLASSES: none
//#
//#   ORIGINS: 82,27
//#
//#
//#   (C) COPYRIGHT International Business Machines Corp. 1995,1996
//#   All Rights Reserved
//#   Licensed Materials - Property of IBM
//#   US Government Users Restricted Rights - Use, duplication or
//#   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//#   	
//#   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
//#   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
//#   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
//#   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
//#   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
//#   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
//#   OR PERFORMANCE OF THIS SOFTWARE.
//#
//#====END_GENERATED_PROLOG========================================
#ifdef __PRIVATE__
// -------------------------------------------------------------------------
//   File:	MenuAdW.idl
//   Contains:	Class definition for ODWinMenuAdapter
//   $Author:	purple $
//   $Date:	1996/09/09 14:54:01 $
//   $Source:	
//   $Revision: 1.1 $
// -------------------------------------------------------------------------
// 
// 	Copyright:	1994 by Apple Computer, Inc., all rights reserved.
// 	Copyright:	1994 International Business Machines, Inc.
// 
// 	Change History (most recent first):
// 	<1>	purple 96/09/21		modify from OS/2 MenuAdO.idl
//
#endif // __PRIVATE__

#ifndef _WINMENUADAPTER_
#define _WINMENUADAPTER_

#include "Part.idl"

//=============================================================================
// Classes defined in this interface
//=============================================================================

interface  ODWinMenuAdapter;

struct ODWinMenuItemAdapter {
    ODMenuItemID        id;
    ODWinMenuAdapter*   parentAdapter;
    ODWinMenuAdapter*   subMenuAdapter;

    ODBoolean           enabled;
    ODBoolean           hidden;
    ODBoolean           checked;
    ODBoolean           separator;
    string              text;
};

//=============================================================================
// Classes used by this interface
//=============================================================================
#ifdef __PRIVATE__
interface  ODPart;
#endif //  __PRIVATE

typedef somToken OrderedCollection;

#ifdef __PRIVATE__
//=============================================================================
// Implementation Types
//=============================================================================
#endif //  __PRIVATE

//=============================================================================
// Class ODWinMenuAdapter
//=============================================================================

interface ODWinMenuAdapter : ODObject
{
    void Init			(in ODMenuID id,
				 in HMENU parentHMENU);

    void AddItemsFromPlatMenuEx	(in ODPlatformMenu platMenu,
				 in ODUShort       subMenuIDcount,
				 in ODMenuIDInfo  *subMenuIDinfo);

    ODMenuID MenuID		();

    ODBoolean IsMenuEnabled	();

    void DisableMenu		();

    void EnableMenu		();

    ODUShort GetMenuText	(out string menuString);

    ODBoolean SetMenuText	(in string menuString);

    ODUShort GetMenuItemText	(in ODMenuItemID menuItemID,
				 out string menuItemString);

    ODBoolean SetMenuItemText	(in ODMenuItemID menuItemID,
				 in string menuItemString);

    ODBoolean SetHideMenuItem	(in ODMenuItemID menuItemID);

    ODBoolean SetShowMenuItem	(in ODMenuItemID menuItemID);

    ODBoolean CheckMenuItem	(in ODMenuItemID menuItemID,
				 in ODBoolean check);

    ODBoolean EnableMenuItem	(in ODMenuItemID menuItemID,
				 in ODBoolean enable);

    ODBoolean AddMenuItemBefore	(in ODMenuItemID itemID,
				 in ODPlatformMenuItem item,
				 in ODMenuItemID beforeID);

    ODBoolean AddMenuItemLast	(in ODMenuItemID itemID,
				 in ODPlatformMenuItem item);

    ODBoolean AddSubMenuBeforeEx(in ODMenuID subMenuID,
				 in ODPlatformMenu subMenu,
				 in ODMenuItemID  beforeID,
				 in ODUShort      subMenuIDcount,
				 in ODMenuIDInfo *subMenuIDinfo);

    ODBoolean AddSubMenuLastEx	(in ODMenuID subMenuID,
				 in ODPlatformMenu subMenu,
				 in ODUShort       subMenuIDcount,
				 in ODMenuIDInfo  *subMenuIDinfo);

    ODPlatformMenu GetSubMenu	(in ODMenuID subMenuID);

    ODBoolean ItemExists	(in ODMenuItemID menuItemID);

    ODBoolean IsItemEnabled	(in ODMenuItemID menuItemID);

    ODBoolean IsItemChecked	(in ODMenuItemID menuItemID);

    ODBoolean IsItemHidden	(in ODMenuItemID menuItemID);

    ODBoolean RemoveMenuItem	(in ODMenuItemID menuItemID);

    ODBoolean GetPlatMenuItem	(in ODWinMenuItemAdapter* itemAd,
				 out ODPlatformMenuItem platMenuItem);

    ODBoolean GetPlatMenu	(out ODPlatformMenu platMenu);

    ODBoolean GetSubMenuAdapter	(in ODMenuID subMenuID,
				 out ODWinMenuAdapter subMenuAd);

    ODUShort  GetPosInParentMenu();

    ODBoolean GetSubMenuIDInfo	(inout OrderedCollection IDinfo);

#ifdef __PRIVATE__
    ODPart GetPart		();

    void SetPart		(in ODPart part);

    ODBoolean GetMenuItemAdapter(in  ODMenuItemID id,
				 out ODWinMenuItemAdapter* itemAd);

    ODBoolean GetMenuItemPosition(in  ODMenuItemID id,
				  out ODUShort pos);
#endif

#ifdef __SOMIDL__
    implementation
    {
	majorversion   = 1; minorversion = 0;
	functionprefix = ODWinMenuAdapter;

	override: somInit, somUninit;

	passthru C_xh_before =
		"typedef struct ODWinMenuItemAdapter {"
		"    ODMenuItemID        id;"
		"    ODWinMenuAdapter*   parentAdapter;"
		"    ODWinMenuAdapter*   subMenuAdapter;"
		""
		"    ODBoolean           enabled;"
		"    ODBoolean           hidden;"
		"    ODBoolean           checked;"
		"    ODBoolean           separator;"
		"    string              text;"
		"};"
		""
		"";

	releaseorder:
	    Init,
	    AddItemsFromPlatMenuEx,
	    MenuID,
	    IsMenuEnabled,
	    DisableMenu,
	    EnableMenu,
	    GetMenuText,
	    SetMenuText,
	    GetMenuItemText,
	    SetMenuItemText,
	    SetHideMenuItem,
	    SetShowMenuItem,
	    CheckMenuItem,
	    EnableMenuItem,
	    AddMenuItemBefore,
	    AddMenuItemLast,
	    AddSubMenuBeforeEx,
	    AddSubMenuLastEx,
	    GetSubMenu,
	    ItemExists,
	    IsItemEnabled,
	    IsItemChecked,
	    IsItemHidden,
	    RemoveMenuItem,
	    GetPlatMenuItem,
	    GetPlatMenu,
	    GetSubMenuAdapter,
	    GetPosInParentMenu,
	    GetSubMenuIDInfo,
	#ifdef __PRIVATE__
	    GetPart,
	    SetPart,
	    GetMenuItemAdapter,
	    GetMenuItemPosition;
	#else
	    reserved1,
	    reserved2,
	    reserved3,
	    reserved4;
	#endif

	#ifdef __PRIVATE__
	    passthru C_xih =
		""
		"class OrderedCollection;"
		"";

	    ODMenuID    	fMenuID;
	    ODBoolean   	fMenuIsEnabled;
	    OrderedCollection*  fMenuItems;

	    ODPart		fPart;
	    char*		fMenuLabel;
	    HMENU		fMenuHMENU;
	    HMENU		fParentHMENU;
	#endif // __PRIVATE__

    };
#endif // __SOMIDL__

}; // end class ODWinMenuAdapter

#endif //  _WINMENUADAPTER_
