1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 #import <Foundation/Foundation.h>
12 #include "nsIContent.h"
14 enum nsMenuObjectTypeX
{
18 eStandaloneNativeMenuObjectType
,
21 // All menu objects subclass this.
22 // Menu bars are owned by their top-level nsIWidgets.
23 // All other objects are memory-managed based on the DOM.
24 // Content removal deletes them immediately and nothing else should.
25 // Do not attempt to hold strong references to them or delete them.
29 virtual ~nsMenuObjectX() { }
30 virtual nsMenuObjectTypeX
MenuObjectType()=0;
31 virtual void* NativeData()=0;
32 nsIContent
* Content() { return mContent
; }
35 * Called when an icon of a menu item somewhere in this menu has updated.
36 * Menu objects with parents need to propagate the notification to their
39 virtual void IconUpdated() {}
42 nsCOMPtr
<nsIContent
> mContent
;
47 // Object stored as "representedObject" for all menu items
50 class nsMenuGroupOwnerX
;
52 @interface MenuItemInfo
: NSObject
54 nsMenuGroupOwnerX
* mMenuGroupOwner
;
57 - (id
) initWithMenuGroupOwner
:(nsMenuGroupOwnerX
*)aMenuGroupOwner
;
58 - (nsMenuGroupOwnerX
*) menuGroupOwner
;
59 - (void) setMenuGroupOwner
:(nsMenuGroupOwnerX
*)aMenuGroupOwner
;
64 // Special command IDs that we know Mac OS X does not use for anything else.
65 // We use these in place of carbon's IDs for these commands in order to stop
66 // Carbon from messing with our event handlers. See bug 346883.
69 eCommand_ID_About
= 1,
70 eCommand_ID_Prefs
= 2,
72 eCommand_ID_HideApp
= 4,
73 eCommand_ID_HideOthers
= 5,
74 eCommand_ID_ShowAll
= 6,
75 eCommand_ID_Update
= 7,
79 #endif // nsMenuBaseX_h_