Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / widget / cocoa / nsMenuBaseX.h
blob5b9f89c560f90544daa7f3ebdd0a4e2f683c172c
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/. */
6 #ifndef nsMenuBaseX_h_
7 #define nsMenuBaseX_h_
9 #import <Foundation/Foundation.h>
11 #include "nsCOMPtr.h"
12 #include "nsIContent.h"
14 enum nsMenuObjectTypeX {
15 eMenuBarObjectType,
16 eSubmenuObjectType,
17 eMenuItemObjectType,
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.
26 class nsMenuObjectX
28 public:
29 virtual ~nsMenuObjectX() { }
30 virtual nsMenuObjectTypeX MenuObjectType()=0;
31 virtual void* NativeData()=0;
32 nsIContent* Content() { return mContent; }
34 /**
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
37 * parent.
39 virtual void IconUpdated() {}
41 protected:
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;
61 @end
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.
68 enum {
69 eCommand_ID_About = 1,
70 eCommand_ID_Prefs = 2,
71 eCommand_ID_Quit = 3,
72 eCommand_ID_HideApp = 4,
73 eCommand_ID_HideOthers = 5,
74 eCommand_ID_ShowAll = 6,
75 eCommand_ID_Update = 7,
76 eCommand_ID_Last = 8
79 #endif // nsMenuBaseX_h_