#ifdef __PRIVATE__
//#
//#	File:		MenuBar.idl
//#
//#	Contains:	Class definition for ODMenuBar
//#
//#	Owned by:	Richard Rodseth
//#
//#	Copyright:	c 1994 by Apple Computer, Inc., all rights reserved.
//#
//#	Change History (most recent first):
//#
//#		 <5>	 8/25/94	RR		Added fGeneration. Override IsValid
//#		 <4>	 8/15/94	CG		#1181023:  Add IsValid to the API.
//#		 <3>	 6/23/94	RR		Added private SetCommandTable
//#		 <2>	 6/14/94	RR		Added functionprefix
//#		 <1>	  6/8/94	RR		first checked in
//#		 <5>	  6/7/94	RR		Privatise change log
//#		 <1>	  5/9/94	VL		first checked in
//#
//#	To Do:
//#
#else
//#	Copyright:	c 1993-1994 by Apple Computer, Inc., all rights reserved.
#endif

#ifndef _MENUBAR_
#define _MENUBAR_

#ifndef _MENUBARB_
#include "MenuBarB.idl"
#endif

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

interface  ODMenuBar;

//=====================================================================================
// Classes used by this interface
//=====================================================================================

interface  ODSession;
interface  ODPart;

#ifdef __PRIVATE__
//=====================================================================================
// Implementation Types
//=====================================================================================

typedef somToken OrderedCollection;
typedef somToken HACCEL;

#endif //# __PRIVATE

//=====================================================================================
// Class ODMenuBar
//=====================================================================================

#ifdef _PLATFORM_MACINTOSH_

interface ODMenuBar :  ODBaseMenuBar
{
	void InitMenuBar(in ODSession session,
					 in ODPlatformMenuBar menuBar);

#ifdef PLATFORM_MACINTOSH
	void AddSubMenu(in ODMenuID menuID,
   				   in ODPlatformMenu menu,
				   in ODPart part);

	void RegisterCommand(in ODCommandID command,
   						in ODMenuID menu,
						in ODMenuItemID menuItem);

	void UnregisterCommand(in ODCommandID command);

	void UnregisterAll();

	ODBoolean IsCommandRegistered(in ODCommandID command);

	ODBoolean IsCommandSynthetic(in ODCommandID command);

	ODCommandID GetCommand(in ODMenuID menu,
						   in ODMenuItemID menuItem);

	void GetMenuAndItem(in ODCommandID command,
						inout ODMenuID menu,
						inout ODMenuItemID menuItem);
#endif

   void EnableCommand(in ODCommandID cmdNumber,
   					  in ODBoolean enable);

   void CheckCommand(in ODCommandID cmdNumber,
   					 in ODBoolean check);

   void EnableAndCheckCommand(in ODCommandID cmdNumber,
   							  in ODBoolean enable,
							  in ODBoolean check) ;

// $$$$$ CHanged type to ODIText
	void SetItemString(in ODCommandID cmdNumber,
   					  in ODIText itemString);

   void GetItemString(in ODCommandID cmdNumber,
   					  out ODIText itemString);

#ifdef __PRIVATE__
#ifdef PLATFORM_MACINTOSH
//# $$$$$ For Copy Method
	void SetCommandTable(in CommandTable* table);
	
#endif
	void CopyWinMenu( in ODPlatformMenuBar src, in ODPlatformMenuBar dest);
	void SetAccelTable (in HACCEL table);
	HACCEL GetAccelTable ();
	void SetDocumentWindow (in ODPlatformWindow docWindow);
	ODPlatformWindow GetDocumentWindow ();
	ODPlatformMenuBar GetSystemMenus();	
#endif

#ifdef __SOMIDL__
	implementation
  	{
		functionprefix = ODMenuBar;

	override:
    	somInit,
		somUninit,
        Purge,
        Release,

        Display,
        AddMenuLast,
        AddMenuBefore,
        RemoveMenu,
        GetMenu,
		IsValid,
	#ifdef __PRIVATE__
		SetGeneration,
		GetGeneration,
	#endif
        Copy
		;
		
    releaseorder:
        InitMenuBar,
       	AddSubMenu,
        RegisterCommand,
        UnregisterCommand,
        UnregisterAll,
        IsCommandRegistered,
        IsCommandSynthetic,
        GetCommand,
        GetMenuAndItem,
        EnableCommand,
        CheckCommand,
        EnableAndCheckCommand,
        SetItemString,
        GetItemString,
    #ifdef __PRIVATE__
#ifdef PLATFORM_MACINTOSH
		SetCommandTable;
#endif
		CopyWinMenu,
		SetAccelTable,
		GetAccelTable,
		SetDocumentWindow,
		GetDocumentWindow,
		GetSystemMenus;												 //CAHAFIX
	#else
		reserved1,
		reserved2,
		reserved3,
		reserved4,
		reserved5,
		reserved6;													 //CAHAFIX
	#endif

	majorversion = 1; minorversion = 0;
		
    #ifdef __PRIVATE__
	
		passthru C_xih = "
		""
		"class OrderedCollection;"
		"";

		passthru C_xh = "
		""
		"class CommandTable;"
		"";
		
      ODSession  fSession;
      ODPlatformMenuBar fSystemMenus;
#ifdef PLATFORM_MACINTOSH
      OrderedCollection* fOtherMenus;
      CommandTable* fCommandTable;
#endif
	  ODULong fGeneration;	
	  ODPlatformWindow fDocWnd;
 	  HACCEL fAccelTable;
    #endif

  };
#endif //# __SOMIDL__

};

#endif //# _PLATFORM_MACINTOSH_

#endif //# _MENUBAR_
