michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsMenuBaseX_h_ michael@0: #define nsMenuBaseX_h_ michael@0: michael@0: #import michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "nsIContent.h" michael@0: michael@0: enum nsMenuObjectTypeX { michael@0: eMenuBarObjectType, michael@0: eSubmenuObjectType, michael@0: eMenuItemObjectType, michael@0: eStandaloneNativeMenuObjectType, michael@0: }; michael@0: michael@0: // All menu objects subclass this. michael@0: // Menu bars are owned by their top-level nsIWidgets. michael@0: // All other objects are memory-managed based on the DOM. michael@0: // Content removal deletes them immediately and nothing else should. michael@0: // Do not attempt to hold strong references to them or delete them. michael@0: class nsMenuObjectX michael@0: { michael@0: public: michael@0: virtual ~nsMenuObjectX() { } michael@0: virtual nsMenuObjectTypeX MenuObjectType()=0; michael@0: virtual void* NativeData()=0; michael@0: nsIContent* Content() { return mContent; } michael@0: michael@0: protected: michael@0: nsCOMPtr mContent; michael@0: }; michael@0: michael@0: michael@0: // michael@0: // Object stored as "representedObject" for all menu items michael@0: // michael@0: michael@0: class nsMenuGroupOwnerX; michael@0: michael@0: @interface MenuItemInfo : NSObject michael@0: { michael@0: nsMenuGroupOwnerX * mMenuGroupOwner; michael@0: } michael@0: michael@0: - (id) initWithMenuGroupOwner:(nsMenuGroupOwnerX *)aMenuGroupOwner; michael@0: - (nsMenuGroupOwnerX *) menuGroupOwner; michael@0: - (void) setMenuGroupOwner:(nsMenuGroupOwnerX *)aMenuGroupOwner; michael@0: michael@0: @end michael@0: michael@0: michael@0: // Special command IDs that we know Mac OS X does not use for anything else. michael@0: // We use these in place of carbon's IDs for these commands in order to stop michael@0: // Carbon from messing with our event handlers. See bug 346883. michael@0: michael@0: enum { michael@0: eCommand_ID_About = 1, michael@0: eCommand_ID_Prefs = 2, michael@0: eCommand_ID_Quit = 3, michael@0: eCommand_ID_HideApp = 4, michael@0: eCommand_ID_HideOthers = 5, michael@0: eCommand_ID_ShowAll = 6, michael@0: eCommand_ID_Update = 7, michael@0: eCommand_ID_Last = 8 michael@0: }; michael@0: michael@0: #endif // nsMenuBaseX_h_